From 512ef37b330c16029bd0a2721efe07ce9a31f90b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jun 2023 22:42:12 +0000 Subject: [PATCH] feat: [documentai] add StyleInfo to document.proto (#4352) - [ ] Regenerate this pull request now. feat: add IMPORTING enum to State in processor.proto chore: updated comments PiperOrigin-RevId: 540937637 Source-Link: https://togithub.com/googleapis/googleapis/commit/b2b372306493306c2c08e808def1412366df690a Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/9f620d19ce9a3aaf50136c9985d605106f72baeb Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjlmNjIwZDE5Y2U5YTNhYWY1MDEzNmM5OTg1ZDYwNTEwNmY3MmJhZWIifQ== BEGIN_NESTED_COMMIT feat: [documentai] add StyleInfo to document.proto feat: add REPLACE enum to OperationType in document.proto feat: add PropertyMetadata and EntityTypeMetadata to document_schema.proto feat: add IMPORTING enum to State in processor.proto chore: updated comments PiperOrigin-RevId: 540932243 Source-Link: https://togithub.com/googleapis/googleapis/commit/120a89c6c7660b0503a796f91e6e469fb3354131 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/82a61cd89b4899ac94c87791916b77bf2ab73d16 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjgyYTYxY2Q4OWI0ODk5YWM5NGM4Nzc5MTkxNmI3N2JmMmFiNzNkMTYifQ== END_NESTED_COMMIT --- packages/google-cloud-documentai/README.md | 106 +- .../google/cloud/documentai/v1/barcode.proto | 2 +- .../google/cloud/documentai/v1/document.proto | 116 +- .../cloud/documentai/v1/document_io.proto | 2 +- .../v1/document_processor_service.proto | 302 +- .../cloud/documentai/v1/document_schema.proto | 15 +- .../cloud/documentai/v1/evaluation.proto | 2 +- .../google/cloud/documentai/v1/geometry.proto | 2 +- .../documentai/v1/operation_metadata.proto | 2 +- .../cloud/documentai/v1/processor.proto | 22 +- .../cloud/documentai/v1/processor_type.proto | 7 +- .../cloud/documentai/v1beta3/barcode.proto | 2 +- .../cloud/documentai/v1beta3/dataset.proto | 138 + .../cloud/documentai/v1beta3/document.proto | 118 +- .../documentai/v1beta3/document_io.proto | 13 +- .../v1beta3/document_processor_service.proto | 397 +- .../documentai/v1beta3/document_schema.proto | 53 +- .../documentai/v1beta3/document_service.proto | 112 + .../cloud/documentai/v1beta3/evaluation.proto | 2 +- .../cloud/documentai/v1beta3/geometry.proto | 2 +- .../v1beta3/operation_metadata.proto | 2 +- .../cloud/documentai/v1beta3/processor.proto | 22 +- .../documentai/v1beta3/processor_type.proto | 7 +- .../protos/protos.d.ts | 10754 +++-- .../google-cloud-documentai/protos/protos.js | 36120 +++++++++------- .../protos/protos.json | 1143 +- .../google-cloud-documentai/samples/README.md | 54 +- ...ocessor_service.batch_process_documents.js | 12 +- ...ment_processor_service.create_processor.js | 8 +- ...processor_service.fetch_processor_types.js | 5 +- ...ment_processor_service.list_evaluations.js | 4 +- ..._processor_service.list_processor_types.js | 9 +- ...ocessor_service.list_processor_versions.js | 4 +- ...ument_processor_service.list_processors.js | 4 +- ...ment_processor_service.process_document.js | 11 +- ...ument_processor_service.review_document.js | 5 +- ...ocessor_service.train_processor_version.js | 3 +- ...t_metadata.google.cloud.documentai.v1.json | 22 +- ...adata.google.cloud.documentai.v1beta1.json | 2 +- ...adata.google.cloud.documentai.v1beta2.json | 2 +- ...ocessor_service.batch_process_documents.js | 12 +- ...ment_processor_service.create_processor.js | 8 +- ...processor_service.fetch_processor_types.js | 5 +- ...cessor_service.import_processor_version.js | 3 +- ...ment_processor_service.list_evaluations.js | 4 +- ..._processor_service.list_processor_types.js | 9 +- ...ocessor_service.list_processor_versions.js | 4 +- ...ument_processor_service.list_processors.js | 4 +- ...ment_processor_service.process_document.js | 16 +- ...ument_processor_service.review_document.js | 5 +- ...ocessor_service.train_processor_version.js | 7 +- .../document_service.get_dataset_schema.js | 67 + .../document_service.update_dataset.js | 67 + .../document_service.update_dataset_schema.js | 66 + ...adata.google.cloud.documentai.v1beta3.json | 160 +- .../v1/document_processor_service_client.ts | 121 +- ...ument_processor_service_client_config.json | 2 +- .../document_processor_service_client.ts | 238 +- ...ument_processor_service_client_config.json | 2 +- ...document_processor_service_proto_list.json | 2 + .../src/v1beta3/document_service_client.ts | 1398 + .../document_service_client_config.json | 38 + .../v1beta3/document_service_proto_list.json | 14 + .../src/v1beta3/gapic_metadata.json | 44 + .../src/v1beta3/index.ts | 1 + ...apic_document_processor_service_v1beta3.ts | 134 + .../test/gapic_document_service_v1beta3.ts | 1618 + 67 files changed, 32377 insertions(+), 21280 deletions(-) create mode 100644 packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto create mode 100644 packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto create mode 100644 packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js create mode 100644 packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js create mode 100644 packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js create mode 100644 packages/google-cloud-documentai/src/v1beta3/document_service_client.ts create mode 100644 packages/google-cloud-documentai/src/v1beta3/document_service_client_config.json create mode 100644 packages/google-cloud-documentai/src/v1beta3/document_service_proto_list.json create mode 100644 packages/google-cloud-documentai/test/gapic_document_service_v1beta3.ts diff --git a/packages/google-cloud-documentai/README.md b/packages/google-cloud-documentai/README.md index c64b8ae20a6..384030aeb8c 100644 --- a/packages/google-cloud-documentai/README.md +++ b/packages/google-cloud-documentai/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Document AI: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Document AI: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-documentai) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/documentai.svg)](https://www.npmjs.org/package/@google-cloud/documentai) @@ -131,60 +131,62 @@ async function quickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-documentai/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js,samples/README.md) | -| Document_understanding_service.batch_process_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js,samples/README.md) | -| Document_understanding_service.batch_process_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js,samples/README.md) | -| Document_understanding_service.process_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.process_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.process_document.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js,samples/README.md) | -| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/test/quickstart.test.js,samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_understanding_service.batch_process_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js,packages/google-cloud-documentai/samples/README.md) | +| Document_understanding_service.batch_process_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js,packages/google-cloud-documentai/samples/README.md) | +| Document_understanding_service.process_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.process_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta2/document_understanding_service.process_document.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_processor_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js,packages/google-cloud-documentai/samples/README.md) | +| Document_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js,packages/google-cloud-documentai/samples/README.md) | +| Document_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js,packages/google-cloud-documentai/samples/README.md) | +| Document_service.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js,packages/google-cloud-documentai/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/quickstart.js,packages/google-cloud-documentai/samples/README.md) | diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto index c131dcbed29..805203ba020 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 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/v1/document.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto index f3431b3d4af..92ccfc0a929 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -64,7 +64,8 @@ message Document { // Font size for the text. float size = 1; - // Unit for the font size. Follows CSS naming (in, px, pt, etc.). + // Unit for the font size. Follows CSS naming (such as `in`, `px`, and + // `pt`). string unit = 2; } @@ -78,17 +79,18 @@ message Document { // Text background color. google.type.Color background_color = 3; - // Font weight. Possible values are normal, bold, bolder, and lighter. - // https://www.w3schools.com/cssref/pr_font_weight.asp + // [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. Possible values are normal, italic, and oblique. - // https://www.w3schools.com/cssref/pr_font_font-style.asp + // [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. Follows CSS standard. - // - // https://www.w3schools.com/cssref/pr_text_text-decoration.asp + // [Text + // decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + // Follows CSS standard. + // string text_decoration = 6; // Font size. @@ -118,7 +120,9 @@ message Document { // Raw byte content of the image. bytes content = 1; - // Encoding mime type for the image. + // 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. @@ -255,6 +259,59 @@ message Document { 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. + bool strikeout = 8; + + // Whether the text is a subscript. + bool subscript = 9; + + // Whether the text is a superscript. + bool superscript = 10; + + // Whether the text is in small caps. + 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; @@ -268,6 +325,9 @@ message Document { // The history of this annotation. Provenance provenance = 4 [deprecated = true]; + + // Text style attributes. + StyleInfo style_info = 5; } // A detected symbol. @@ -333,7 +393,7 @@ message Document { repeated DetectedLanguage detected_languages = 4; // The history of this table. - Provenance provenance = 5; + Provenance provenance = 5 [deprecated = true]; } // A form field detected on the page. @@ -388,16 +448,16 @@ message Document { // Detected language for a structural component. message DetectedLanguage { - // The BCP-47 language code, such as `en-US` or `sr-Latn`. For more - // information, see - // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + // 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 + // Image quality scores for the page image. message ImageQualityScores { // Image Quality Defects message DetectedDefect { @@ -413,12 +473,12 @@ message Document { // - `quality/defect_glare` string type = 1; - // Confidence of detected defect. Range `[0, 1]` where 1 indicates - // strong confidence of that the defect exists. + // 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. + // The overall quality score. Range `[0, 1]` where `1` is perfect quality. float quality_score = 1; // A list of detected defects. @@ -482,7 +542,7 @@ message Document { // A list of detected barcodes. repeated DetectedBarcode detected_barcodes = 15; - // Image Quality Scores. + // Image quality scores. ImageQualityScores image_quality_scores = 17; // The history of this page. @@ -736,9 +796,9 @@ message Document { REMOVE = 2; // Updates any fields within the given provenance scope of the message. It - // 'overwrites' the fields rather than replacing them. This is - // especially relevant when we just want to update a field value of an - // entity without also affecting all the child properties. + // 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`. @@ -835,10 +895,9 @@ message Document { // 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. - // See [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more - // info. + // `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. @@ -847,9 +906,8 @@ message Document { bytes content = 2 [(google.api.field_behavior) = OPTIONAL]; } - // An IANA published MIME type (also referred to as media type). For more - // information, see - // https://www.iana.org/assignments/media-types/media-types.xhtml. + // 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. diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto index 23768b7544e..48adefbb98b 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 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/v1/document_processor_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto index eec77bd88e4..915f0fd6438 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/locations/{location}" }; -// Service to call Cloud DocumentAI to process documents according to the +// 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. @@ -90,8 +90,9 @@ service DocumentProcessorService { }; } - // Fetches processor types. Note that we do not use ListProcessorTypes here - // because it is not paginated. + // 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) = { @@ -135,7 +136,7 @@ service DocumentProcessorService { // Trains a new processor version. // Operation metadata is returned as - // cloud_documentai_core.TrainProcessorVersionMetadata. + // [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. rpc TrainProcessorVersion(TrainProcessorVersionRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -209,8 +210,9 @@ service DocumentProcessorService { }; } - // Creates a processor from the type processor that the user chose. - // The processor will be at "ENABLED" state by default after its creation. + // Creates a processor from the + // [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + // processor will be at `ENABLED` state by default after its creation. rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/processors" @@ -324,7 +326,9 @@ service DocumentProcessorService { } } -// Request message for the process document method. +// Request message for the +// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] +// method. message ProcessRequest { // The document payload. oneof source { @@ -350,13 +354,14 @@ message ProcessRequest { (google.api.resource_reference) = { type: "*" } ]; - // Whether Human Review feature should be skipped for this request. Default to - // false. + // Whether human review should be skipped for this request. Default to + // `false`. bool skip_human_review = 3; - // Specifies which fields to include in ProcessResponse's document. - // Only supports top level document and pages field so it must be in the form - // of `{document_field_name}` or `pages.{page_field_name}`. + // 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; } @@ -368,7 +373,7 @@ message HumanReviewStatus { STATE_UNSPECIFIED = 0; // Human review is skipped for the document. This can happen because human - // review is not enabled on the processor or the processing request has + // review isn't enabled on the processor or the processing request has // been set to skip this document. SKIPPED = 1; @@ -379,7 +384,8 @@ message HumanReviewStatus { IN_PROGRESS = 3; // Some error happened during triggering human review, see the - // [state_message] for details. + // [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] + // for details. ERROR = 4; } @@ -390,13 +396,17 @@ message HumanReviewStatus { string state_message = 2; // The name of the operation triggered by the processed document. This field - // is populated only when the [state] is [HUMAN_REVIEW_IN_PROGRESS]. It has - // the same response type and metadata as the long running operation returned - // by [ReviewDocument] method. + // 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 process document method. +// 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. @@ -406,7 +416,8 @@ message ProcessResponse { HumanReviewStatus human_review_status = 3; } -// Request message for batch process document method. +// Request message for +// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. message BatchProcessRequest { // Required. The resource name of // [Processor][google.cloud.documentai.v1.Processor] or @@ -419,34 +430,40 @@ message BatchProcessRequest { (google.api.resource_reference) = { type: "*" } ]; - // The input documents for batch process. + // The input documents for the + // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + // method. BatchDocumentsInputConfig input_documents = 5; - // The overall output config for batch process. + // The output configuration for the + // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + // method. DocumentOutputConfig document_output_config = 6; - // Whether Human Review feature should be skipped for this request. Default to - // false. + // Whether human review should be skipped for this request. Default to + // `false`. bool skip_human_review = 4; } -// Response message for batch process document method. +// Response message for +// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. message BatchProcessResponse {} -// The long running operation metadata for batch process method. +// 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] field in the - // request when the batch process started. The batch process is started by - // take snapshot of that document, since a user can move or change that - // document during the process. + // 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 output_gcs_destination (in the request as `output_gcs_destination`) + // 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; @@ -495,11 +512,13 @@ message BatchProcessMetadata { repeated IndividualProcessStatus individual_process_statuses = 5; } -// Request message for fetch processor types. +// 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 project of processor type to list. - // The available processor types may depend on the allow-listing on projects. - // Format: `projects/{project}/locations/{location}` + // 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) = { @@ -508,17 +527,21 @@ message FetchProcessorTypesRequest { ]; } -// Response message for fetch processor types. +// 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 list processor types. +// 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 type to list. - // The available processor types may depend on the allow-listing on projects. - // Format: `projects/{project}/locations/{location}` + // 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) = { @@ -527,15 +550,17 @@ message ListProcessorTypesRequest { ]; // 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. + // 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 list processor types. +// Response message for the +// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] +// method. message ListProcessorTypesResponse { // The processor types. repeated ProcessorType processor_types = 1; @@ -556,8 +581,8 @@ message ListProcessorsRequest { ]; // 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. + // 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 @@ -565,7 +590,9 @@ message ListProcessorsRequest { string page_token = 3; } -// Response message for list processors. +// Response message for the +// [ListProcessors][google.cloud.documentai.v1.DocumentProcessorService.ListProcessors] +// method. message ListProcessorsResponse { // The list of processors. repeated Processor processors = 1; @@ -574,7 +601,9 @@ message ListProcessorsResponse { string next_page_token = 2; } -// Request message for get processor. +// Request message for the +// [GetProcessorType][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType] +// method. message GetProcessorTypeRequest { // Required. The processor type resource name. string name = 1 [ @@ -585,7 +614,9 @@ message GetProcessorTypeRequest { ]; } -// Request message for get processor. +// Request message for the +// [GetProcessor][google.cloud.documentai.v1.DocumentProcessorService.GetProcessor] +// method. message GetProcessorRequest { // Required. The processor resource name. string name = 1 [ @@ -596,7 +627,9 @@ message GetProcessorRequest { ]; } -// Request message for get processor version. +// Request message for the +// [GetProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion] +// method. message GetProcessorVersionRequest { // Required. The processor resource name. string name = 1 [ @@ -620,8 +653,8 @@ message ListProcessorVersionsRequest { ]; // 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. + // 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 @@ -629,7 +662,9 @@ message ListProcessorVersionsRequest { string page_token = 3; } -// Response message for list processors. +// Response message for the +// [ListProcessorVersions][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions] +// method. message ListProcessorVersionsResponse { // The list of processors. repeated ProcessorVersion processor_versions = 1; @@ -638,7 +673,9 @@ message ListProcessorVersionsResponse { string next_page_token = 2; } -// Request message for the delete processor version method. +// 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 [ @@ -649,13 +686,17 @@ message DeleteProcessorVersionRequest { ]; } -// The long running operation metadata for delete processor version method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for the deploy processor version method. +// 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 [ @@ -666,16 +707,22 @@ message DeployProcessorVersionRequest { ]; } -// Response message for the deploy processor version method. +// Response message for the +// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion] +// method. message DeployProcessorVersionResponse {} -// The long running operation metadata for deploy processor version method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for the undeploy processor version method. +// 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 [ @@ -686,19 +733,24 @@ message UndeployProcessorVersionRequest { ]; } -// Response message for the undeploy processor version method. +// Response message for the +// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion] +// method. message UndeployProcessorVersionResponse {} -// The long running operation metadata for the undeploy processor version +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for create a processor. Notice this request is sent to -// a regionalized backend service, and if the processor type is not available -// on that region, the creation will fail. +// 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}` @@ -709,13 +761,17 @@ message CreateProcessorRequest { } ]; - // Required. The processor to be created, requires [processor_type] and - // [display_name] to be set. Also, the processor is under CMEK if CMEK fields - // are set. + // Required. The processor to be created, requires + // [Processor.type][google.cloud.documentai.v1.Processor.type] and + // [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 delete processor method. +// 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 [ @@ -726,13 +782,17 @@ message DeleteProcessorRequest { ]; } -// The long running operation metadata for delete processor method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 5; } -// Request message for the enable processor method. +// 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 [ @@ -743,17 +803,22 @@ message EnableProcessorRequest { ]; } -// Response message for the enable processor method. -// Intentionally empty proto for adding fields in future. +// 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 enable processor method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 5; } -// Request message for the disable processor method. +// 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 [ @@ -764,17 +829,22 @@ message DisableProcessorRequest { ]; } -// Response message for the disable processor method. -// Intentionally empty proto for adding fields in future. +// 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 disable processor method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 5; } -// Request message for the set default processor version method. +// 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 @@ -798,19 +868,25 @@ message SetDefaultProcessorVersionRequest { ]; } -// Response message for set default processor version method. +// Response message for the +// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion] +// method. message SetDefaultProcessorVersionResponse {} -// The long running operation metadata for set default processor version +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for the create processor version method. +// Request message for the +// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion] +// method. message TrainProcessorVersionRequest { - // The input data used to train a new `ProcessorVersion`. + // 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; @@ -836,7 +912,8 @@ message TrainProcessorVersionRequest { // 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`. + // 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 @@ -845,7 +922,8 @@ message TrainProcessorVersionRequest { string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL]; } -// The response for the TrainProcessorVersion method. +// 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; @@ -873,7 +951,7 @@ message TrainProcessorVersionMetadata { repeated google.rpc.Status dataset_errors = 2; } - // The basic metadata of the long running operation. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; // The training dataset validation information. @@ -883,7 +961,9 @@ message TrainProcessorVersionMetadata { DatasetValidation test_dataset_validation = 3; } -// Request message for review document method. +// Request message for the +// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] +// method. message ReviewDocumentRequest { // The priority level of the human review task. enum Priority { @@ -901,8 +981,9 @@ message ReviewDocumentRequest { Document inline_document = 4; } - // Required. The resource name of the HumanReviewConfig that the document will - // be reviewed with. + // 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) = { @@ -920,7 +1001,9 @@ message ReviewDocumentRequest { DocumentSchema document_schema = 6; } -// Response message for review document method. +// Response message for the +// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] +// method. message ReviewDocumentResponse { // Possible states of the review operation. enum State { @@ -945,16 +1028,20 @@ message ReviewDocumentResponse { string rejection_reason = 3; } -// The long running operation metadata for review document method. +// 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. + // 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 against the supplied documents. +// 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 @@ -973,13 +1060,17 @@ message EvaluateProcessorVersionRequest { [(google.api.field_behavior) = OPTIONAL]; } -// Metadata of the EvaluateProcessorVersion method. +// Metadata of the +// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion] +// method. message EvaluateProcessorVersionMetadata { - // The basic metadata of the long running operation. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Metadata of the EvaluateProcessorVersion method. +// Response of the +// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion] +// method. message EvaluateProcessorVersionResponse { // The resource name of the created evaluation. string evaluation = 2; @@ -998,7 +1089,8 @@ message GetEvaluationRequest { ]; } -// Retrieves a list of evaluations for a given ProcessorVersion. +// 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 @@ -1012,8 +1104,8 @@ message ListEvaluationsRequest { ]; // The standard list page size. - // If unspecified, at most 5 evaluations will be returned. - // The maximum value is 100; values above 100 will be coerced to 100. + // 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. @@ -1021,7 +1113,7 @@ message ListEvaluationsRequest { string page_token = 3; } -// The response from ListEvaluations. +// The response from `ListEvaluations`. message ListEvaluationsResponse { // The evaluations requested. repeated Evaluation evaluations = 1; diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto index 0b2cf60c1e0..028ef2aa750 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -92,16 +92,15 @@ message DocumentSchema { string display_name = 13; // Name of the type. It must be unique within the schema file and - // cannot be a 'Common Type'. Besides that we use the following naming - // conventions: + // cannot be a "Common Type". The following naming conventions are used: // - // - *use `snake_casing`* - // - name matching is case-sensitive + // - 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) + // 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. @@ -117,8 +116,8 @@ message DocumentSchema { // 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 + // 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; diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto index 0662470a8b2..433fba583fe 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 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/v1/geometry.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/geometry.proto index ce668ec8e7a..18fbeaaf0d2 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/geometry.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 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/v1/operation_metadata.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto index b922bf4cc3a..533f758ae0a 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 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/v1/processor.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto index 8c257c548b6..68b99bcbd95 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,10 +31,9 @@ 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, pre-trained by Google internally or up-trained -// by the customer. At a time, a processor can only have one default version -// version. So the processor's behavior (when processing documents) is defined -// by a default version +// 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" @@ -78,6 +77,9 @@ message ProcessorVersion { // The processor version failed and is in an indeterminate state. FAILED = 7; + + // The processor version is being imported. + IMPORTING = 8; } // The resource name of the processor version. @@ -106,7 +108,7 @@ message ProcessorVersion { // The KMS key version with which data is encrypted. string kms_key_version_name = 10; - // Denotes that this ProcessorVersion is managed by google. + // Denotes that this `ProcessorVersion` is managed by Google. bool google_managed = 11; // If set, information about the eventual deprecation of this version. @@ -163,8 +165,8 @@ message Processor { (google.api.field_behavior) = OUTPUT_ONLY ]; - // The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. - // To get a list of processors types, see + // 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; @@ -189,7 +191,7 @@ message Processor { // The time the processor was created. google.protobuf.Timestamp create_time = 7; - // The KMS key used for encryption/decryption in CMEK scenarios. - // See https://cloud.google.com/security-key-management. + // The [KMS key](https://cloud.google.com/security-key-management) used for + // encryption and decryption in CMEK scenarios. string kms_key_name = 8; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto index e5f6eca0a89..ae88dda8d70 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,7 +37,8 @@ message ProcessorType { // The location information about where the processor is available. message LocationInfo { - // The location id, currently must be one of [us, eu]. + // The location ID. For supported locations, refer to [regional and + // multi-regional support](/document-ai/docs/regions). string location_id = 1; } @@ -45,7 +46,7 @@ message ProcessorType { // Format: `projects/{project}/processorTypes/{processor_type}` string name = 1; - // The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. + // The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. string type = 2; // The processor category, used by UI to group processor types. 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 a5148172b7b..f0580e69af8 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 2022 Google LLC +// Copyright 2023 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 new file mode 100644 index 00000000000..fa50183bbb5 --- /dev/null +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto @@ -0,0 +1,138 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_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 {} + + // Configuration specific to spanner-based indexing. + message SpannerIndexingConfig {} + + // 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. Document AI Warehouse-based dataset configuration. + DocumentWarehouseConfig document_warehouse_config = 5 + [(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]; + } + + 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` + string name = 1; + + // Required. State of the dataset. Ignored when updating dataset. + State state = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// 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]; +} 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 193f7700d51..8250d4d6660 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -64,7 +64,8 @@ message Document { // Font size for the text. float size = 1; - // Unit for the font size. Follows CSS naming (in, px, pt, etc.). + // Unit for the font size. Follows CSS naming (such as `in`, `px`, and + // `pt`). string unit = 2; } @@ -78,17 +79,18 @@ message Document { // Text background color. google.type.Color background_color = 3; - // Font weight. Possible values are normal, bold, bolder, and lighter. - // https://www.w3schools.com/cssref/pr_font_weight.asp + // [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. Possible values are normal, italic, and oblique. - // https://www.w3schools.com/cssref/pr_font_font-style.asp + // [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. Follows CSS standard. - // - // https://www.w3schools.com/cssref/pr_text_text-decoration.asp + // [Text + // decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + // Follows CSS standard. + // string text_decoration = 6; // Font size. @@ -118,7 +120,9 @@ message Document { // Raw byte content of the image. bytes content = 1; - // Encoding mime type for the image. + // 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. @@ -255,6 +259,59 @@ message Document { 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. + bool strikeout = 8; + + // Whether the text is a subscript. + bool subscript = 9; + + // Whether the text is a superscript. + bool superscript = 10; + + // Whether the text is in small caps. + 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; @@ -268,6 +325,9 @@ message Document { // The history of this annotation. Provenance provenance = 4 [deprecated = true]; + + // Text style attributes. + StyleInfo style_info = 5; } // A detected symbol. @@ -333,7 +393,7 @@ message Document { repeated DetectedLanguage detected_languages = 4; // The history of this table. - Provenance provenance = 5; + Provenance provenance = 5 [deprecated = true]; } // A form field detected on the page. @@ -389,16 +449,16 @@ message Document { // Detected language for a structural component. message DetectedLanguage { - // The BCP-47 language code, such as `en-US` or `sr-Latn`. For more - // information, see - // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + // 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 + // Image quality scores for the page image. message ImageQualityScores { // Image Quality Defects message DetectedDefect { @@ -414,12 +474,12 @@ message Document { // - `quality/defect_glare` string type = 1; - // Confidence of detected defect. Range `[0, 1]` where 1 indicates - // strong confidence of that the defect exists. + // 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. + // The overall quality score. Range `[0, 1]` where `1` is perfect quality. float quality_score = 1; // A list of detected defects. @@ -485,7 +545,7 @@ message Document { // A list of detected barcodes. repeated DetectedBarcode detected_barcodes = 15; - // Image Quality Scores. + // Image quality scores. ImageQualityScores image_quality_scores = 17; // The history of this page. @@ -740,13 +800,13 @@ message Document { REMOVE = 2; // Updates any fields within the given provenance scope of the message. It - // 'overwrites' the fields rather than replacing them. This is - // especially relevant when we just want to update a field value of an - // entity without also affecting all the child properties. + // 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 = true]; + REPLACE = 3; // Deprecated. Request human review for the element identified by // `parent`. @@ -839,10 +899,9 @@ message Document { // 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. - // See [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more - // info. + // `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. @@ -851,9 +910,8 @@ message Document { bytes content = 2 [(google.api.field_behavior) = OPTIONAL]; } - // An IANA published MIME type (also referred to as media type). For more - // information, see - // https://www.iana.org/assignments/media-types/media-types.xhtml. + // 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. 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 9de0733f467..1b7e7ce2f06 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -127,9 +127,18 @@ message OcrConfig { // 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. + // 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 id model and returns font style information. + bool compute_style_info = 8; } 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 885bdffd861..b2a87362594 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ 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"; @@ -48,7 +49,7 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/locations/{location}" }; -// Service to call Cloud DocumentAI to process documents according to the +// 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. @@ -89,8 +90,9 @@ service DocumentProcessorService { }; } - // Fetches processor types. Note that we do not use ListProcessorTypes here - // because it is not paginated. + // 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) = { @@ -134,7 +136,7 @@ service DocumentProcessorService { // Trains a new processor version. // Operation metadata is returned as - // cloud_documentai_core.TrainProcessorVersionMetadata. + // [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata]. rpc TrainProcessorVersion(TrainProcessorVersionRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -208,8 +210,9 @@ service DocumentProcessorService { }; } - // Creates a processor from the type processor that the user chose. - // The processor will be at "ENABLED" state by default after its creation. + // Creates a processor from the + // [ProcessorType][google.cloud.documentai.v1beta3.ProcessorType] provided. + // The processor will be at `ENABLED` state by default after its creation. rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { option (google.api.http) = { post: "/v1beta3/{parent=projects/*/locations/*}/processors" @@ -339,12 +342,14 @@ service DocumentProcessorService { // Options for Process API message ProcessOptions { - // Only applicable to "Document OCR Processor". Returns error if set on other + // Only applicable to `OCR_PROCESSOR`. Returns error if set on other // processor types. OcrConfig ocr_config = 1; } -// Request message for the process document method. +// Request message for the +// [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] +// method. message ProcessRequest { // The document payload. oneof source { @@ -370,16 +375,20 @@ message ProcessRequest { (google.api.resource_reference) = { type: "*" } ]; - // The document payload, the [content] and [mime_type] fields must be set. + // 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 feature should be skipped for this request. Default to - // false. + // Whether human review should be skipped for this request. Default to + // `false`. bool skip_human_review = 3; - // Specifies which fields to include in ProcessResponse's document. - // Only supports top level document and pages field so it must be in the form - // of `{document_field_name}` or `pages.{page_field_name}`. + // 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 @@ -394,7 +403,7 @@ message HumanReviewStatus { STATE_UNSPECIFIED = 0; // Human review is skipped for the document. This can happen because human - // review is not enabled on the processor or the processing request has + // review isn't enabled on the processor or the processing request has // been set to skip this document. SKIPPED = 1; @@ -405,7 +414,8 @@ message HumanReviewStatus { IN_PROGRESS = 3; // Some error happened during triggering human review, see the - // [state_message] for details. + // [state_message][google.cloud.documentai.v1beta3.HumanReviewStatus.state_message] + // for details. ERROR = 4; } @@ -416,29 +426,34 @@ message HumanReviewStatus { string state_message = 2; // The name of the operation triggered by the processed document. This field - // is populated only when the [state] is [HUMAN_REVIEW_IN_PROGRESS]. It has - // the same response type and metadata as the long running operation returned - // by [ReviewDocument] method. + // 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 process document method. +// 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 is not triggered, this field will be empty. It has the same - // response type and metadata as the long running operation returned by - // ReviewDocument method. + // 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 batch process document method. +// Request message for +// [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. message BatchProcessRequest { // The message for input config in batch process. message BatchInputConfig { @@ -447,13 +462,19 @@ message BatchProcessRequest { // The Cloud Storage location as the source of the document. string gcs_source = 1; - // Mimetype of the input. If the input is a raw document, the supported - // mimetypes are application/pdf, image/tiff, and image/gif. - // If the input is a [Document] proto, the type should be application/json. + // 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 message for output config in batch process. + // The output configuration in the + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments] + // method. message BatchOutputConfig { option deprecated = true; @@ -478,44 +499,52 @@ message BatchProcessRequest { // The overall output config for batch process. BatchOutputConfig output_config = 3 [deprecated = true]; - // The input documents for batch process. + // The input documents for the + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments] + // method. BatchDocumentsInputConfig input_documents = 5; - // The overall output config for batch process. + // The output configuration for the + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments] + // method. DocumentOutputConfig document_output_config = 6; - // Whether Human Review feature should be skipped for this request. Default to - // false. + // 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; } -// Response message for batch process document method. +// Response message for +// [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. message BatchProcessResponse {} -// The long running operation metadata for batch process method. +// 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] field in the - // request when the batch process started. The batch process is started by - // take snapshot of that document, since a user can move or change that - // document during the process. + // 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 output_gcs_destination (in the request as `output_gcs_destination`) + // 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 is not triggered, this field will be empty. It has - // the same response type and metadata as the long running operation - // returned by ReviewDocument method. + // 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. @@ -563,11 +592,13 @@ message BatchProcessMetadata { repeated IndividualProcessStatus individual_process_statuses = 5; } -// Request message for fetch processor types. +// 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 project of processor type to list. - // The available processor types may depend on the allow-listing on projects. - // Format: `projects/{project}/locations/{location}` + // 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) = { @@ -576,17 +607,21 @@ message FetchProcessorTypesRequest { ]; } -// Response message for fetch processor types. +// 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 list processor types. +// 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 type to list. - // The available processor types may depend on the allow-listing on projects. - // Format: `projects/{project}/locations/{location}` + // 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) = { @@ -595,15 +630,17 @@ message ListProcessorTypesRequest { ]; // 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. + // 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 list processor types. +// Response message for the +// [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes] +// method. message ListProcessorTypesResponse { // The processor types. repeated ProcessorType processor_types = 1; @@ -624,8 +661,8 @@ message ListProcessorsRequest { ]; // 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. + // 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 @@ -633,7 +670,9 @@ message ListProcessorsRequest { string page_token = 3; } -// Response message for list processors. +// Response message for the +// [ListProcessors][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors] +// method. message ListProcessorsResponse { // The list of processors. repeated Processor processors = 1; @@ -642,7 +681,9 @@ message ListProcessorsResponse { string next_page_token = 2; } -// Request message for get processor. +// Request message for the +// [GetProcessorType][google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType] +// method. message GetProcessorTypeRequest { // Required. The processor type resource name. string name = 1 [ @@ -653,7 +694,9 @@ message GetProcessorTypeRequest { ]; } -// Request message for get processor. +// Request message for the +// [GetProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor] +// method. message GetProcessorRequest { // Required. The processor resource name. string name = 1 [ @@ -664,7 +707,9 @@ message GetProcessorRequest { ]; } -// Request message for get processor version. +// Request message for the +// [GetProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion] +// method. message GetProcessorVersionRequest { // Required. The processor resource name. string name = 1 [ @@ -688,8 +733,8 @@ message ListProcessorVersionsRequest { ]; // 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. + // 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 @@ -697,7 +742,9 @@ message ListProcessorVersionsRequest { string page_token = 3; } -// Response message for list processors. +// Response message for the +// [ListProcessorVersions][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions] +// method. message ListProcessorVersionsResponse { // The list of processors. repeated ProcessorVersion processor_versions = 1; @@ -706,7 +753,9 @@ message ListProcessorVersionsResponse { string next_page_token = 2; } -// Request message for the delete processor version method. +// 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 [ @@ -717,13 +766,17 @@ message DeleteProcessorVersionRequest { ]; } -// The long running operation metadata for delete processor version method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for the deploy processor version method. +// 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 [ @@ -734,16 +787,22 @@ message DeployProcessorVersionRequest { ]; } -// Response message for the deploy processor version method. +// Response message for the +// [DeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion] +// method. message DeployProcessorVersionResponse {} -// The long running operation metadata for deploy processor version method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for the undeploy processor version method. +// 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 [ @@ -754,19 +813,24 @@ message UndeployProcessorVersionRequest { ]; } -// Response message for the undeploy processor version method. +// Response message for the +// [UndeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion] +// method. message UndeployProcessorVersionResponse {} -// The long running operation metadata for the undeploy processor version +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for create a processor. Notice this request is sent to -// a regionalized backend service, and if the processor type is not available -// on that region, the creation will fail. +// 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}` @@ -777,13 +841,17 @@ message CreateProcessorRequest { } ]; - // Required. The processor to be created, requires [processor_type] and - // [display_name] to be set. Also, the processor is under CMEK if CMEK fields - // are set. + // Required. The processor to be created, requires + // [Processor.type][google.cloud.documentai.v1beta3.Processor.type] and + // [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 delete processor method. +// 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 [ @@ -794,13 +862,17 @@ message DeleteProcessorRequest { ]; } -// The long running operation metadata for delete processor method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 5; } -// Request message for the enable processor method. +// 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 [ @@ -811,17 +883,22 @@ message EnableProcessorRequest { ]; } -// Response message for the enable processor method. -// Intentionally empty proto for adding fields in future. +// 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 enable processor method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 5; } -// Request message for the disable processor method. +// 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 [ @@ -832,17 +909,22 @@ message DisableProcessorRequest { ]; } -// Response message for the disable processor method. -// Intentionally empty proto for adding fields in future. +// 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 disable processor method. +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 5; } -// Request message for the set default processor version method. +// 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 @@ -866,19 +948,25 @@ message SetDefaultProcessorVersionRequest { ]; } -// Response message for set default processor version method. +// Response message for the +// [SetDefaultProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion] +// method. message SetDefaultProcessorVersionResponse {} -// The long running operation metadata for set default processor version +// 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. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Request message for the create processor version method. +// Request message for the +// [TrainProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion] +// method. message TrainProcessorVersionRequest { - // The input data used to train a new `ProcessorVersion`. + // 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; @@ -887,6 +975,28 @@ message TrainProcessorVersionRequest { 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 fallback to + // MODEL_BASED. + enum TrainingMethod { + TRAINING_METHOD_UNSPECIFIED = 0; + + MODEL_BASED = 1; + + TEMPLATE_BASED = 2; + } + + // Training method to use for CDE training. + TrainingMethod training_method = 3; + } + + oneof processor_flags { + // Options to control Custom Document Extraction (CDE) Processor. + CustomDocumentExtractionOptions custom_document_extraction_options = 5; + } + // Required. The parent (project, location and processor) to create the new // version for. Format: // `projects/{project}/locations/{location}/processors/{processor}`. @@ -904,7 +1014,8 @@ message TrainProcessorVersionRequest { // 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`. + // 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 @@ -913,7 +1024,8 @@ message TrainProcessorVersionRequest { string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL]; } -// The response for the TrainProcessorVersion method. +// 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; @@ -941,7 +1053,7 @@ message TrainProcessorVersionMetadata { repeated google.rpc.Status dataset_errors = 2; } - // The basic metadata of the long running operation. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; // The training dataset validation information. @@ -951,7 +1063,9 @@ message TrainProcessorVersionMetadata { DatasetValidation test_dataset_validation = 3; } -// Request message for review document method. +// Request message for the +// [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument] +// method. message ReviewDocumentRequest { // The priority level of the human review task. enum Priority { @@ -969,8 +1083,9 @@ message ReviewDocumentRequest { Document inline_document = 4; } - // Required. The resource name of the HumanReviewConfig that the document will - // be reviewed with. + // 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) = { @@ -991,7 +1106,9 @@ message ReviewDocumentRequest { DocumentSchema document_schema = 6; } -// Response message for review document method. +// Response message for the +// [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument] +// method. message ReviewDocumentResponse { // Possible states of the review operation. enum State { @@ -1016,9 +1133,11 @@ message ReviewDocumentResponse { string rejection_reason = 3; } -// The long running operation metadata for review document method. +// The long-running operation metadata for the +// [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument] +// method. message ReviewDocumentOperationMetadata { - // State of the longrunning operation. + // State of the long-running operation. enum State { // Unspecified state. STATE_UNSPECIFIED = 0; @@ -1052,14 +1171,16 @@ message ReviewDocumentOperationMetadata { // The last update time of the operation. google.protobuf.Timestamp update_time = 4; - // The basic metadata of the long running operation. + // 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 against the supplied documents. +// 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 @@ -1078,13 +1199,17 @@ message EvaluateProcessorVersionRequest { [(google.api.field_behavior) = OPTIONAL]; } -// Metadata of the EvaluateProcessorVersion method. +// Metadata of the +// [EvaluateProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion] +// method. message EvaluateProcessorVersionMetadata { - // The basic metadata of the long running operation. + // The basic metadata of the long-running operation. CommonOperationMetadata common_metadata = 1; } -// Metadata of the EvaluateProcessorVersion method. +// Response of the +// [EvaluateProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion] +// method. message EvaluateProcessorVersionResponse { // The resource name of the created evaluation. string evaluation = 2; @@ -1103,7 +1228,8 @@ message GetEvaluationRequest { ]; } -// Retrieves a list of evaluations for a given ProcessorVersion. +// 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 @@ -1117,8 +1243,8 @@ message ListEvaluationsRequest { ]; // The standard list page size. - // If unspecified, at most 5 evaluations will be returned. - // The maximum value is 100; values above 100 will be coerced to 100. + // 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. @@ -1126,7 +1252,7 @@ message ListEvaluationsRequest { string page_token = 3; } -// The response from ListEvaluations. +// The response from `ListEvaluations`. message ListEvaluationsResponse { // The evaluations requested. repeated Evaluation evaluations = 1; @@ -1136,19 +1262,27 @@ message ListEvaluationsResponse { string next_page_token = 2; } -// The request message for the ImportProcessorVersion method. -// This method requires Document AI Service Agent of the destination project in -// the source project's IAM with [Document AI Editor -// role](https://cloud.google.com/document-ai/docs/access-control/iam-roles). +// The request message for the +// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion] +// method. Requirements: // -// The destination project is specified as part of the `parent` field. -// The source project is specified as part of `source` field. +// - The source processor version and destination processor +// must be in the same location. +// - 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 Service Agent for Document AI can be found in -// https://cloud.google.com/iam/docs/service-agents. +// 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] +// field. message ImportProcessorVersionRequest { oneof source { - // The source processor version to import from. + // 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" }]; @@ -1165,7 +1299,9 @@ message ImportProcessorVersionRequest { ]; } -// The response message for the ImportProcessorVersion method. +// 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) = { @@ -1173,9 +1309,10 @@ message ImportProcessorVersionResponse { }]; } -// The long running operation metadata for the ImportProcessorVersion +// 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. + // 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 b792319da4f..b685be5f29f 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,6 +24,18 @@ option java_package = "com.google.cloud.documentai.v1beta3"; option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; +// Metadata about a property. +message PropertyMetadata { + // Whether the property should be considered as "inactive". + bool inactive = 3; +} + +// 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 @@ -38,20 +50,28 @@ message DocumentSchema { // Defines properties that can be part of the entity type. message Property { - // Types of occurrences of the entity type in the document. Note: this - // represents the number of instances of an entity types, not number of - // mentions of a given entity instance. + // Types of occurrences of the entity type in the document. This + // represents the number of instances of instances of an entity, not + // number of mentions of an entity. For example, a bank statement may + // only have one `account_number`, but this account number may be + // mentioned in several places on the document. In this case the + // 'account_number' would be 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 will + // be set to `REQUIRED_MULTIPLE`. enum OccurrenceType { // Unspecified occurrence type. OCCURRENCE_TYPE_UNSPECIFIED = 0; - // There will be zero or one instance of this entity type. + // 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 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. @@ -69,6 +89,9 @@ message DocumentSchema { // Occurrence type limits the number of instances an entity type appears // in the document. OccurrenceType occurrence_type = 3; + + // Any additional metadata about the property can be added here. + PropertyMetadata property_metadata = 5; } oneof value_source { @@ -84,16 +107,15 @@ message DocumentSchema { string display_name = 13; // Name of the type. It must be unique within the schema file and - // cannot be a 'Common Type'. Besides that we use the following naming - // conventions: + // cannot be a "Common Type". The following naming conventions are used: // - // - *use `snake_casing`* - // - name matching is case-sensitive + // - 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) + // 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. @@ -103,14 +125,17 @@ message DocumentSchema { // one should be set. repeated string base_types = 2; - // Describing the nested structure, or composition of an entity. + // 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 + // 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; 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 new file mode 100644 index 00000000000..8dcf239e36f --- /dev/null +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto @@ -0,0 +1,112 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/operation_metadata.proto"; +import "google/longrunning/operations.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 = "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. + 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" + }; + } + + // 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"; + } +} + +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; +} + +// 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; +} 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 e5087c818c2..4de7046b6d7 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 2022 Google LLC +// Copyright 2023 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/geometry.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto index 05eeac9c493..da949fb1964 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 2022 Google LLC +// Copyright 2023 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 e8f757a543b..509109aba0c 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 2022 Google LLC +// Copyright 2023 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 7de236e1fec..bafcdc0f430 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,10 +31,9 @@ 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, pre-trained by Google internally or up-trained -// by the customer. At a time, a processor can only have one default version -// version. So the processor's behavior (when processing documents) is defined -// by a default version +// 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" @@ -78,6 +77,9 @@ message ProcessorVersion { // The processor version failed and is in an indeterminate state. FAILED = 7; + + // The processor version is being imported. + IMPORTING = 8; } // The resource name of the processor version. @@ -106,7 +108,7 @@ message ProcessorVersion { // The KMS key version with which data is encrypted. string kms_key_version_name = 10; - // Denotes that this ProcessorVersion is managed by google. + // Denotes that this `ProcessorVersion` is managed by Google. bool google_managed = 11; // If set, information about the eventual deprecation of this version. @@ -163,8 +165,8 @@ message Processor { (google.api.field_behavior) = OUTPUT_ONLY ]; - // The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. - // To get a list of processors types, see + // 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; @@ -189,7 +191,7 @@ message Processor { // The time the processor was created. google.protobuf.Timestamp create_time = 7; - // The KMS key used for encryption/decryption in CMEK scenarios. - // See https://cloud.google.com/security-key-management. + // The [KMS key](https://cloud.google.com/security-key-management) used for + // encryption and decryption in CMEK scenarios. string kms_key_name = 8; } 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 0ff23ffafb3..2840eb0852e 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,7 +37,8 @@ message ProcessorType { // The location information about where the processor is available. message LocationInfo { - // The location id, currently must be one of [us, eu]. + // The location ID. For supported locations, refer to [regional and + // multi-regional support](/document-ai/docs/regions). string location_id = 1; } @@ -45,7 +46,7 @@ message ProcessorType { // Format: `projects/{project}/processorTypes/{processor_type}` string name = 1; - // The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. + // The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. string type = 2; // The processor category, used by UI to group processor types. diff --git a/packages/google-cloud-documentai/protos/protos.d.ts b/packages/google-cloud-documentai/protos/protos.d.ts index ece5bc5559f..289e0dd4b0b 100644 --- a/packages/google-cloud-documentai/protos/protos.d.ts +++ b/packages/google-cloud-documentai/protos/protos.d.ts @@ -1659,6 +1659,9 @@ export namespace google { /** 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. */ @@ -1682,6 +1685,9 @@ export namespace google { /** 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 @@ -1869,6 +1875,187 @@ export namespace google { 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. */ @@ -13144,7 +13331,8 @@ export namespace google { UNDEPLOYING = 4, CREATING = 5, DELETING = 6, - FAILED = 7 + FAILED = 7, + IMPORTING = 8 } } @@ -23120,5644 +23308,7250 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Document. */ - interface IDocument { - - /** Document uri */ - uri?: (string|null); - - /** Document content */ - content?: (Uint8Array|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); + /** Properties of a Dataset. */ + interface IDataset { - /** Document entities */ - entities?: (google.cloud.documentai.v1beta3.Document.IEntity[]|null); + /** Dataset gcsManagedConfig */ + gcsManagedConfig?: (google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null); - /** Document entityRelations */ - entityRelations?: (google.cloud.documentai.v1beta3.Document.IEntityRelation[]|null); + /** Dataset documentWarehouseConfig */ + documentWarehouseConfig?: (google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null); - /** Document textChanges */ - textChanges?: (google.cloud.documentai.v1beta3.Document.ITextChange[]|null); + /** Dataset unmanagedDatasetConfig */ + unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); - /** Document shardInfo */ - shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); + /** Dataset spannerIndexingConfig */ + spannerIndexingConfig?: (google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig|null); - /** Document error */ - error?: (google.rpc.IStatus|null); + /** Dataset name */ + name?: (string|null); - /** Document revisions */ - revisions?: (google.cloud.documentai.v1beta3.Document.IRevision[]|null); + /** Dataset state */ + state?: (google.cloud.documentai.v1beta3.Dataset.State|keyof typeof google.cloud.documentai.v1beta3.Dataset.State|null); } - /** Represents a Document. */ - class Document implements IDocument { + /** Represents a Dataset. */ + class Dataset implements IDataset { /** - * Constructs a new Document. + * Constructs a new Dataset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocument); - - /** Document uri. */ - public uri?: (string|null); - - /** Document content. */ - public content?: (Uint8Array|string|null); - - /** Document mimeType. */ - public mimeType: string; - - /** Document text. */ - public text: string; - - /** Document textStyles. */ - public textStyles: google.cloud.documentai.v1beta3.Document.IStyle[]; + constructor(properties?: google.cloud.documentai.v1beta3.IDataset); - /** Document pages. */ - public pages: google.cloud.documentai.v1beta3.Document.IPage[]; + /** Dataset gcsManagedConfig. */ + public gcsManagedConfig?: (google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null); - /** Document entities. */ - public entities: google.cloud.documentai.v1beta3.Document.IEntity[]; + /** Dataset documentWarehouseConfig. */ + public documentWarehouseConfig?: (google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null); - /** Document entityRelations. */ - public entityRelations: google.cloud.documentai.v1beta3.Document.IEntityRelation[]; + /** Dataset unmanagedDatasetConfig. */ + public unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); - /** Document textChanges. */ - public textChanges: google.cloud.documentai.v1beta3.Document.ITextChange[]; + /** Dataset spannerIndexingConfig. */ + public spannerIndexingConfig?: (google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig|null); - /** Document shardInfo. */ - public shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); + /** Dataset name. */ + public name: string; - /** Document error. */ - public error?: (google.rpc.IStatus|null); + /** Dataset state. */ + public state: (google.cloud.documentai.v1beta3.Dataset.State|keyof typeof google.cloud.documentai.v1beta3.Dataset.State); - /** Document revisions. */ - public revisions: google.cloud.documentai.v1beta3.Document.IRevision[]; + /** Dataset storageSource. */ + public storageSource?: ("gcsManagedConfig"|"documentWarehouseConfig"|"unmanagedDatasetConfig"); - /** Document source. */ - public source?: ("uri"|"content"); + /** Dataset indexingSource. */ + public indexingSource?: "spannerIndexingConfig"; /** - * Creates a new Document instance using the specified properties. + * Creates a new Dataset instance using the specified properties. * @param [properties] Properties to set - * @returns Document instance + * @returns Dataset instance */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocument): google.cloud.documentai.v1beta3.Document; + public static create(properties?: google.cloud.documentai.v1beta3.IDataset): google.cloud.documentai.v1beta3.Dataset; /** - * 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 + * 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.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.IDataset, 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 + * 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.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Document message from the specified reader or buffer. + * 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 Document + * @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.Document; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Dataset; /** - * Decodes a Document message from the specified reader or buffer, length delimited. + * Decodes a Dataset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Document + * @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.Document; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Dataset; /** - * Verifies a Document message. + * 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 Document message from a plain object. Also converts values to their respective internal types. + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Document + * @returns Dataset */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset; /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @param message Document + * 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.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Document to JSON. + * Converts this Dataset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Document + * 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 Document { - - /** Properties of a ShardInfo. */ - interface IShardInfo { - - /** ShardInfo shardIndex */ - shardIndex?: (number|Long|string|null); + namespace Dataset { - /** ShardInfo shardCount */ - shardCount?: (number|Long|string|null); + /** Properties of a GCSManagedConfig. */ + interface IGCSManagedConfig { - /** ShardInfo textOffset */ - textOffset?: (number|Long|string|null); + /** GCSManagedConfig gcsPrefix */ + gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); } - /** Represents a ShardInfo. */ - class ShardInfo implements IShardInfo { + /** Represents a GCSManagedConfig. */ + class GCSManagedConfig implements IGCSManagedConfig { /** - * Constructs a new ShardInfo. + * Constructs a new GCSManagedConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IShardInfo); - - /** ShardInfo shardIndex. */ - public shardIndex: (number|Long|string); + constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig); - /** ShardInfo shardCount. */ - public shardCount: (number|Long|string); - - /** ShardInfo textOffset. */ - public textOffset: (number|Long|string); + /** GCSManagedConfig gcsPrefix. */ + public gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); /** - * Creates a new ShardInfo instance using the specified properties. + * Creates a new GCSManagedConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ShardInfo instance + * @returns GCSManagedConfig instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.IShardInfo): google.cloud.documentai.v1beta3.Document.ShardInfo; + public static create(properties?: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; /** - * 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 + * 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.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig, 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 + * 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.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ShardInfo message from the specified reader or buffer. + * 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 ShardInfo + * @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.Document.ShardInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; /** - * Decodes a ShardInfo message from the specified reader or buffer, length delimited. + * Decodes a GCSManagedConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ShardInfo + * @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.Document.ShardInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; /** - * Verifies a ShardInfo message. + * 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 ShardInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GCSManagedConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ShardInfo + * @returns GCSManagedConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.ShardInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; /** - * Creates a plain object from a ShardInfo message. Also converts values to other types if specified. - * @param message ShardInfo + * 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.Document.ShardInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ShardInfo to JSON. + * Converts this GCSManagedConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ShardInfo + * 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 Style. */ - interface IStyle { + /** Properties of a DocumentWarehouseConfig. */ + interface IDocumentWarehouseConfig { - /** Style textAnchor */ - textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); + /** DocumentWarehouseConfig collection */ + collection?: (string|null); - /** Style color */ - color?: (google.type.IColor|null); + /** DocumentWarehouseConfig schema */ + schema?: (string|null); + } - /** Style backgroundColor */ - backgroundColor?: (google.type.IColor|null); + /** Represents a DocumentWarehouseConfig. */ + class DocumentWarehouseConfig implements IDocumentWarehouseConfig { - /** Style fontWeight */ - fontWeight?: (string|null); + /** + * Constructs a new DocumentWarehouseConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig); - /** Style textStyle */ - textStyle?: (string|null); + /** DocumentWarehouseConfig collection. */ + public collection: string; - /** Style textDecoration */ - textDecoration?: (string|null); + /** DocumentWarehouseConfig schema. */ + public schema: string; - /** Style fontSize */ - fontSize?: (google.cloud.documentai.v1beta3.Document.Style.IFontSize|null); + /** + * 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; - /** Style fontFamily */ - fontFamily?: (string|null); - } + /** + * 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; - /** Represents a Style. */ - class Style implements IStyle { + /** + * 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; /** - * Constructs a new Style. - * @param [properties] Properties to set + * 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 */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IStyle); + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig; - /** Style textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); + /** + * 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; - /** Style color. */ - public color?: (google.type.IColor|null); + /** + * 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); - /** Style backgroundColor. */ - public backgroundColor?: (google.type.IColor|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; - /** Style fontWeight. */ - public fontWeight: string; + /** + * 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 }; - /** Style textStyle. */ - public textStyle: string; + /** + * Converts this DocumentWarehouseConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Style textDecoration. */ - public textDecoration: string; + /** + * 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; + } - /** Style fontSize. */ - public fontSize?: (google.cloud.documentai.v1beta3.Document.Style.IFontSize|null); + /** Properties of an UnmanagedDatasetConfig. */ + interface IUnmanagedDatasetConfig { + } - /** Style fontFamily. */ - public fontFamily: string; + /** Represents an UnmanagedDatasetConfig. */ + class UnmanagedDatasetConfig implements IUnmanagedDatasetConfig { /** - * Creates a new Style instance using the specified properties. + * Constructs a new UnmanagedDatasetConfig. * @param [properties] Properties to set - * @returns Style instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.IStyle): google.cloud.documentai.v1beta3.Document.Style; + constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig); /** - * 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 + * 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.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig, 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 + * 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.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Style message from the specified reader or buffer. + * 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 Style + * @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.Document.Style; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig; /** - * Decodes a Style message from the specified reader or buffer, length delimited. + * Decodes an UnmanagedDatasetConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Style + * @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.Document.Style; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig; /** - * Verifies a Style message. + * 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 a Style message from a plain object. Also converts values to their respective internal types. + * Creates an UnmanagedDatasetConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Style + * @returns UnmanagedDatasetConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Style; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig; /** - * Creates a plain object from a Style message. Also converts values to other types if specified. - * @param message Style + * 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.Document.Style, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Style to JSON. + * Converts this UnmanagedDatasetConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Style + * 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; } - namespace Style { - - /** Properties of a FontSize. */ - interface IFontSize { + /** Properties of a SpannerIndexingConfig. */ + interface ISpannerIndexingConfig { + } - /** FontSize size */ - size?: (number|null); + /** Represents a SpannerIndexingConfig. */ + class SpannerIndexingConfig implements ISpannerIndexingConfig { - /** FontSize unit */ - unit?: (string|null); - } + /** + * Constructs a new SpannerIndexingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig); - /** Represents a FontSize. */ - class FontSize implements IFontSize { + /** + * 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; - /** - * Constructs a new FontSize. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Style.IFontSize); + /** + * 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; - /** FontSize size. */ - public size: number; + /** + * 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; - /** FontSize unit. */ - public unit: string; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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; + /** + * Converts this SpannerIndexingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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); + /** + * 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; + } - /** - * 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; + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + UNINITIALIZED = 1, + INITIALIZING = 2, + INITIALIZED = 3 + } + } - /** - * 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 }; + /** Properties of a DatasetSchema. */ + interface IDatasetSchema { - /** - * Converts this FontSize to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** DatasetSchema name */ + name?: (string|null); - /** - * 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; - } - } + /** DatasetSchema documentSchema */ + documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + } - /** Properties of a Page. */ - interface IPage { + /** Represents a DatasetSchema. */ + class DatasetSchema implements IDatasetSchema { - /** Page pageNumber */ - pageNumber?: (number|null); + /** + * Constructs a new DatasetSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDatasetSchema); - /** Page image */ - image?: (google.cloud.documentai.v1beta3.Document.Page.IImage|null); + /** DatasetSchema name. */ + public name: string; - /** Page transforms */ - transforms?: (google.cloud.documentai.v1beta3.Document.Page.IMatrix[]|null); + /** DatasetSchema documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - /** Page dimension */ - dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); + /** + * 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; - /** Page layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Page detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** + * 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; - /** Page blocks */ - blocks?: (google.cloud.documentai.v1beta3.Document.Page.IBlock[]|null); + /** + * 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; - /** Page paragraphs */ - paragraphs?: (google.cloud.documentai.v1beta3.Document.Page.IParagraph[]|null); + /** + * 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; - /** Page lines */ - lines?: (google.cloud.documentai.v1beta3.Document.Page.ILine[]|null); + /** + * 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; - /** Page tokens */ - tokens?: (google.cloud.documentai.v1beta3.Document.Page.IToken[]|null); + /** + * 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); - /** Page visualElements */ - visualElements?: (google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]|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; - /** Page tables */ - tables?: (google.cloud.documentai.v1beta3.Document.Page.ITable[]|null); + /** + * 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 }; - /** Page formFields */ - formFields?: (google.cloud.documentai.v1beta3.Document.Page.IFormField[]|null); + /** + * Converts this DatasetSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Page symbols */ - symbols?: (google.cloud.documentai.v1beta3.Document.Page.ISymbol[]|null); + /** + * 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; + } - /** Page detectedBarcodes */ - detectedBarcodes?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]|null); + /** Properties of a RawDocument. */ + interface IRawDocument { - /** Page imageQualityScores */ - imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); + /** RawDocument content */ + content?: (Uint8Array|string|null); - /** Page provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } + /** RawDocument mimeType */ + mimeType?: (string|null); + } - /** Represents a Page. */ - class Page implements IPage { + /** Represents a RawDocument. */ + class RawDocument implements IRawDocument { - /** - * Constructs a new Page. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IPage); + /** + * Constructs a new RawDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IRawDocument); - /** Page pageNumber. */ - public pageNumber: number; + /** RawDocument content. */ + public content: (Uint8Array|string); - /** Page image. */ - public image?: (google.cloud.documentai.v1beta3.Document.Page.IImage|null); + /** RawDocument mimeType. */ + public mimeType: string; - /** Page transforms. */ - public transforms: google.cloud.documentai.v1beta3.Document.Page.IMatrix[]; + /** + * 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; - /** Page dimension. */ - public dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); + /** + * 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; - /** Page layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** + * 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; - /** Page detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** + * 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; - /** Page blocks. */ - public blocks: google.cloud.documentai.v1beta3.Document.Page.IBlock[]; + /** + * 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; - /** Page paragraphs. */ - public paragraphs: google.cloud.documentai.v1beta3.Document.Page.IParagraph[]; + /** + * 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); - /** Page lines. */ - public lines: google.cloud.documentai.v1beta3.Document.Page.ILine[]; + /** + * 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; - /** Page tokens. */ - public tokens: google.cloud.documentai.v1beta3.Document.Page.IToken[]; + /** + * 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 }; - /** Page visualElements. */ - public visualElements: google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]; + /** + * Converts this RawDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Page tables. */ - public tables: google.cloud.documentai.v1beta3.Document.Page.ITable[]; + /** + * 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; + } - /** Page formFields. */ - public formFields: google.cloud.documentai.v1beta3.Document.Page.IFormField[]; + /** Properties of a GcsDocument. */ + interface IGcsDocument { - /** Page symbols. */ - public symbols: google.cloud.documentai.v1beta3.Document.Page.ISymbol[]; + /** GcsDocument gcsUri */ + gcsUri?: (string|null); - /** Page detectedBarcodes. */ - public detectedBarcodes: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]; + /** GcsDocument mimeType */ + mimeType?: (string|null); + } - /** Page imageQualityScores. */ - public imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); + /** Represents a GcsDocument. */ + class GcsDocument implements IGcsDocument { - /** Page provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** + * Constructs a new GcsDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocument); - /** - * 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; + /** GcsDocument gcsUri. */ + public gcsUri: string; - /** - * 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; + /** GcsDocument mimeType. */ + public mimeType: string; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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); - /** - * Converts this Page to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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 }; - namespace Page { + /** + * Converts this GcsDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a Dimension. */ - interface IDimension { + /** + * 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; + } - /** Dimension width */ - width?: (number|null); + /** Properties of a GcsDocuments. */ + interface IGcsDocuments { - /** Dimension height */ - height?: (number|null); + /** GcsDocuments documents */ + documents?: (google.cloud.documentai.v1beta3.IGcsDocument[]|null); + } - /** Dimension unit */ - unit?: (string|null); - } + /** Represents a GcsDocuments. */ + class GcsDocuments implements IGcsDocuments { - /** Represents a Dimension. */ - class Dimension implements IDimension { + /** + * Constructs a new GcsDocuments. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocuments); - /** - * Constructs a new Dimension. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDimension); + /** GcsDocuments documents. */ + public documents: google.cloud.documentai.v1beta3.IGcsDocument[]; - /** Dimension width. */ - public width: number; + /** + * 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; - /** Dimension height. */ - public height: number; + /** + * 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; - /** Dimension unit. */ - public unit: string; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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); + /** + * Converts this GcsDocuments to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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 }; + /** Properties of a GcsPrefix. */ + interface IGcsPrefix { - /** - * Converts this Dimension to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** GcsPrefix gcsUriPrefix */ + gcsUriPrefix?: (string|null); + } - /** - * 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; - } + /** Represents a GcsPrefix. */ + class GcsPrefix implements IGcsPrefix { - /** Properties of an Image. */ - interface IImage { + /** + * Constructs a new GcsPrefix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGcsPrefix); - /** Image content */ - content?: (Uint8Array|string|null); + /** GcsPrefix gcsUriPrefix. */ + public gcsUriPrefix: string; - /** Image mimeType */ - mimeType?: (string|null); + /** + * 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; - /** Image width */ - width?: (number|null); + /** + * 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; - /** Image height */ - height?: (number|null); + /** + * 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 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 an Image. */ - class Image implements IImage { + /** Represents a ShardingConfig. */ + class ShardingConfig implements IShardingConfig { /** - * Constructs a new Image. + * Constructs a new ShardingConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IImage); - - /** Image content. */ - public content: (Uint8Array|string); - - /** Image mimeType. */ - public mimeType: string; + constructor(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig); - /** Image width. */ - public width: number; + /** ShardingConfig pagesPerShard. */ + public pagesPerShard: number; - /** Image height. */ - public height: number; + /** ShardingConfig pagesOverlap. */ + public pagesOverlap: number; /** - * Creates a new Image instance using the specified properties. + * Creates a new ShardingConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Image instance + * @returns ShardingConfig instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IImage): google.cloud.documentai.v1beta3.Document.Page.Image; + public static create(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; /** - * 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 + * 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.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, 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 + * 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.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Image message from the specified reader or buffer. + * 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 Image + * @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.Document.Page.Image; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; /** - * Decodes an Image message from the specified reader or buffer, length delimited. + * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Image + * @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.Document.Page.Image; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; /** - * Verifies an Image message. + * 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 an Image message from a plain object. Also converts values to their respective internal types. + * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Image + * @returns ShardingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Image; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image + * 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.Document.Page.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Image to JSON. + * Converts this ShardingConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Image + * 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 a Matrix. */ - interface IMatrix { - - /** Matrix rows */ - rows?: (number|null); + /** Properties of an OcrConfig. */ + interface IOcrConfig { - /** Matrix cols */ - cols?: (number|null); + /** OcrConfig hints */ + hints?: (google.cloud.documentai.v1beta3.OcrConfig.IHints|null); - /** Matrix type */ - type?: (number|null); + /** OcrConfig enableNativePdfParsing */ + enableNativePdfParsing?: (boolean|null); - /** Matrix data */ - data?: (Uint8Array|string|null); - } + /** OcrConfig enableImageQualityScores */ + enableImageQualityScores?: (boolean|null); - /** Represents a Matrix. */ - class Matrix implements IMatrix { + /** OcrConfig advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); - /** - * Constructs a new Matrix. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IMatrix); + /** OcrConfig enableSymbol */ + enableSymbol?: (boolean|null); - /** Matrix rows. */ - public rows: number; + /** OcrConfig computeStyleInfo */ + computeStyleInfo?: (boolean|null); + } - /** Matrix cols. */ - public cols: number; + /** Represents an OcrConfig. */ + class OcrConfig implements IOcrConfig { - /** Matrix type. */ - public type: number; + /** + * Constructs a new OcrConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IOcrConfig); - /** Matrix data. */ - public data: (Uint8Array|string); + /** OcrConfig hints. */ + public hints?: (google.cloud.documentai.v1beta3.OcrConfig.IHints|null); - /** - * 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; + /** OcrConfig enableNativePdfParsing. */ + public enableNativePdfParsing: boolean; - /** - * 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; + /** OcrConfig enableImageQualityScores. */ + public enableImageQualityScores: boolean; - /** - * 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; + /** OcrConfig advancedOcrOptions. */ + public advancedOcrOptions: string[]; - /** - * 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; + /** OcrConfig enableSymbol. */ + public enableSymbol: boolean; - /** - * 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; + /** OcrConfig computeStyleInfo. */ + public computeStyleInfo: boolean; - /** - * 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 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this Matrix to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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; - /** Properties of a Layout. */ - interface ILayout { + /** + * 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); - /** Layout textAnchor */ - textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|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; - /** Layout confidence */ - confidence?: (number|null); + /** + * 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 }; - /** Layout boundingPoly */ - boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + /** + * Converts this OcrConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Layout orientation */ - orientation?: (google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|null); - } + /** + * 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; + } - /** Represents a Layout. */ - class Layout implements ILayout { + namespace OcrConfig { - /** - * Constructs a new Layout. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ILayout); + /** Properties of a Hints. */ + interface IHints { - /** Layout textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); + /** Hints languageHints */ + languageHints?: (string[]|null); + } - /** Layout confidence. */ - public confidence: number; + /** Represents a Hints. */ + class Hints implements IHints { - /** Layout boundingPoly. */ - public boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + /** + * Constructs a new Hints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.OcrConfig.IHints); - /** Layout orientation. */ - public orientation: (google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation); + /** Hints languageHints. */ + public languageHints: string[]; - /** - * 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; + /** + * 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 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 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 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; + /** + * 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 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 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 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; + /** + * 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 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); + /** + * 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 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 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 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 }; + /** + * 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 Layout to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this Hints 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; - } + /** + * 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; + } + } - namespace Layout { + /** Properties of a PropertyMetadata. */ + interface IPropertyMetadata { - /** Orientation enum. */ - enum Orientation { - ORIENTATION_UNSPECIFIED = 0, - PAGE_UP = 1, - PAGE_RIGHT = 2, - PAGE_DOWN = 3, - PAGE_LEFT = 4 - } - } + /** PropertyMetadata inactive */ + inactive?: (boolean|null); + } - /** Properties of a Block. */ - interface IBlock { + /** Represents a PropertyMetadata. */ + class PropertyMetadata implements IPropertyMetadata { - /** Block layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** + * Constructs a new PropertyMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IPropertyMetadata); - /** Block detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** PropertyMetadata inactive. */ + public inactive: boolean; - /** Block provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|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; - /** Represents a Block. */ - class Block implements IBlock { + /** + * 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; - /** - * Constructs a new Block. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IBlock); + /** + * 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; - /** Block layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** + * 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; - /** Block detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** + * 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; - /** Block provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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; + /** + * Converts this PropertyMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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; + /** Properties of an EntityTypeMetadata. */ + interface IEntityTypeMetadata { - /** - * 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); + /** EntityTypeMetadata inactive */ + inactive?: (boolean|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; + /** Represents an EntityTypeMetadata. */ + class EntityTypeMetadata implements IEntityTypeMetadata { - /** - * 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 }; + /** + * Constructs a new EntityTypeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEntityTypeMetadata); - /** - * Converts this Block to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** EntityTypeMetadata inactive. */ + public inactive: boolean; - /** - * 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; - } + /** + * 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; - /** Properties of a Paragraph. */ - interface IParagraph { + /** + * 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; - /** Paragraph layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** + * 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; - /** Paragraph detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** + * 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; - /** Paragraph provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** + * 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); + } + + /** 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); + + /** + * 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 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 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 a Paragraph. */ - class Paragraph implements IParagraph { + /** Represents an EnumValues. */ + class EnumValues implements IEnumValues { /** - * Constructs a new Paragraph. + * Constructs a new EnumValues. * @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[]; + constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues); - /** Paragraph provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** EnumValues values. */ + public values: string[]; /** - * Creates a new Paragraph instance using the specified properties. + * Creates a new EnumValues instance using the specified properties. * @param [properties] Properties to set - * @returns Paragraph instance + * @returns EnumValues instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IParagraph): google.cloud.documentai.v1beta3.Document.Page.Paragraph; + public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; /** - * 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 + * 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.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues, 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 + * 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.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Paragraph message from the specified reader or buffer. + * 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 Paragraph + * @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.Document.Page.Paragraph; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; /** - * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * Decodes an EnumValues message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Paragraph + * @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.Document.Page.Paragraph; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; /** - * Verifies a Paragraph message. + * 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 a Paragraph message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValues message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Paragraph + * @returns EnumValues */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Paragraph; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; /** - * Creates a plain object from a Paragraph message. Also converts values to other types if specified. - * @param message Paragraph + * 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.Document.Page.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Paragraph to JSON. + * Converts this EnumValues to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Paragraph + * 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 Line. */ - interface ILine { + /** Properties of a Property. */ + interface IProperty { - /** Line layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Property name */ + name?: (string|null); - /** Line detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** Property valueType */ + valueType?: (string|null); - /** Line provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** Property occurrenceType */ + occurrenceType?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|null); + + /** Property propertyMetadata */ + propertyMetadata?: (google.cloud.documentai.v1beta3.IPropertyMetadata|null); } - /** Represents a Line. */ - class Line implements ILine { + /** Represents a Property. */ + class Property implements IProperty { /** - * Constructs a new Line. + * Constructs a new Property. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ILine); + constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty); - /** Line layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Property name. */ + public name: string; - /** Line detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** Property valueType. */ + public valueType: string; - /** Line provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** Property occurrenceType. */ + public occurrenceType: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType); + + /** Property propertyMetadata. */ + public propertyMetadata?: (google.cloud.documentai.v1beta3.IPropertyMetadata|null); /** - * Creates a new Line instance using the specified properties. + * Creates a new Property instance using the specified properties. * @param [properties] Properties to set - * @returns Line instance + * @returns Property instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.ILine): google.cloud.documentai.v1beta3.Document.Page.Line; + public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property; /** - * 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 + * 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.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty, 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 + * 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.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Line message from the specified reader or buffer. + * 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 Line + * @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.Document.Page.Line; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property; /** - * Decodes a Line message from the specified reader or buffer, length delimited. + * Decodes a Property message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Line + * @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.Document.Page.Line; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property; /** - * Verifies a Line message. + * 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 Line message from a plain object. Also converts values to their respective internal types. + * Creates a Property message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Line + * @returns Property */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Line; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property; /** - * Creates a plain object from a Line message. Also converts values to other types if specified. - * @param message Line + * 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.Document.Page.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Line to JSON. + * Converts this Property to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Line + * Gets the default type url for Property * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Token. */ - interface IToken { + namespace Property { - /** Token layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** OccurrenceType enum. */ + enum OccurrenceType { + OCCURRENCE_TYPE_UNSPECIFIED = 0, + OPTIONAL_ONCE = 1, + OPTIONAL_MULTIPLE = 2, + REQUIRED_ONCE = 3, + REQUIRED_MULTIPLE = 4 + } + } + } - /** Token detectedBreak */ - detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); + /** Properties of a Metadata. */ + interface IMetadata { - /** Token detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** Metadata documentSplitter */ + documentSplitter?: (boolean|null); - /** Token provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } + /** Metadata documentAllowMultipleLabels */ + documentAllowMultipleLabels?: (boolean|null); - /** Represents a Token. */ - class Token implements IToken { + /** Metadata prefixedNamingOnProperties */ + prefixedNamingOnProperties?: (boolean|null); - /** - * Constructs a new Token. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IToken); + /** Metadata skipNamingValidation */ + skipNamingValidation?: (boolean|null); + } - /** Token layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Represents a Metadata. */ + class Metadata implements IMetadata { - /** Token detectedBreak. */ - public detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata); - /** Token detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** Metadata documentSplitter. */ + public documentSplitter: boolean; - /** Token provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** Metadata documentAllowMultipleLabels. */ + public documentAllowMultipleLabels: boolean; - /** - * 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; + /** Metadata prefixedNamingOnProperties. */ + public prefixedNamingOnProperties: boolean; - /** - * 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; + /** Metadata skipNamingValidation. */ + public skipNamingValidation: boolean; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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); - /** - * Converts this Token to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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 }; - namespace Token { + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a DetectedBreak. */ - interface IDetectedBreak { + /** + * 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; + } + } - /** DetectedBreak type */ - type?: (google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|null); - } + /** Properties of a Document. */ + interface IDocument { - /** Represents a DetectedBreak. */ - class DetectedBreak implements IDetectedBreak { + /** Document uri */ + uri?: (string|null); - /** - * Constructs a new DetectedBreak. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak); + /** Document content */ + content?: (Uint8Array|string|null); - /** DetectedBreak type. */ - public type: (google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type); + /** Document mimeType */ + mimeType?: (string|null); - /** - * 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; + /** Document text */ + text?: (string|null); - /** - * 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; + /** Document textStyles */ + textStyles?: (google.cloud.documentai.v1beta3.Document.IStyle[]|null); - /** - * 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; + /** Document pages */ + pages?: (google.cloud.documentai.v1beta3.Document.IPage[]|null); - /** - * 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; + /** Document entities */ + entities?: (google.cloud.documentai.v1beta3.Document.IEntity[]|null); - /** - * 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; + /** Document entityRelations */ + entityRelations?: (google.cloud.documentai.v1beta3.Document.IEntityRelation[]|null); - /** - * 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); + /** Document textChanges */ + textChanges?: (google.cloud.documentai.v1beta3.Document.ITextChange[]|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; + /** Document shardInfo */ + shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); - /** - * 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 }; + /** Document error */ + error?: (google.rpc.IStatus|null); - /** - * Converts this DetectedBreak to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Document revisions */ + revisions?: (google.cloud.documentai.v1beta3.Document.IRevision[]|null); + } - /** - * 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; - } + /** Represents a Document. */ + class Document implements IDocument { - namespace DetectedBreak { + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocument); - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - SPACE = 1, - WIDE_SPACE = 2, - HYPHEN = 3 - } - } - } + /** Document uri. */ + public uri?: (string|null); - /** Properties of a Symbol. */ - interface ISymbol { + /** Document content. */ + public content?: (Uint8Array|string|null); - /** Symbol layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Document mimeType. */ + public mimeType: string; - /** Symbol detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - } + /** Document text. */ + public text: string; - /** Represents a Symbol. */ - class Symbol implements ISymbol { + /** Document textStyles. */ + public textStyles: google.cloud.documentai.v1beta3.Document.IStyle[]; - /** - * Constructs a new Symbol. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ISymbol); + /** Document pages. */ + public pages: google.cloud.documentai.v1beta3.Document.IPage[]; - /** Symbol layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Document entities. */ + public entities: google.cloud.documentai.v1beta3.Document.IEntity[]; - /** Symbol detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** Document entityRelations. */ + public entityRelations: google.cloud.documentai.v1beta3.Document.IEntityRelation[]; - /** - * 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; + /** Document textChanges. */ + public textChanges: google.cloud.documentai.v1beta3.Document.ITextChange[]; - /** - * 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; + /** Document shardInfo. */ + public shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); - /** - * 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; + /** Document error. */ + public error?: (google.rpc.IStatus|null); - /** - * 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; + /** Document revisions. */ + public revisions: google.cloud.documentai.v1beta3.Document.IRevision[]; - /** - * 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; + /** Document source. */ + public source?: ("uri"|"content"); - /** - * 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 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this Symbol to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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; - /** Properties of a VisualElement. */ - interface IVisualElement { + /** + * 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); - /** VisualElement layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|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; - /** VisualElement type */ - type?: (string|null); + /** + * 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 }; - /** VisualElement detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - } + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents a VisualElement. */ - class VisualElement implements IVisualElement { + /** + * 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; + } - /** - * Constructs a new VisualElement. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IVisualElement); + namespace Document { - /** VisualElement layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Properties of a ShardInfo. */ + interface IShardInfo { - /** VisualElement type. */ - public type: string; + /** ShardInfo shardIndex */ + shardIndex?: (number|Long|string|null); - /** VisualElement detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** ShardInfo shardCount */ + shardCount?: (number|Long|string|null); - /** - * 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; + /** ShardInfo textOffset */ + textOffset?: (number|Long|string|null); + } - /** - * 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; + /** Represents a ShardInfo. */ + class ShardInfo implements IShardInfo { - /** - * 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; + /** + * Constructs a new ShardInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.IShardInfo); - /** - * 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; + /** ShardInfo shardIndex. */ + public shardIndex: (number|Long|string); - /** - * 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; + /** ShardInfo shardCount. */ + public shardCount: (number|Long|string); - /** - * 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); + /** ShardInfo textOffset. */ + public textOffset: (number|Long|string); - /** - * 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 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this VisualElement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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; - /** Properties of a Table. */ - interface ITable { + /** + * 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; - /** Table layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** + * 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); - /** Table headerRows */ - headerRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|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; - /** Table bodyRows */ - bodyRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|null); + /** + * 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 }; - /** Table detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** + * Converts this ShardInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Table provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** + * 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 Table. */ - class Table implements ITable { + /** Represents a FontSize. */ + class FontSize implements IFontSize { /** - * Constructs a new Table. + * Constructs a new FontSize. * @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[]; + constructor(properties?: google.cloud.documentai.v1beta3.Document.Style.IFontSize); - /** Table detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** FontSize size. */ + public size: number; - /** Table provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** FontSize unit. */ + public unit: string; /** - * Creates a new Table instance using the specified properties. + * Creates a new FontSize instance using the specified properties. * @param [properties] Properties to set - * @returns Table instance + * @returns FontSize instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.ITable): google.cloud.documentai.v1beta3.Document.Page.Table; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Style.IFontSize): google.cloud.documentai.v1beta3.Document.Style.FontSize; /** - * 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 + * 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.Page.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Style.IFontSize, 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 + * 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.Page.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Style.IFontSize, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Table message from the specified reader or buffer. + * 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 Table + * @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.Page.Table; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Style.FontSize; /** - * Decodes a Table message from the specified reader or buffer, length delimited. + * Decodes a FontSize message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Table + * @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.Page.Table; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Style.FontSize; /** - * Verifies a Table message. + * 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 Table message from a plain object. Also converts values to their respective internal types. + * Creates a FontSize message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Table + * @returns FontSize */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Table; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Style.FontSize; /** - * Creates a plain object from a Table message. Also converts values to other types if specified. - * @param message Table + * 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.Page.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Style.FontSize, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Table to JSON. + * Converts this FontSize to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Table + * 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; } + } - namespace Table { + /** Properties of a Page. */ + interface IPage { - /** Properties of a TableRow. */ - interface ITableRow { + /** Page pageNumber */ + pageNumber?: (number|null); - /** TableRow cells */ - cells?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell[]|null); - } + /** Page image */ + image?: (google.cloud.documentai.v1beta3.Document.Page.IImage|null); - /** Represents a TableRow. */ - class TableRow implements ITableRow { + /** Page transforms */ + transforms?: (google.cloud.documentai.v1beta3.Document.Page.IMatrix[]|null); - /** - * Constructs a new TableRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow); + /** Page dimension */ + dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); - /** TableRow cells. */ - public cells: google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell[]; + /** Page layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * 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; + /** Page detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** - * 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; + /** Page blocks */ + blocks?: (google.cloud.documentai.v1beta3.Document.Page.IBlock[]|null); - /** - * 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; + /** Page paragraphs */ + paragraphs?: (google.cloud.documentai.v1beta3.Document.Page.IParagraph[]|null); - /** - * 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; + /** Page lines */ + lines?: (google.cloud.documentai.v1beta3.Document.Page.ILine[]|null); - /** - * 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; + /** Page tokens */ + tokens?: (google.cloud.documentai.v1beta3.Document.Page.IToken[]|null); - /** - * 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); + /** Page visualElements */ + visualElements?: (google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]|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; + /** Page tables */ + tables?: (google.cloud.documentai.v1beta3.Document.Page.ITable[]|null); - /** - * 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 }; + /** Page formFields */ + formFields?: (google.cloud.documentai.v1beta3.Document.Page.IFormField[]|null); - /** - * Converts this TableRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Page symbols */ + symbols?: (google.cloud.documentai.v1beta3.Document.Page.ISymbol[]|null); - /** - * 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; - } + /** Page detectedBarcodes */ + detectedBarcodes?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]|null); - /** Properties of a TableCell. */ - interface ITableCell { + /** Page imageQualityScores */ + imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); - /** TableCell layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Page provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } - /** TableCell rowSpan */ - rowSpan?: (number|null); + /** Represents a Page. */ + class Page implements IPage { - /** TableCell colSpan */ - colSpan?: (number|null); + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.IPage); - /** TableCell detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - } + /** Page pageNumber. */ + public pageNumber: number; - /** Represents a TableCell. */ - class TableCell implements ITableCell { + /** Page image. */ + public image?: (google.cloud.documentai.v1beta3.Document.Page.IImage|null); - /** - * Constructs a new TableCell. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell); + /** Page transforms. */ + public transforms: google.cloud.documentai.v1beta3.Document.Page.IMatrix[]; - /** TableCell layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Page dimension. */ + public dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); - /** TableCell rowSpan. */ - public rowSpan: number; + /** Page layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** TableCell colSpan. */ - public colSpan: number; + /** Page detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** TableCell detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** Page blocks. */ + public blocks: google.cloud.documentai.v1beta3.Document.Page.IBlock[]; - /** - * 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; + /** Page paragraphs. */ + public paragraphs: google.cloud.documentai.v1beta3.Document.Page.IParagraph[]; - /** - * 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; + /** Page lines. */ + public lines: google.cloud.documentai.v1beta3.Document.Page.ILine[]; - /** - * 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; + /** Page tokens. */ + public tokens: google.cloud.documentai.v1beta3.Document.Page.IToken[]; - /** - * 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; + /** Page visualElements. */ + public visualElements: google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]; - /** - * 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; + /** Page tables. */ + public tables: google.cloud.documentai.v1beta3.Document.Page.ITable[]; - /** - * 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); + /** Page formFields. */ + public formFields: google.cloud.documentai.v1beta3.Document.Page.IFormField[]; - /** - * 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; + /** Page symbols. */ + public symbols: google.cloud.documentai.v1beta3.Document.Page.ISymbol[]; - /** - * 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 }; + /** Page detectedBarcodes. */ + public detectedBarcodes: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]; - /** - * Converts this TableCell to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Page imageQualityScores. */ + public imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); - /** - * 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; - } - } + /** Page provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - /** Properties of a FormField. */ - interface IFormField { + /** + * 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; - /** FormField fieldName */ - fieldName?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** + * 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; - /** FormField fieldValue */ - fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** + * 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; - /** FormField nameDetectedLanguages */ - nameDetectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** + * 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; - /** FormField valueDetectedLanguages */ - valueDetectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + /** + * 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; - /** FormField valueType */ - valueType?: (string|null); + /** + * 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); - /** FormField correctedKeyText */ - correctedKeyText?: (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; - /** FormField correctedValueText */ - correctedValueText?: (string|null); + /** + * 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 }; - /** FormField provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents a FormField. */ - class FormField implements IFormField { + /** + * 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; + } - /** - * Constructs a new FormField. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IFormField); + namespace Page { - /** FormField fieldName. */ - public fieldName?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Properties of a Dimension. */ + interface IDimension { - /** FormField fieldValue. */ - public fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Dimension width */ + width?: (number|null); - /** FormField nameDetectedLanguages. */ - public nameDetectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** Dimension height */ + height?: (number|null); - /** FormField valueDetectedLanguages. */ - public valueDetectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + /** Dimension unit */ + unit?: (string|null); + } - /** FormField valueType. */ - public valueType: string; + /** Represents a Dimension. */ + class Dimension implements IDimension { - /** FormField correctedKeyText. */ - public correctedKeyText: string; + /** + * Constructs a new Dimension. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDimension); - /** FormField correctedValueText. */ - public correctedValueText: string; + /** Dimension width. */ + public width: number; - /** FormField provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** Dimension height. */ + public height: number; + + /** Dimension unit. */ + public unit: string; /** - * Creates a new FormField instance using the specified properties. + * Creates a new Dimension instance using the specified properties. * @param [properties] Properties to set - * @returns FormField instance + * @returns Dimension instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IFormField): google.cloud.documentai.v1beta3.Document.Page.FormField; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IDimension): google.cloud.documentai.v1beta3.Document.Page.Dimension; /** - * 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 + * 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.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.IDimension, 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 + * 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.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FormField message from the specified reader or buffer. + * 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 FormField + * @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.FormField; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Dimension; /** - * Decodes a FormField message from the specified reader or buffer, length delimited. + * Decodes a Dimension message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FormField + * @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.FormField; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Dimension; /** - * Verifies a FormField message. + * 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 FormField message from a plain object. Also converts values to their respective internal types. + * Creates a Dimension message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FormField + * @returns Dimension */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.FormField; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Dimension; /** - * Creates a plain object from a FormField message. Also converts values to other types if specified. - * @param message FormField + * 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.FormField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Dimension, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FormField to JSON. + * Converts this Dimension to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FormField + * 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 a DetectedBarcode. */ - interface IDetectedBarcode { + /** Properties of an Image. */ + interface IImage { - /** DetectedBarcode layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Image content */ + content?: (Uint8Array|string|null); - /** DetectedBarcode barcode */ - barcode?: (google.cloud.documentai.v1beta3.IBarcode|null); + /** Image mimeType */ + mimeType?: (string|null); + + /** Image width */ + width?: (number|null); + + /** Image height */ + height?: (number|null); } - /** Represents a DetectedBarcode. */ - class DetectedBarcode implements IDetectedBarcode { + /** Represents an Image. */ + class Image implements IImage { /** - * Constructs a new DetectedBarcode. + * Constructs a new Image. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IImage); - /** DetectedBarcode layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + /** Image content. */ + public content: (Uint8Array|string); - /** DetectedBarcode barcode. */ - public barcode?: (google.cloud.documentai.v1beta3.IBarcode|null); + /** Image mimeType. */ + public mimeType: string; + + /** Image width. */ + public width: number; + + /** Image height. */ + public height: number; /** - * Creates a new DetectedBarcode instance using the specified properties. + * Creates a new Image instance using the specified properties. * @param [properties] Properties to set - * @returns DetectedBarcode instance + * @returns Image instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode): google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IImage): google.cloud.documentai.v1beta3.Document.Page.Image; /** - * 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 + * 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.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.IImage, 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 + * 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.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DetectedBarcode message from the specified reader or buffer. + * 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 DetectedBarcode + * @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.DetectedBarcode; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Image; /** - * Decodes a DetectedBarcode message from the specified reader or buffer, length delimited. + * Decodes an Image message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DetectedBarcode + * @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.DetectedBarcode; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Image; /** - * Verifies a DetectedBarcode message. + * 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 a DetectedBarcode message from a plain object. Also converts values to their respective internal types. + * Creates an Image message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DetectedBarcode + * @returns Image */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Image; /** - * Creates a plain object from a DetectedBarcode message. Also converts values to other types if specified. - * @param message DetectedBarcode + * 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.DetectedBarcode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DetectedBarcode to JSON. + * Converts this Image to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DetectedBarcode + * 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 DetectedLanguage. */ - interface IDetectedLanguage { + /** Properties of a Matrix. */ + interface IMatrix { - /** DetectedLanguage languageCode */ - languageCode?: (string|null); + /** Matrix rows */ + rows?: (number|null); - /** DetectedLanguage confidence */ - confidence?: (number|null); + /** Matrix cols */ + cols?: (number|null); + + /** Matrix type */ + type?: (number|null); + + /** Matrix data */ + data?: (Uint8Array|string|null); } - /** Represents a DetectedLanguage. */ - class DetectedLanguage implements IDetectedLanguage { + /** Represents a Matrix. */ + class Matrix implements IMatrix { /** - * Constructs a new DetectedLanguage. + * Constructs a new Matrix. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IMatrix); - /** DetectedLanguage languageCode. */ - public languageCode: string; + /** Matrix rows. */ + public rows: number; - /** DetectedLanguage confidence. */ - public confidence: number; + /** Matrix cols. */ + public cols: number; + + /** Matrix type. */ + public type: number; + + /** Matrix data. */ + public data: (Uint8Array|string); /** - * Creates a new DetectedLanguage instance using the specified properties. + * Creates a new Matrix instance using the specified properties. * @param [properties] Properties to set - * @returns DetectedLanguage instance + * @returns Matrix instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage): google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IMatrix): google.cloud.documentai.v1beta3.Document.Page.Matrix; /** - * 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 + * 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.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.IMatrix, 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 + * 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.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.IMatrix, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DetectedLanguage message from the specified reader or buffer. + * 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 DetectedLanguage + * @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.DetectedLanguage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Matrix; /** - * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * Decodes a Matrix message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DetectedLanguage + * @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.DetectedLanguage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Matrix; /** - * Verifies a DetectedLanguage message. + * 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 DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * Creates a Matrix message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DetectedLanguage + * @returns Matrix */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Matrix; /** - * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. - * @param message DetectedLanguage + * 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.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Matrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DetectedLanguage to JSON. + * Converts this Matrix to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DetectedLanguage + * 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 an ImageQualityScores. */ - interface IImageQualityScores { + /** Properties of a Layout. */ + interface ILayout { - /** ImageQualityScores qualityScore */ - qualityScore?: (number|null); + /** Layout textAnchor */ + textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); - /** ImageQualityScores detectedDefects */ - detectedDefects?: (google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect[]|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 an ImageQualityScores. */ - class ImageQualityScores implements IImageQualityScores { + /** Represents a Layout. */ + class Layout implements ILayout { /** - * Constructs a new ImageQualityScores. + * Constructs a new Layout. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ILayout); - /** ImageQualityScores qualityScore. */ - public qualityScore: number; + /** Layout textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); - /** ImageQualityScores detectedDefects. */ - public detectedDefects: google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect[]; + /** 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 ImageQualityScores instance using the specified properties. + * Creates a new Layout instance using the specified properties. * @param [properties] Properties to set - * @returns ImageQualityScores instance + * @returns Layout instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores): google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.ILayout): google.cloud.documentai.v1beta3.Document.Page.Layout; /** - * 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 + * 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.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.ILayout, 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 + * 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.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImageQualityScores message from the specified reader or buffer. + * 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 ImageQualityScores + * @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.ImageQualityScores; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Layout; /** - * Decodes an ImageQualityScores message from the specified reader or buffer, length delimited. + * Decodes a Layout message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImageQualityScores + * @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.ImageQualityScores; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Layout; /** - * Verifies an ImageQualityScores message. + * 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 an ImageQualityScores message from a plain object. Also converts values to their respective internal types. + * Creates a Layout message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImageQualityScores + * @returns Layout */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Layout; /** - * Creates a plain object from an ImageQualityScores message. Also converts values to other types if specified. - * @param message ImageQualityScores + * 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.ImageQualityScores, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImageQualityScores to JSON. + * Converts this Layout to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImageQualityScores + * 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 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 }; + namespace Layout { - /** - * 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; + /** Orientation enum. */ + enum Orientation { + ORIENTATION_UNSPECIFIED = 0, + PAGE_UP = 1, + PAGE_RIGHT = 2, + PAGE_DOWN = 3, + PAGE_LEFT = 4 } } - } - - /** 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); - } - - /** 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[]; + /** Properties of a Block. */ + interface IBlock { - /** Entity provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** Block layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** Entity redacted. */ - public redacted: boolean; + /** Block detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** - * 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; + /** Block provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } - /** - * 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; + /** Represents a Block. */ + class Block implements IBlock { - /** - * 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; + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IBlock); - /** - * 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; + /** Block layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * 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; + /** Block detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** - * 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); + /** Block provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|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 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this Entity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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; - namespace Entity { + /** + * 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; - /** Properties of a NormalizedValue. */ - interface INormalizedValue { + /** + * 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); - /** NormalizedValue moneyValue */ - moneyValue?: (google.type.IMoney|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; - /** NormalizedValue dateValue */ - dateValue?: (google.type.IDate|null); + /** + * 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 }; - /** NormalizedValue datetimeValue */ - datetimeValue?: (google.type.IDateTime|null); + /** + * Converts this Block to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** NormalizedValue addressValue */ - addressValue?: (google.type.IPostalAddress|null); + /** + * 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; + } - /** NormalizedValue booleanValue */ - booleanValue?: (boolean|null); + /** Properties of a Paragraph. */ + interface IParagraph { - /** NormalizedValue integerValue */ - integerValue?: (number|null); + /** Paragraph layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** NormalizedValue floatValue */ - floatValue?: (number|null); + /** Paragraph detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** NormalizedValue text */ - text?: (string|null); + /** Paragraph provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); } - /** Represents a NormalizedValue. */ - class NormalizedValue implements INormalizedValue { + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { /** - * Constructs a new NormalizedValue. + * Constructs a new Paragraph. * @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); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IParagraph); - /** NormalizedValue floatValue. */ - public floatValue?: (number|null); + /** Paragraph layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** NormalizedValue text. */ - public text: string; + /** Paragraph detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** NormalizedValue structuredValue. */ - public structuredValue?: ("moneyValue"|"dateValue"|"datetimeValue"|"addressValue"|"booleanValue"|"integerValue"|"floatValue"); + /** Paragraph provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); /** - * Creates a new NormalizedValue instance using the specified properties. + * Creates a new Paragraph instance using the specified properties. * @param [properties] Properties to set - * @returns NormalizedValue instance + * @returns Paragraph instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue): google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IParagraph): google.cloud.documentai.v1beta3.Document.Page.Paragraph; /** - * 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 + * 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.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.IParagraph, 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 + * 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.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NormalizedValue message from the specified reader or buffer. + * 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 NormalizedValue + * @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.Entity.NormalizedValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Paragraph; /** - * Decodes a NormalizedValue message from the specified reader or buffer, length delimited. + * Decodes a Paragraph message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NormalizedValue + * @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.Entity.NormalizedValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Paragraph; /** - * Verifies a NormalizedValue message. + * 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 NormalizedValue message from a plain object. Also converts values to their respective internal types. + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NormalizedValue + * @returns Paragraph */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Paragraph; /** - * Creates a plain object from a NormalizedValue message. Also converts values to other types if specified. - * @param message NormalizedValue + * 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.Entity.NormalizedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NormalizedValue to JSON. + * Converts this Paragraph to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for NormalizedValue + * 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 an EntityRelation. */ - interface IEntityRelation { - /** EntityRelation subjectId */ - subjectId?: (string|null); + /** Properties of a Line. */ + interface ILine { - /** 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 { + /** Line layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** TextSegment startIndex */ - startIndex?: (number|Long|string|null); + /** Line detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** TextSegment endIndex */ - endIndex?: (number|Long|string|null); + /** Line provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); } - /** Represents a TextSegment. */ - class TextSegment implements ITextSegment { + /** Represents a Line. */ + class Line implements ILine { /** - * Constructs a new TextSegment. + * Constructs a new Line. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ILine); - /** TextSegment startIndex. */ - public startIndex: (number|Long|string); + /** Line layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** TextSegment endIndex. */ - public endIndex: (number|Long|string); + /** 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 TextSegment instance using the specified properties. + * Creates a new Line instance using the specified properties. * @param [properties] Properties to set - * @returns TextSegment instance + * @returns Line instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment): google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.ILine): google.cloud.documentai.v1beta3.Document.Page.Line; /** - * 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 + * 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.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.ILine, 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 + * 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.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TextSegment message from the specified reader or buffer. + * 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 TextSegment + * @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.TextAnchor.TextSegment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Line; /** - * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * Decodes a Line message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TextSegment + * @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.TextAnchor.TextSegment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Line; /** - * Verifies a TextSegment message. + * 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 TextSegment message from a plain object. Also converts values to their respective internal types. + * Creates a Line message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TextSegment + * @returns Line */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Line; /** - * Creates a plain object from a TextSegment message. Also converts values to other types if specified. - * @param message TextSegment + * 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.TextAnchor.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TextSegment to JSON. + * Converts this Line to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TextSegment + * 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 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 { + /** Properties of a Token. */ + interface IToken { - /** PageRef page */ - page?: (number|Long|string|null); + /** Token layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** PageRef layoutType */ - layoutType?: (google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|null); + /** Token detectedBreak */ + detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); - /** PageRef layoutId */ - layoutId?: (string|null); + /** Token detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** PageRef boundingPoly */ - boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + /** Token provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - /** PageRef confidence */ - confidence?: (number|null); + /** Token styleInfo */ + styleInfo?: (google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo|null); } - /** Represents a PageRef. */ - class PageRef implements IPageRef { + /** Represents a Token. */ + class Token implements IToken { /** - * Constructs a new PageRef. + * Constructs a new Token. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IToken); - /** PageRef page. */ - public page: (number|Long|string); + /** Token layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** PageRef layoutType. */ - public layoutType: (google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType); + /** Token detectedBreak. */ + public detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); - /** PageRef layoutId. */ - public layoutId: string; + /** Token detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** PageRef boundingPoly. */ - public boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + /** Token provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - /** PageRef confidence. */ - public confidence: number; + /** Token styleInfo. */ + public styleInfo?: (google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo|null); /** - * Creates a new PageRef instance using the specified properties. + * Creates a new Token instance using the specified properties. * @param [properties] Properties to set - * @returns PageRef instance + * @returns Token instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef): google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.IToken): google.cloud.documentai.v1beta3.Document.Page.Token; /** - * 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 + * 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.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.IToken, 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 + * 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.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.IToken, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PageRef message from the specified reader or buffer. + * 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 PageRef + * @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.PageAnchor.PageRef; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Token; /** - * Decodes a PageRef message from the specified reader or buffer, length delimited. + * Decodes a Token message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PageRef + * @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.PageAnchor.PageRef; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Token; /** - * Verifies a PageRef message. + * 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 PageRef message from a plain object. Also converts values to their respective internal types. + * Creates a Token message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PageRef + * @returns Token */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Token; /** - * Creates a plain object from a PageRef message. Also converts values to other types if specified. - * @param message PageRef + * 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.PageAnchor.PageRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Token, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PageRef to JSON. + * Converts this Token to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PageRef + * 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 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 - } - } - } + namespace Token { - /** Properties of a Provenance. */ - interface IProvenance { + /** Properties of a DetectedBreak. */ + interface IDetectedBreak { - /** Provenance revision */ - revision?: (number|null); + /** DetectedBreak type */ + type?: (google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|null); + } - /** Provenance id */ - id?: (number|null); + /** Represents a DetectedBreak. */ + class DetectedBreak implements IDetectedBreak { - /** Provenance parents */ - parents?: (google.cloud.documentai.v1beta3.Document.Provenance.IParent[]|null); + /** + * Constructs a new DetectedBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak); - /** Provenance type */ - type?: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.Document.Provenance.OperationType|null); - } + /** DetectedBreak type. */ + public type: (google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type); - /** Represents a Provenance. */ - class Provenance implements IProvenance { + /** + * 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; - /** - * Constructs a new Provenance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IProvenance); + /** + * 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; - /** Provenance revision. */ - public revision: number; + /** + * 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; - /** Provenance id. */ - public id: number; + /** + * 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; - /** Provenance parents. */ - public parents: google.cloud.documentai.v1beta3.Document.Provenance.IParent[]; + /** + * 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; - /** Provenance type. */ - public type: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.Document.Provenance.OperationType); + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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; + /** + * Converts this DetectedBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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; + namespace DetectedBreak { - /** - * 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); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SPACE = 1, + WIDE_SPACE = 2, + HYPHEN = 3 + } + } - /** - * 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; + /** Properties of a StyleInfo. */ + interface IStyleInfo { - /** - * 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 }; + /** StyleInfo fontSize */ + fontSize?: (number|null); - /** - * Converts this Provenance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** StyleInfo pixelFontSize */ + pixelFontSize?: (number|null); - /** - * 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; - } + /** StyleInfo letterSpacing */ + letterSpacing?: (number|null); - namespace Provenance { + /** StyleInfo fontType */ + fontType?: (string|null); - /** Properties of a Parent. */ - interface IParent { + /** StyleInfo bold */ + bold?: (boolean|null); - /** Parent revision */ - revision?: (number|null); + /** StyleInfo italic */ + italic?: (boolean|null); - /** Parent index */ - index?: (number|null); + /** StyleInfo underlined */ + underlined?: (boolean|null); - /** Parent id */ - id?: (number|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; + } } - /** Represents a Parent. */ - class Parent implements IParent { + /** 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 Parent. + * Constructs a new Symbol. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Provenance.IParent); - - /** Parent revision. */ - public revision: number; + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ISymbol); - /** Parent index. */ - public index: number; + /** Symbol layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** Parent id. */ - public id: number; + /** Symbol detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; /** - * Creates a new Parent instance using the specified properties. + * Creates a new Symbol instance using the specified properties. * @param [properties] Properties to set - * @returns Parent instance + * @returns Symbol instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Provenance.IParent): google.cloud.documentai.v1beta3.Document.Provenance.Parent; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.ISymbol): google.cloud.documentai.v1beta3.Document.Page.Symbol; /** - * 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 + * 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.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.ISymbol, 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 + * 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.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Parent message from the specified reader or buffer. + * 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 Parent + * @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.Provenance.Parent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Symbol; /** - * Decodes a Parent message from the specified reader or buffer, length delimited. + * Decodes a Symbol message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Parent + * @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.Provenance.Parent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Symbol; /** - * Verifies a Parent message. + * 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 Parent message from a plain object. Also converts values to their respective internal types. + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Parent + * @returns Symbol */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Provenance.Parent; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Symbol; /** - * Creates a plain object from a Parent message. Also converts values to other types if specified. - * @param message Parent + * 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.Provenance.Parent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Parent to JSON. + * Converts this Symbol to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Parent + * 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; } - /** 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 VisualElement. */ + interface IVisualElement { - /** Properties of a Revision. */ - interface IRevision { + /** VisualElement layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** Revision agent */ - agent?: (string|null); + /** VisualElement type */ + type?: (string|null); - /** Revision processor */ - processor?: (string|null); + /** VisualElement detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + } - /** Revision id */ - id?: (string|null); + /** Represents a VisualElement. */ + class VisualElement implements IVisualElement { - /** Revision parent */ - parent?: (number[]|null); + /** + * Constructs a new VisualElement. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IVisualElement); - /** Revision parentIds */ - parentIds?: (string[]|null); + /** VisualElement layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** Revision createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** VisualElement type. */ + public type: string; - /** Revision humanReview */ - humanReview?: (google.cloud.documentai.v1beta3.Document.Revision.IHumanReview|null); - } + /** VisualElement detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** Represents a Revision. */ - class Revision implements IRevision { + /** + * 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; - /** - * Constructs a new Revision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IRevision); + /** + * 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; - /** Revision agent. */ - public agent?: (string|null); + /** + * 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; - /** Revision processor. */ - public processor?: (string|null); + /** + * 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; - /** Revision id. */ - public id: string; + /** + * 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; - /** Revision parent. */ - public parent: number[]; + /** + * 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); - /** Revision parentIds. */ - public parentIds: string[]; + /** + * 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; - /** Revision createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * 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 }; - /** Revision humanReview. */ - public humanReview?: (google.cloud.documentai.v1beta3.Document.Revision.IHumanReview|null); + /** + * Converts this VisualElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Revision source. */ - public source?: ("agent"|"processor"); + /** + * 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; + } - /** - * 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; + /** Properties of a Table. */ + interface ITable { - /** - * 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; + /** Table layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * 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; + /** Table headerRows */ + headerRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|null); - /** - * 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 { + /** Table bodyRows */ + bodyRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|null); - /** HumanReview state */ - state?: (string|null); + /** Table detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** HumanReview stateMessage */ - stateMessage?: (string|null); + /** Table provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); } - /** Represents a HumanReview. */ - class HumanReview implements IHumanReview { + /** Represents a Table. */ + class Table implements ITable { /** - * Constructs a new HumanReview. + * Constructs a new Table. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Revision.IHumanReview); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ITable); - /** HumanReview state. */ - public state: string; + /** Table layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** HumanReview stateMessage. */ - public stateMessage: string; + /** 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 HumanReview instance using the specified properties. + * Creates a new Table instance using the specified properties. * @param [properties] Properties to set - * @returns HumanReview instance + * @returns Table instance */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.Revision.IHumanReview): google.cloud.documentai.v1beta3.Document.Revision.HumanReview; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Page.ITable): google.cloud.documentai.v1beta3.Document.Page.Table; /** - * 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 + * 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.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Page.ITable, 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 + * 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.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Page.ITable, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HumanReview message from the specified reader or buffer. + * 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 HumanReview + * @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.Revision.HumanReview; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Page.Table; /** - * Decodes a HumanReview message from the specified reader or buffer, length delimited. + * Decodes a Table message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HumanReview + * @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.Revision.HumanReview; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Page.Table; /** - * Verifies a HumanReview message. + * 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 HumanReview message from a plain object. Also converts values to their respective internal types. + * Creates a Table message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HumanReview + * @returns Table */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Revision.HumanReview; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Page.Table; /** - * Creates a plain object from a HumanReview message. Also converts values to other types if specified. - * @param message HumanReview + * 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.Revision.HumanReview, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Page.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HumanReview to JSON. + * Converts this Table to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for HumanReview + * 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; } - } - /** Properties of a TextChange. */ - interface ITextChange { + namespace Table { - /** TextChange textAnchor */ - textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); + /** Properties of a TableRow. */ + interface ITableRow { - /** TextChange changedText */ - changedText?: (string|null); + /** TableRow cells */ + cells?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell[]|null); + } - /** TextChange provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance[]|null); - } + /** Represents a TableRow. */ + class TableRow implements ITableRow { - /** Represents a TextChange. */ - class TextChange implements ITextChange { + /** + * Constructs a new TableRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow); - /** - * Constructs a new TextChange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.ITextChange); + /** TableRow cells. */ + public cells: google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell[]; - /** TextChange textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); + /** + * 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; - /** TextChange changedText. */ - public changedText: string; + /** + * 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; - /** TextChange provenance. */ - public provenance: google.cloud.documentai.v1beta3.Document.IProvenance[]; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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); + /** + * Converts this TableRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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 }; + /** Properties of a TableCell. */ + interface ITableCell { - /** - * Converts this TextChange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** TableCell layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * 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; - } - } + /** TableCell rowSpan */ + rowSpan?: (number|null); - /** Properties of a Vertex. */ - interface IVertex { + /** TableCell colSpan */ + colSpan?: (number|null); - /** Vertex x */ - x?: (number|null); + /** TableCell detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + } - /** Vertex y */ - y?: (number|null); - } + /** Represents a TableCell. */ + class TableCell implements ITableCell { - /** Represents a Vertex. */ - class Vertex implements IVertex { + /** + * Constructs a new TableCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell); - /** - * Constructs a new Vertex. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IVertex); + /** TableCell layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** Vertex x. */ - public x: number; + /** TableCell rowSpan. */ + public rowSpan: number; - /** Vertex y. */ - public y: number; + /** TableCell colSpan. */ + public colSpan: 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; + /** TableCell detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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 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 }; + /** + * 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; - /** - * Converts this Vertex to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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 }; - /** - * 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; - } + /** + * Converts this TableCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a NormalizedVertex. */ - interface INormalizedVertex { + /** + * 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; + } + } - /** NormalizedVertex x */ - x?: (number|null); + /** Properties of a FormField. */ + interface IFormField { - /** NormalizedVertex y */ - y?: (number|null); - } + /** FormField fieldName */ + fieldName?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** Represents a NormalizedVertex. */ - class NormalizedVertex implements INormalizedVertex { + /** FormField fieldValue */ + fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * Constructs a new NormalizedVertex. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.INormalizedVertex); - - /** NormalizedVertex x. */ - public x: number; + /** FormField nameDetectedLanguages */ + nameDetectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** NormalizedVertex y. */ - public y: number; + /** FormField valueDetectedLanguages */ + valueDetectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - /** - * 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; + /** FormField valueType */ + valueType?: (string|null); - /** - * 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; + /** FormField correctedKeyText */ + correctedKeyText?: (string|null); - /** - * 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; + /** FormField correctedValueText */ + correctedValueText?: (string|null); - /** - * 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; + /** FormField provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } - /** - * 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; + /** Represents a FormField. */ + class FormField implements IFormField { - /** - * 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); + /** + * Constructs a new FormField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IFormField); - /** - * 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; + /** FormField fieldName. */ + public fieldName?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * 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 }; + /** FormField fieldValue. */ + public fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * Converts this NormalizedVertex to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** FormField nameDetectedLanguages. */ + public nameDetectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** - * 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; - } + /** FormField valueDetectedLanguages. */ + public valueDetectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - /** Properties of a BoundingPoly. */ - interface IBoundingPoly { + /** FormField valueType. */ + public valueType: string; - /** BoundingPoly vertices */ - vertices?: (google.cloud.documentai.v1beta3.IVertex[]|null); + /** FormField correctedKeyText. */ + public correctedKeyText: string; - /** BoundingPoly normalizedVertices */ - normalizedVertices?: (google.cloud.documentai.v1beta3.INormalizedVertex[]|null); - } + /** FormField correctedValueText. */ + public correctedValueText: string; - /** Represents a BoundingPoly. */ - class BoundingPoly implements IBoundingPoly { + /** FormField provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - /** - * Constructs a new BoundingPoly. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBoundingPoly); + /** + * 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; - /** BoundingPoly vertices. */ - public vertices: google.cloud.documentai.v1beta3.IVertex[]; + /** + * 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; - /** BoundingPoly normalizedVertices. */ - public normalizedVertices: google.cloud.documentai.v1beta3.INormalizedVertex[]; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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); + /** + * Converts this FormField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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 }; + /** Properties of a DetectedBarcode. */ + interface IDetectedBarcode { - /** - * Converts this BoundingPoly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** DetectedBarcode layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** - * 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; - } + /** DetectedBarcode barcode */ + barcode?: (google.cloud.documentai.v1beta3.IBarcode|null); + } - /** Properties of a RawDocument. */ - interface IRawDocument { + /** Represents a DetectedBarcode. */ + class DetectedBarcode implements IDetectedBarcode { - /** RawDocument content */ - content?: (Uint8Array|string|null); + /** + * Constructs a new DetectedBarcode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode); - /** RawDocument mimeType */ - mimeType?: (string|null); - } + /** DetectedBarcode layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - /** Represents a RawDocument. */ - class RawDocument implements IRawDocument { + /** DetectedBarcode barcode. */ + public barcode?: (google.cloud.documentai.v1beta3.IBarcode|null); - /** - * Constructs a new RawDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IRawDocument); + /** + * 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; - /** RawDocument content. */ - public content: (Uint8Array|string); + /** + * 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; - /** RawDocument mimeType. */ - public mimeType: string; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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); + /** + * Converts this DetectedBarcode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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 }; + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { - /** - * Converts this RawDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** DetectedLanguage languageCode */ + languageCode?: (string|null); - /** - * 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; - } + /** DetectedLanguage confidence */ + confidence?: (number|null); + } - /** Properties of a GcsDocument. */ - interface IGcsDocument { + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { - /** GcsDocument gcsUri */ - gcsUri?: (string|null); + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage); - /** GcsDocument mimeType */ - mimeType?: (string|null); - } + /** DetectedLanguage languageCode. */ + public languageCode: string; - /** Represents a GcsDocument. */ - class GcsDocument implements IGcsDocument { + /** DetectedLanguage confidence. */ + public confidence: number; - /** - * Constructs a new GcsDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocument); + /** + * 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; - /** GcsDocument gcsUri. */ - public gcsUri: string; + /** + * 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; - /** GcsDocument mimeType. */ - public mimeType: string; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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); + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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); + } + + /** 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; + + /** + * 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 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 text. */ + public text: string; + + /** NormalizedValue structuredValue. */ + public structuredValue?: ("moneyValue"|"dateValue"|"datetimeValue"|"addressValue"|"booleanValue"|"integerValue"|"floatValue"); + + /** + * 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; + } + } + + /** 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); - /** - * 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 }; + /** PageRef layoutType */ + layoutType?: (google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|null); - /** - * Converts this GcsDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** PageRef layoutId */ + layoutId?: (string|null); - /** - * 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; - } + /** PageRef boundingPoly */ + boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); - /** Properties of a GcsDocuments. */ - interface IGcsDocuments { + /** PageRef confidence */ + confidence?: (number|null); + } - /** GcsDocuments documents */ - documents?: (google.cloud.documentai.v1beta3.IGcsDocument[]|null); - } + /** Represents a PageRef. */ + class PageRef implements IPageRef { - /** Represents a GcsDocuments. */ - class GcsDocuments implements IGcsDocuments { + /** + * Constructs a new PageRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef); - /** - * Constructs a new GcsDocuments. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocuments); + /** PageRef page. */ + public page: (number|Long|string); - /** GcsDocuments documents. */ - public documents: google.cloud.documentai.v1beta3.IGcsDocument[]; + /** PageRef layoutType. */ + public layoutType: (google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType); - /** - * 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; + /** PageRef layoutId. */ + public layoutId: string; - /** - * 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; + /** PageRef boundingPoly. */ + public boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); - /** - * 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; + /** PageRef confidence. */ + public confidence: number; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this GcsDocuments to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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); - /** - * 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; - } + /** + * 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; - /** Properties of a GcsPrefix. */ - interface IGcsPrefix { + /** + * 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 }; - /** GcsPrefix gcsUriPrefix */ - gcsUriPrefix?: (string|null); - } + /** + * Converts this PageRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents a GcsPrefix. */ - class GcsPrefix implements IGcsPrefix { + /** + * 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; + } - /** - * Constructs a new GcsPrefix. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGcsPrefix); + namespace PageRef { - /** GcsPrefix gcsUriPrefix. */ - public gcsUriPrefix: string; + /** LayoutType enum. */ + enum LayoutType { + LAYOUT_TYPE_UNSPECIFIED = 0, + BLOCK = 1, + PARAGRAPH = 2, + LINE = 3, + TOKEN = 4, + VISUAL_ELEMENT = 5, + TABLE = 6, + FORM_FIELD = 7 + } + } + } - /** - * 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; + /** Properties of a Provenance. */ + interface IProvenance { - /** - * 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; + /** Provenance revision */ + revision?: (number|null); - /** - * 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; + /** Provenance id */ + id?: (number|null); - /** - * 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; + /** Provenance parents */ + parents?: (google.cloud.documentai.v1beta3.Document.Provenance.IParent[]|null); - /** - * 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; + /** Provenance type */ + type?: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.Document.Provenance.OperationType|null); + } - /** - * 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); + /** Represents a Provenance. */ + class Provenance implements IProvenance { - /** - * 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; + /** + * Constructs a new Provenance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.IProvenance); - /** - * 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 }; + /** Provenance revision. */ + public revision: number; - /** - * Converts this GcsPrefix to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Provenance id. */ + public id: number; - /** - * 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; - } + /** Provenance parents. */ + public parents: google.cloud.documentai.v1beta3.Document.Provenance.IParent[]; - /** Properties of a BatchDocumentsInputConfig. */ - interface IBatchDocumentsInputConfig { + /** Provenance type. */ + public type: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.Document.Provenance.OperationType); - /** BatchDocumentsInputConfig gcsPrefix */ - gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); + /** + * 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; - /** BatchDocumentsInputConfig gcsDocuments */ - gcsDocuments?: (google.cloud.documentai.v1beta3.IGcsDocuments|null); - } + /** + * 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; - /** Represents a BatchDocumentsInputConfig. */ - class BatchDocumentsInputConfig implements IBatchDocumentsInputConfig { + /** + * 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; - /** - * Constructs a new BatchDocumentsInputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig); + /** + * 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; - /** BatchDocumentsInputConfig gcsPrefix. */ - public gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); + /** + * 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; - /** BatchDocumentsInputConfig gcsDocuments. */ - public gcsDocuments?: (google.cloud.documentai.v1beta3.IGcsDocuments|null); + /** + * 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); - /** BatchDocumentsInputConfig source. */ - public source?: ("gcsPrefix"|"gcsDocuments"); + /** + * 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 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; + /** + * 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 }; - /** - * 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; + /** + * Converts this Provenance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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; + namespace Provenance { - /** - * 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; + /** Properties of a Parent. */ + interface IParent { - /** - * 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); + /** Parent revision */ + revision?: (number|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; + /** Parent index */ + index?: (number|null); - /** - * 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 }; + /** Parent id */ + id?: (number|null); + } - /** - * Converts this BatchDocumentsInputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a Parent. */ + class Parent implements IParent { - /** - * 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; - } + /** + * Constructs a new Parent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Provenance.IParent); - /** Properties of a DocumentOutputConfig. */ - interface IDocumentOutputConfig { + /** Parent revision. */ + public revision: number; - /** DocumentOutputConfig gcsOutputConfig */ - gcsOutputConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null); - } + /** Parent index. */ + public index: number; - /** Represents a DocumentOutputConfig. */ - class DocumentOutputConfig implements IDocumentOutputConfig { + /** 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; - /** - * Constructs a new DocumentOutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocumentOutputConfig); + /** + * 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; - /** DocumentOutputConfig gcsOutputConfig. */ - public gcsOutputConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null); + /** + * 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; - /** DocumentOutputConfig destination. */ - public destination?: "gcsOutputConfig"; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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; + /** + * Converts this Parent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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); + /** + * 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; + } - /** - * 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; + /** 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 + } + } - /** - * 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 }; + /** Properties of a Revision. */ + interface IRevision { - /** - * Converts this DocumentOutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Revision agent */ + agent?: (string|null); - /** - * 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; - } + /** Revision processor */ + processor?: (string|null); - namespace DocumentOutputConfig { + /** Revision id */ + id?: (string|null); - /** Properties of a GcsOutputConfig. */ - interface IGcsOutputConfig { + /** Revision parent */ + parent?: (number[]|null); - /** GcsOutputConfig gcsUri */ - gcsUri?: (string|null); + /** Revision parentIds */ + parentIds?: (string[]|null); - /** GcsOutputConfig fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); + /** Revision createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** GcsOutputConfig shardingConfig */ - shardingConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); + /** Revision humanReview */ + humanReview?: (google.cloud.documentai.v1beta3.Document.Revision.IHumanReview|null); } - /** Represents a GcsOutputConfig. */ - class GcsOutputConfig implements IGcsOutputConfig { + /** Represents a Revision. */ + class Revision implements IRevision { /** - * Constructs a new GcsOutputConfig. + * Constructs a new Revision. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig); + constructor(properties?: google.cloud.documentai.v1beta3.Document.IRevision); - /** GcsOutputConfig gcsUri. */ - public gcsUri: string; + /** Revision agent. */ + public agent?: (string|null); - /** GcsOutputConfig fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); + /** Revision processor. */ + public processor?: (string|null); - /** GcsOutputConfig shardingConfig. */ - public shardingConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|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 GcsOutputConfig instance using the specified properties. + * Creates a new Revision instance using the specified properties. * @param [properties] Properties to set - * @returns GcsOutputConfig instance + * @returns Revision instance */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig; + public static create(properties?: google.cloud.documentai.v1beta3.Document.IRevision): google.cloud.documentai.v1beta3.Document.Revision; /** - * 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 + * 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.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.IRevision, 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 + * 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.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsOutputConfig message from the specified reader or buffer. + * 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 GcsOutputConfig + * @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.DocumentOutputConfig.GcsOutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Revision; /** - * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a Revision message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsOutputConfig + * @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.DocumentOutputConfig.GcsOutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Revision; /** - * Verifies a GcsOutputConfig message. + * 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 GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Revision message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsOutputConfig + * @returns Revision */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Revision; /** - * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. - * @param message GcsOutputConfig + * 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.DocumentOutputConfig.GcsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.Document.Revision, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsOutputConfig to JSON. + * Converts this Revision to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GcsOutputConfig + * 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 GcsOutputConfig { + namespace Revision { - /** Properties of a ShardingConfig. */ - interface IShardingConfig { + /** Properties of a HumanReview. */ + interface IHumanReview { - /** ShardingConfig pagesPerShard */ - pagesPerShard?: (number|null); + /** HumanReview state */ + state?: (string|null); - /** ShardingConfig pagesOverlap */ - pagesOverlap?: (number|null); + /** HumanReview stateMessage */ + stateMessage?: (string|null); } - /** Represents a ShardingConfig. */ - class ShardingConfig implements IShardingConfig { + /** Represents a HumanReview. */ + class HumanReview implements IHumanReview { /** - * Constructs a new ShardingConfig. + * Constructs a new HumanReview. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig); + constructor(properties?: google.cloud.documentai.v1beta3.Document.Revision.IHumanReview); - /** ShardingConfig pagesPerShard. */ - public pagesPerShard: number; + /** HumanReview state. */ + public state: string; - /** ShardingConfig pagesOverlap. */ - public pagesOverlap: number; + /** HumanReview stateMessage. */ + public stateMessage: string; /** - * Creates a new ShardingConfig instance using the specified properties. + * Creates a new HumanReview instance using the specified properties. * @param [properties] Properties to set - * @returns ShardingConfig instance + * @returns HumanReview instance */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + public static create(properties?: google.cloud.documentai.v1beta3.Document.Revision.IHumanReview): google.cloud.documentai.v1beta3.Document.Revision.HumanReview; /** - * 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 + * 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.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.Document.Revision.IHumanReview, 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 + * 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.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ShardingConfig message from the specified reader or buffer. + * 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 ShardingConfig + * @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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.Document.Revision.HumanReview; /** - * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. + * Decodes a HumanReview message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ShardingConfig + * @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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.Document.Revision.HumanReview; /** - * Verifies a ShardingConfig message. + * 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 ShardingConfig message from a plain object. Also converts values to their respective internal types. + * Creates a HumanReview message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ShardingConfig + * @returns HumanReview */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + 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 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this ShardingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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); - /** - * 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; - } - } - } + /** + * 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; - /** Properties of an OcrConfig. */ - interface IOcrConfig { + /** + * 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 }; - /** OcrConfig hints */ - hints?: (google.cloud.documentai.v1beta3.OcrConfig.IHints|null); + /** + * Converts this Vertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** OcrConfig enableNativePdfParsing */ - enableNativePdfParsing?: (boolean|null); + /** + * 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; + } - /** OcrConfig enableImageQualityScores */ - enableImageQualityScores?: (boolean|null); + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { - /** OcrConfig advancedOcrOptions */ - advancedOcrOptions?: (string[]|null); + /** NormalizedVertex x */ + x?: (number|null); - /** OcrConfig enableSymbol */ - enableSymbol?: (boolean|null); + /** NormalizedVertex y */ + y?: (number|null); } - /** Represents an OcrConfig. */ - class OcrConfig implements IOcrConfig { + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { /** - * Constructs a new OcrConfig. + * Constructs a new NormalizedVertex. * @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; + constructor(properties?: google.cloud.documentai.v1beta3.INormalizedVertex); - /** OcrConfig advancedOcrOptions. */ - public advancedOcrOptions: string[]; + /** NormalizedVertex x. */ + public x: number; - /** OcrConfig enableSymbol. */ - public enableSymbol: boolean; + /** NormalizedVertex y. */ + public y: number; /** - * Creates a new OcrConfig instance using the specified properties. + * Creates a new NormalizedVertex instance using the specified properties. * @param [properties] Properties to set - * @returns OcrConfig instance + * @returns NormalizedVertex instance */ - public static create(properties?: google.cloud.documentai.v1beta3.IOcrConfig): google.cloud.documentai.v1beta3.OcrConfig; + public static create(properties?: google.cloud.documentai.v1beta3.INormalizedVertex): google.cloud.documentai.v1beta3.NormalizedVertex; /** - * 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 + * 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.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.INormalizedVertex, 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 + * 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.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OcrConfig message from the specified reader or buffer. + * 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 OcrConfig + * @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.OcrConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.NormalizedVertex; /** - * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OcrConfig + * @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.OcrConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.NormalizedVertex; /** - * Verifies an OcrConfig message. + * 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 an OcrConfig message from a plain object. Also converts values to their respective internal types. + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OcrConfig + * @returns NormalizedVertex */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.NormalizedVertex; /** - * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. - * @param message OcrConfig + * 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.OcrConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OcrConfig to JSON. + * Converts this NormalizedVertex to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OcrConfig + * 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; } - namespace OcrConfig { + /** Properties of a BoundingPoly. */ + interface IBoundingPoly { - /** Properties of a Hints. */ - interface IHints { + /** BoundingPoly vertices */ + vertices?: (google.cloud.documentai.v1beta3.IVertex[]|null); - /** Hints languageHints */ - languageHints?: (string[]|null); - } + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.documentai.v1beta3.INormalizedVertex[]|null); + } - /** Represents a Hints. */ - class Hints implements IHints { + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { - /** - * Constructs a new Hints. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.OcrConfig.IHints); + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBoundingPoly); - /** Hints languageHints. */ - public languageHints: string[]; + /** BoundingPoly vertices. */ + public vertices: google.cloud.documentai.v1beta3.IVertex[]; - /** - * 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; + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.documentai.v1beta3.INormalizedVertex[]; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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 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 }; + /** + * 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; - /** - * Converts this Hints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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 }; - /** - * 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; - } + /** + * 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; } /** Represents a DocumentProcessorService */ @@ -33459,6 +35253,9 @@ export namespace google { /** Properties of a TrainProcessorVersionRequest. */ interface ITrainProcessorVersionRequest { + /** TrainProcessorVersionRequest customDocumentExtractionOptions */ + customDocumentExtractionOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); + /** TrainProcessorVersionRequest parent */ parent?: (string|null); @@ -33484,6 +35281,9 @@ export namespace google { */ constructor(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest); + /** TrainProcessorVersionRequest customDocumentExtractionOptions. */ + public customDocumentExtractionOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); + /** TrainProcessorVersionRequest parent. */ public parent: string; @@ -33499,6 +35299,9 @@ export namespace google { /** TrainProcessorVersionRequest baseProcessorVersion. */ public baseProcessorVersion: string; + /** TrainProcessorVersionRequest processorFlags. */ + public processorFlags?: "customDocumentExtractionOptions"; + /** * Creates a new TrainProcessorVersionRequest instance using the specified properties. * @param [properties] Properties to set @@ -33681,6 +35484,113 @@ export namespace google { */ 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 TrainProcessorVersionResponse. */ @@ -35231,664 +37141,86 @@ export namespace google { 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 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); - } - - /** 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); + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); /** - * Creates a new DocumentSchema instance using the specified properties. + * Creates a new ImportProcessorVersionMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns DocumentSchema instance + * @returns ImportProcessorVersionMetadata instance */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocumentSchema): google.cloud.documentai.v1beta3.DocumentSchema; + public static create(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; /** - * 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 + * 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.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata, 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 + * 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.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DocumentSchema message from the specified reader or buffer. + * 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 DocumentSchema + * @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.DocumentSchema; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; /** - * Decodes a DocumentSchema message from the specified reader or buffer, length delimited. + * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DocumentSchema + * @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.DocumentSchema; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; /** - * Verifies a DocumentSchema message. + * 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 a DocumentSchema message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DocumentSchema + * @returns ImportProcessorVersionMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema; + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; /** - * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. - * @param message DocumentSchema + * 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.DocumentSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DocumentSchema to JSON. + * Converts this ImportProcessorVersionMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DocumentSchema + * 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; } - 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 baseTypes */ - baseTypes?: (string[]|null); - - /** EntityType properties */ - properties?: (google.cloud.documentai.v1beta3.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.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 baseTypes. */ - public baseTypes: string[]; - - /** EntityType properties. */ - public properties: google.cloud.documentai.v1beta3.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.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 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); - } - - /** 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 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); - - /** - * 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 - } - } - } - - /** 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; - } - } - /** Properties of an EvaluationReference. */ interface IEvaluationReference { @@ -37056,7 +38388,8 @@ export namespace google { UNDEPLOYING = 4, CREATING = 5, DELETING = 6, - FAILED = 7 + FAILED = 7, + IMPORTING = 8 } } @@ -37446,6 +38779,499 @@ export namespace google { 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 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|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; + } + + /** 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 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; + } } } } diff --git a/packages/google-cloud-documentai/protos/protos.js b/packages/google-cloud-documentai/protos/protos.js index c90616ef955..712340a4078 100644 --- a/packages/google-cloud-documentai/protos/protos.js +++ b/packages/google-cloud-documentai/protos/protos.js @@ -4674,6 +4674,7 @@ * @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 */ /** @@ -4724,6 +4725,14 @@ */ 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 @@ -4757,6 +4766,8 @@ $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; }; @@ -4809,6 +4820,10 @@ 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; @@ -4868,6 +4883,11 @@ 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; }; @@ -4908,6 +4928,11 @@ 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; }; @@ -4930,6 +4955,7 @@ 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); @@ -4942,6 +4968,8 @@ } 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; }; @@ -5221,6 +5249,542 @@ 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) { + 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(); + 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; })(); @@ -31462,6 +32026,7 @@ case 5: case 6: case 7: + case 8: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -31551,6 +32116,10 @@ case 7: message.state = 7; break; + case "IMPORTING": + case 8: + message.state = 8; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -31894,6 +32463,7 @@ * @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); @@ -31905,6 +32475,7 @@ values[valuesById[5] = "CREATING"] = 5; values[valuesById[6] = "DELETING"] = 6; values[valuesById[7] = "FAILED"] = 7; + values[valuesById[8] = "IMPORTING"] = 8; return values; })(); @@ -57156,41 +57727,29 @@ return Barcode; })(); - v1beta3.Document = (function() { + v1beta3.Dataset = (function() { /** - * Properties of a Document. + * Properties of a Dataset. * @memberof google.cloud.documentai.v1beta3 - * @interface IDocument - * @property {string|null} [uri] Document uri - * @property {Uint8Array|null} [content] Document content - * @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 + * @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 {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 */ /** - * Constructs a new Document. + * Constructs a new Dataset. * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a Document. - * @implements IDocument + * @classdesc Represents a Dataset. + * @implements IDataset * @constructor - * @param {google.cloud.documentai.v1beta3.IDocument=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.IDataset=} [properties] Properties to set */ - function Document(properties) { - this.textStyles = []; - this.pages = []; - this.entities = []; - this.entityRelations = []; - this.textChanges = []; - this.revisions = []; + function Dataset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -57198,261 +57757,170 @@ } /** - * 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 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 + * Dataset gcsManagedConfig. + * @member {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null|undefined} gcsManagedConfig + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Document.prototype.textStyles = $util.emptyArray; + Dataset.prototype.gcsManagedConfig = null; /** - * Document pages. - * @member {Array.} pages - * @memberof google.cloud.documentai.v1beta3.Document + * Dataset documentWarehouseConfig. + * @member {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null|undefined} documentWarehouseConfig + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Document.prototype.pages = $util.emptyArray; + Dataset.prototype.documentWarehouseConfig = null; /** - * Document entities. - * @member {Array.} entities - * @memberof google.cloud.documentai.v1beta3.Document + * Dataset unmanagedDatasetConfig. + * @member {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null|undefined} unmanagedDatasetConfig + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Document.prototype.entities = $util.emptyArray; + Dataset.prototype.unmanagedDatasetConfig = null; /** - * Document entityRelations. - * @member {Array.} entityRelations - * @memberof google.cloud.documentai.v1beta3.Document + * Dataset spannerIndexingConfig. + * @member {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig|null|undefined} spannerIndexingConfig + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Document.prototype.entityRelations = $util.emptyArray; + Dataset.prototype.spannerIndexingConfig = null; /** - * Document textChanges. - * @member {Array.} textChanges - * @memberof google.cloud.documentai.v1beta3.Document + * Dataset name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Document.prototype.textChanges = $util.emptyArray; + Dataset.prototype.name = ""; /** - * Document shardInfo. - * @member {google.cloud.documentai.v1beta3.Document.IShardInfo|null|undefined} shardInfo - * @memberof google.cloud.documentai.v1beta3.Document + * Dataset state. + * @member {google.cloud.documentai.v1beta3.Dataset.State} state + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Document.prototype.shardInfo = null; + Dataset.prototype.state = 0; - /** - * Document error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.error = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Document revisions. - * @member {Array.} revisions - * @memberof google.cloud.documentai.v1beta3.Document + * Dataset storageSource. + * @member {"gcsManagedConfig"|"documentWarehouseConfig"|"unmanagedDatasetConfig"|undefined} storageSource + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Document.prototype.revisions = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Object.defineProperty(Dataset.prototype, "storageSource", { + get: $util.oneOfGetter($oneOfFields = ["gcsManagedConfig", "documentWarehouseConfig", "unmanagedDatasetConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Document source. - * @member {"uri"|"content"|undefined} source - * @memberof google.cloud.documentai.v1beta3.Document + * Dataset indexingSource. + * @member {"spannerIndexingConfig"|undefined} indexingSource + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance */ - Object.defineProperty(Document.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["uri", "content"]), + Object.defineProperty(Dataset.prototype, "indexingSource", { + get: $util.oneOfGetter($oneOfFields = ["spannerIndexingConfig"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new Document instance using the specified properties. + * Creates a new Dataset instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @static - * @param {google.cloud.documentai.v1beta3.IDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document} Document instance + * @param {google.cloud.documentai.v1beta3.IDataset=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset instance */ - Document.create = function create(properties) { - return new Document(properties); + Dataset.create = function create(properties) { + return new Dataset(properties); }; /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.verify|verify} messages. + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. * @function encode - * @memberof google.cloud.documentai.v1beta3.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @static - * @param {google.cloud.documentai.v1beta3.IDocument} message Document message or plain object to encode + * @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 */ - Document.encode = function encode(message, writer) { + Dataset.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.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.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")) + $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.encode(message.unmanagedDatasetConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.verify|verify} messages. + * 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.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @static - * @param {google.cloud.documentai.v1beta3.IDocument} message Document message or plain object to encode + * @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 */ - Document.encodeDelimited = function encodeDelimited(message, writer) { + Dataset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Document message from the specified reader or buffer. + * Decodes a Dataset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document + * @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.Document} Document + * @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 */ - Document.decode = function decode(reader, length) { + Dataset.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document(); + 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(); switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - case 2: { - message.content = reader.bytes(); - break; - } case 3: { - message.mimeType = reader.string(); - break; - } - case 4: { - message.text = reader.string(); + message.gcsManagedConfig = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.decode(reader, reader.uint32()); 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())); + message.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.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())); + message.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.decode(reader, reader.uint32()); break; } - case 9: { - message.shardInfo = $root.google.cloud.documentai.v1beta3.Document.ShardInfo.decode(reader, reader.uint32()); + case 4: { + message.spannerIndexingConfig = $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.decode(reader, reader.uint32()); break; } - case 10: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + case 1: { + message.name = reader.string(); 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())); + case 2: { + message.state = reader.int32(); break; } default: @@ -57464,338 +57932,234 @@ }; /** - * Decodes a Document message from the specified reader or buffer, length delimited. + * Decodes a Dataset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document} Document + * @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 */ - Document.decodeDelimited = function decodeDelimited(reader) { + Dataset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Document message. + * Verifies a Dataset message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document + * @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 */ - Document.verify = function verify(message) { + Dataset.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.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 (message.gcsManagedConfig != null && message.hasOwnProperty("gcsManagedConfig")) { + properties.storageSource = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify(message.gcsManagedConfig); if (error) - return "pages." + error; + return "gcsManagedConfig." + 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 (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 "entities." + error; + return "documentWarehouseConfig." + 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 (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 "entityRelations." + error; + return "unmanagedDatasetConfig." + 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 (message.spannerIndexingConfig != null && message.hasOwnProperty("spannerIndexingConfig")) { + properties.indexingSource = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.verify(message.spannerIndexingConfig); if (error) - return "textChanges." + error; + return "spannerIndexingConfig." + 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.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; } - } return null; }; /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document} Document + * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document) + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset) 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.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]); - } + 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.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.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.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; } return message; }; /** - * Creates a plain object from a Document message. Also converts values to other types if specified. + * Creates a plain object from a Dataset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @static - * @param {google.cloud.documentai.v1beta3.Document} message Document + * @param {google.cloud.documentai.v1beta3.Dataset} message Dataset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Document.toObject = function toObject(message, options) { + Dataset.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 = []; - } if (options.defaults) { - object.mimeType = ""; - object.text = ""; - object.shardInfo = null; - object.error = null; + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; } - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; + 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.source = "uri"; + object.storageSource = "gcsManagedConfig"; } - 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.spannerIndexingConfig != null && message.hasOwnProperty("spannerIndexingConfig")) { + object.spannerIndexingConfig = $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.toObject(message.spannerIndexingConfig, options); if (options.oneofs) - object.source = "content"; + object.indexingSource = "spannerIndexingConfig"; } - 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.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.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.unmanagedDatasetConfig != null && message.hasOwnProperty("unmanagedDatasetConfig")) { + object.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.toObject(message.unmanagedDatasetConfig, options); + if (options.oneofs) + object.storageSource = "unmanagedDatasetConfig"; } return object; }; /** - * Converts this Document to JSON. + * Converts this Dataset to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @instance * @returns {Object.} JSON object */ - Document.prototype.toJSON = function toJSON() { + Dataset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Document + * Gets the default type url for Dataset * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document + * @memberof google.cloud.documentai.v1beta3.Dataset * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset"; }; - Document.ShardInfo = (function() { + Dataset.GCSManagedConfig = (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 + * 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 ShardInfo. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a ShardInfo. - * @implements IShardInfo + * Constructs a new GCSManagedConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @classdesc Represents a GCSManagedConfig. + * @implements IGCSManagedConfig * @constructor - * @param {google.cloud.documentai.v1beta3.Document.IShardInfo=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig=} [properties] Properties to set */ - function ShardInfo(properties) { + function GCSManagedConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -57803,103 +58167,75 @@ } /** - * 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 + * GCSManagedConfig gcsPrefix. + * @member {google.cloud.documentai.v1beta3.IGcsPrefix|null|undefined} gcsPrefix + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @instance */ - ShardInfo.prototype.textOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + GCSManagedConfig.prototype.gcsPrefix = null; /** - * Creates a new ShardInfo instance using the specified properties. + * Creates a new GCSManagedConfig instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IShardInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.ShardInfo} ShardInfo instance + * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig instance */ - ShardInfo.create = function create(properties) { - return new ShardInfo(properties); + GCSManagedConfig.create = function create(properties) { + return new GCSManagedConfig(properties); }; /** - * Encodes the specified ShardInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ShardInfo.verify|verify} messages. + * 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.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IShardInfo} message ShardInfo message or plain object to encode + * @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 */ - ShardInfo.encode = function encode(message, writer) { + GCSManagedConfig.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); + 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 ShardInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ShardInfo.verify|verify} messages. + * 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.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IShardInfo} message ShardInfo message or plain object to encode + * @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 */ - ShardInfo.encodeDelimited = function encodeDelimited(message, writer) { + GCSManagedConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ShardInfo message from the specified reader or buffer. + * Decodes a GCSManagedConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @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.Document.ShardInfo} ShardInfo + * @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 */ - ShardInfo.decode = function decode(reader, length) { + GCSManagedConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.ShardInfo(); + 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(); switch (tag >>> 3) { case 1: { - message.shardIndex = reader.int64(); - break; - } - case 2: { - message.shardCount = reader.int64(); - break; - } - case 3: { - message.textOffset = reader.int64(); + message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.decode(reader, reader.uint32()); break; } default: @@ -57911,188 +58247,128 @@ }; /** - * Decodes a ShardInfo message from the specified reader or buffer, length delimited. + * Decodes a GCSManagedConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.ShardInfo} ShardInfo + * @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 */ - ShardInfo.decodeDelimited = function decodeDelimited(reader) { + GCSManagedConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ShardInfo message. + * Verifies a GCSManagedConfig message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @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 */ - ShardInfo.verify = function verify(message) { + GCSManagedConfig.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"; + 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 ShardInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GCSManagedConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ShardInfo} ShardInfo + * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig */ - ShardInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ShardInfo) + 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.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(); + 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 ShardInfo message. Also converts values to other types if specified. + * Creates a plain object from a GCSManagedConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.ShardInfo} message ShardInfo + * @param {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} message GCSManagedConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ShardInfo.toObject = function toObject(message, options) { + GCSManagedConfig.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; + 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 ShardInfo to JSON. + * Converts this GCSManagedConfig to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @instance * @returns {Object.} JSON object */ - ShardInfo.prototype.toJSON = function toJSON() { + GCSManagedConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ShardInfo + * Gets the default type url for GCSManagedConfig * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ShardInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GCSManagedConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.ShardInfo"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig"; }; - return ShardInfo; + return GCSManagedConfig; })(); - Document.Style = (function() { + Dataset.DocumentWarehouseConfig = (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 + * 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 Style. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a Style. - * @implements IStyle + * Constructs a new DocumentWarehouseConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @classdesc Represents a DocumentWarehouseConfig. + * @implements IDocumentWarehouseConfig * @constructor - * @param {google.cloud.documentai.v1beta3.Document.IStyle=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig=} [properties] Properties to set */ - function Style(properties) { + function DocumentWarehouseConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58100,173 +58376,89 @@ } /** - * 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 + * DocumentWarehouseConfig collection. + * @member {string} collection + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @instance */ - Style.prototype.fontSize = null; + DocumentWarehouseConfig.prototype.collection = ""; /** - * Style fontFamily. - * @member {string} fontFamily - * @memberof google.cloud.documentai.v1beta3.Document.Style + * DocumentWarehouseConfig schema. + * @member {string} schema + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @instance */ - Style.prototype.fontFamily = ""; + DocumentWarehouseConfig.prototype.schema = ""; /** - * Creates a new Style instance using the specified properties. + * Creates a new DocumentWarehouseConfig instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IStyle=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Style} Style instance + * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig instance */ - Style.create = function create(properties) { - return new Style(properties); + DocumentWarehouseConfig.create = function create(properties) { + return new DocumentWarehouseConfig(properties); }; /** - * Encodes the specified Style message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Style.verify|verify} messages. + * 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.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IStyle} message Style message or plain object to encode + * @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 */ - Style.encode = function encode(message, writer) { + DocumentWarehouseConfig.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); + 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 Style message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Style.verify|verify} messages. + * 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.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IStyle} message Style message or plain object to encode + * @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 */ - Style.encodeDelimited = function encodeDelimited(message, writer) { + DocumentWarehouseConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Style message from the specified reader or buffer. + * Decodes a DocumentWarehouseConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @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.Document.Style} Style + * @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 */ - Style.decode = function decode(reader, length) { + DocumentWarehouseConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Style(); + 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(); switch (tag >>> 3) { case 1: { - message.textAnchor = $root.google.cloud.documentai.v1beta3.Document.TextAnchor.decode(reader, reader.uint32()); + message.collection = reader.string(); 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(); + message.schema = reader.string(); break; } default: @@ -58278,453 +58470,130 @@ }; /** - * Decodes a Style message from the specified reader or buffer, length delimited. + * Decodes a DocumentWarehouseConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.Style} Style + * @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 */ - Style.decodeDelimited = function decodeDelimited(reader) { + DocumentWarehouseConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Style message. + * Verifies a DocumentWarehouseConfig message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @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 */ - Style.verify = function verify(message) { + DocumentWarehouseConfig.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"; + 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 Style message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentWarehouseConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Style} Style + * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig */ - Style.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Style) + 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.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); + 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 Style message. Also converts values to other types if specified. + * Creates a plain object from a DocumentWarehouseConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.Style} message Style + * @param {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} message DocumentWarehouseConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Style.toObject = function toObject(message, options) { + DocumentWarehouseConfig.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 = ""; + object.collection = ""; + object.schema = ""; } - 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; + 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 Style to JSON. + * Converts this DocumentWarehouseConfig to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @instance * @returns {Object.} JSON object */ - Style.prototype.toJSON = function toJSON() { + DocumentWarehouseConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Style + * Gets the default type url for DocumentWarehouseConfig * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Style + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Style.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DocumentWarehouseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Style"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig"; }; - 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) { - 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(); - 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; + return DocumentWarehouseConfig; })(); - Document.Page = (function() { + Dataset.UnmanagedDatasetConfig = (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 + * Properties of an UnmanagedDatasetConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @interface IUnmanagedDatasetConfig */ /** - * Constructs a new Page. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a Page. - * @implements IPage + * Constructs a new UnmanagedDatasetConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @classdesc Represents an UnmanagedDatasetConfig. + * @implements IUnmanagedDatasetConfig * @constructor - * @param {google.cloud.documentai.v1beta3.Document.IPage=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig=} [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 = []; + function UnmanagedDatasetConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58732,334 +58601,238 @@ } /** - * Page pageNumber. - * @member {number} pageNumber - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.pageNumber = 0; + UnmanagedDatasetConfig.create = function create(properties) { + return new UnmanagedDatasetConfig(properties); + }; /** - * Page image. - * @member {google.cloud.documentai.v1beta3.Document.Page.IImage|null|undefined} image - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.image = null; + UnmanagedDatasetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; /** - * Page transforms. - * @member {Array.} transforms - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.transforms = $util.emptyArray; + UnmanagedDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Page dimension. - * @member {google.cloud.documentai.v1beta3.Document.Page.IDimension|null|undefined} dimension - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.dimension = null; + UnmanagedDatasetConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Page layout. - * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.layout = null; + UnmanagedDatasetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Page detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.detectedLanguages = $util.emptyArray; + UnmanagedDatasetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * Page blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.blocks = $util.emptyArray; + 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(); + }; /** - * Page paragraphs. - * @member {Array.} paragraphs - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.paragraphs = $util.emptyArray; + UnmanagedDatasetConfig.toObject = function toObject() { + return {}; + }; /** - * Page lines. - * @member {Array.} lines - * @memberof google.cloud.documentai.v1beta3.Document.Page + * Converts this UnmanagedDatasetConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig * @instance + * @returns {Object.} JSON object */ - Page.prototype.lines = $util.emptyArray; + UnmanagedDatasetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Page tokens. - * @member {Array.} tokens - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.tokens = $util.emptyArray; + UnmanagedDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig"; + }; + + return UnmanagedDatasetConfig; + })(); + + Dataset.SpannerIndexingConfig = (function() { /** - * Page visualElements. - * @member {Array.} visualElements - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * Properties of a SpannerIndexingConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @interface ISpannerIndexingConfig */ - Page.prototype.visualElements = $util.emptyArray; /** - * Page tables. - * @member {Array.} tables - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance + * 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 */ - Page.prototype.tables = $util.emptyArray; + 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]]; + } /** - * 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. + * Creates a new SpannerIndexingConfig instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page + * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IPage=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Page} Page instance + * @param {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} SpannerIndexingConfig instance */ - Page.create = function create(properties) { - return new Page(properties); + SpannerIndexingConfig.create = function create(properties) { + return new SpannerIndexingConfig(properties); }; /** - * Encodes the specified Page message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Page.verify|verify} messages. + * 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.Document.Page + * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IPage} message Page message or plain object to encode + * @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 */ - Page.encode = function encode(message, writer) { + SpannerIndexingConfig.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. + * 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.Document.Page + * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.IPage} message Page message or plain object to encode + * @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 */ - Page.encodeDelimited = function encodeDelimited(message, writer) { + SpannerIndexingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Page message from the specified reader or buffer. + * Decodes a SpannerIndexingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Page + * @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.Document.Page} Page + * @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 */ - Page.decode = function decode(reader, length) { + SpannerIndexingConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Page(); + 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(); 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; @@ -59069,2584 +58842,2086 @@ }; /** - * Decodes a Page message from the specified reader or buffer, length delimited. + * Decodes a SpannerIndexingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page + * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.Page} Page + * @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 */ - Page.decodeDelimited = function decodeDelimited(reader) { + SpannerIndexingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Page message. + * Verifies a SpannerIndexingConfig message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Page + * @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 */ - Page.verify = function verify(message) { + SpannerIndexingConfig.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. + * Creates a SpannerIndexingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Page + * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page} Page + * @returns {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} SpannerIndexingConfig */ - Page.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page) + SpannerIndexingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig) 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; + return new $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig(); }; /** - * Creates a plain object from a Page message. Also converts values to other types if specified. + * Creates a plain object from a SpannerIndexingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Page + * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.Page} message Page + * @param {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} message SpannerIndexingConfig * @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 = []; + 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"; } - 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; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig"; }; - /** - * 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); - }; + return SpannerIndexingConfig; + })(); - /** - * 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"; - }; + /** + * 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; + })(); - Page.Dimension = (function() { + return Dataset; + })(); - /** - * 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 - */ + v1beta3.DatasetSchema = (function() { - /** - * 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]]; - } + /** + * 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 + */ - /** - * Dimension width. - * @member {number} width - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @instance - */ - Dimension.prototype.width = 0; + /** + * 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]]; + } - /** - * Dimension height. - * @member {number} height - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @instance - */ - Dimension.prototype.height = 0; + /** + * DatasetSchema name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @instance + */ + DatasetSchema.prototype.name = ""; - /** - * Dimension unit. - * @member {string} unit - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @instance - */ - Dimension.prototype.unit = ""; + /** + * DatasetSchema documentSchema. + * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @instance + */ + DatasetSchema.prototype.documentSchema = null; - /** - * 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); - }; + /** + * 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 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 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(); + 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(); - }; + /** + * 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 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) { - 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(); - 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; - } + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; } - return message; - }; + case 3: { + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); + 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()); - }; + /** + * 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 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; - }; + /** + * 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; + } + 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 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); + } + 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; - }; + /** + * 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; + } + 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); + 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); - }; + /** + * 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 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"; - }; + /** + * 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 Dimension; - })(); + return DatasetSchema; + })(); - Page.Image = (function() { + v1beta3.RawDocument = (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 - */ + /** + * Properties of a RawDocument. + * @memberof google.cloud.documentai.v1beta3 + * @interface IRawDocument + * @property {Uint8Array|null} [content] RawDocument content + * @property {string|null} [mimeType] RawDocument mimeType + */ - /** - * 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 = ""; + /** + * 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]]; + } - /** - * Image width. - * @member {number} width - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @instance - */ - Image.prototype.width = 0; + /** + * RawDocument content. + * @member {Uint8Array} content + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @instance + */ + RawDocument.prototype.content = $util.newBuffer([]); - /** - * Image height. - * @member {number} height - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @instance - */ - Image.prototype.height = 0; + /** + * RawDocument mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @instance + */ + RawDocument.prototype.mimeType = ""; - /** - * 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); - }; + /** + * 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 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 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); + 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(); - }; + /** + * 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 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) { - 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(); - 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; - } + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; } - return message; - }; + case 2: { + message.mimeType = reader.string(); + 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()); - }; + /** + * 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 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; - }; + /** + * 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"; + 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 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); + 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; - }; + /** + * 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 = ""; + } + 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 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); - }; + /** + * 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 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"; - }; + /** + * 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 Image; - })(); + return RawDocument; + })(); - Page.Matrix = (function() { + v1beta3.GcsDocument = (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 - */ + /** + * 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 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]]; - } + /** + * 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]]; + } - /** - * 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; + /** + * GcsDocument gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @instance + */ + GcsDocument.prototype.gcsUri = ""; - /** - * Matrix data. - * @member {Uint8Array} data - * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix - * @instance - */ - Matrix.prototype.data = $util.newBuffer([]); + /** + * GcsDocument mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @instance + */ + GcsDocument.prototype.mimeType = ""; - /** - * 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); - }; + /** + * 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 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 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 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(); - }; + /** + * 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 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) { - 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(); - 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; - } + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + 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()); - }; + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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 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; - }; + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return Matrix; - })(); + /** + * 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"; + }; - Page.Layout = (function() { + return GcsDocument; + })(); - /** - * 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 - */ + v1beta3.GcsDocuments = (function() { - /** - * 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]]; - } + /** + * Properties of a GcsDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGcsDocuments + * @property {Array.|null} [documents] GcsDocuments documents + */ - /** - * 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; + /** + * 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]]; + } - /** - * Layout confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @instance - */ - Layout.prototype.confidence = 0; + /** + * GcsDocuments documents. + * @member {Array.} documents + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @instance + */ + GcsDocuments.prototype.documents = $util.emptyArray; - /** - * Layout boundingPoly. - * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingPoly - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @instance - */ - Layout.prototype.boundingPoly = null; + /** + * 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); + }; - /** - * 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 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 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(); - }; + /** + * 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 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) { - 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(); - 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; - } + /** + * 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) { + 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(); + 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; } - return message; - }; + 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()); - }; + /** + * 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 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; - }; + /** + * 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 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 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 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; - }; + /** + * 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 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); - }; + /** + * 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 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"; - }; + /** + * 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"; + }; - /** - * 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 GcsDocuments; + })(); - return Layout; - })(); + v1beta3.GcsPrefix = (function() { - Page.Block = (function() { + /** + * Properties of a GcsPrefix. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGcsPrefix + * @property {string|null} [gcsUriPrefix] GcsPrefix gcsUriPrefix + */ - /** - * 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 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]]; + } - /** - * 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]]; - } + /** + * GcsPrefix gcsUriPrefix. + * @member {string} gcsUriPrefix + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @instance + */ + GcsPrefix.prototype.gcsUriPrefix = ""; - /** - * 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; + /** + * 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); + }; - /** - * Block detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Block - * @instance - */ - Block.prototype.detectedLanguages = $util.emptyArray; + /** + * 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; + }; - /** - * 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; + /** + * 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(); + }; - /** - * 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); - }; + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.gcsUriPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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(); - }; + /** + * 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; + }; - /** - * 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) { - 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(); - 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; - }; + /** + * 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; + }; - /** - * 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()); - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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"; + }; - /** - * 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; - }; + return GcsPrefix; + })(); - /** - * 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); - }; + v1beta3.BatchDocumentsInputConfig = (function() { - /** - * 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"; - }; + /** + * 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 + */ - return Block; - })(); + /** + * 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]]; + } - Page.Paragraph = (function() { + /** + * BatchDocumentsInputConfig gcsPrefix. + * @member {google.cloud.documentai.v1beta3.IGcsPrefix|null|undefined} gcsPrefix + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @instance + */ + BatchDocumentsInputConfig.prototype.gcsPrefix = null; - /** - * 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 - */ + /** + * BatchDocumentsInputConfig gcsDocuments. + * @member {google.cloud.documentai.v1beta3.IGcsDocuments|null|undefined} gcsDocuments + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @instance + */ + BatchDocumentsInputConfig.prototype.gcsDocuments = null; - /** - * 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]]; - } + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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; + /** + * 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) + }); - /** - * Paragraph detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph - * @instance - */ - Paragraph.prototype.detectedLanguages = $util.emptyArray; + /** + * 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); + }; - /** - * 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; + /** + * 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; + }; - /** - * 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) { - 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(); - 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; - }; + /** + * 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(); + }; - /** - * 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]); - } + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.decode(reader, reader.uint32()); + break; } - 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); + case 2: { + message.gcsDocuments = $root.google.cloud.documentai.v1beta3.GcsDocuments.decode(reader, reader.uint32()); + break; } - return message; - }; + default: + reader.skipType(tag & 7); + break; + } + } + 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; - }; + /** + * 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()); + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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; + }; - return Paragraph; - })(); + /** + * 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; + }; - Page.Line = (function() { + /** + * 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); + }; - /** - * 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 - */ + /** + * 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"; + }; - /** - * 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]]; - } + return BatchDocumentsInputConfig; + })(); - /** - * 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; + v1beta3.DocumentOutputConfig = (function() { - /** - * Line detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Line - * @instance - */ - Line.prototype.detectedLanguages = $util.emptyArray; + /** + * Properties of a DocumentOutputConfig. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocumentOutputConfig + * @property {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null} [gcsOutputConfig] DocumentOutputConfig gcsOutputConfig + */ - /** - * 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; + /** + * 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]]; + } - /** - * 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); - }; + /** + * DocumentOutputConfig gcsOutputConfig. + * @member {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null|undefined} gcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @instance + */ + DocumentOutputConfig.prototype.gcsOutputConfig = null; - /** - * 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; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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(); - }; + /** + * 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) + }); - /** - * 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) { - 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(); - 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()); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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(); + }; - /** - * 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); + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.decode(reader, reader.uint32()); + break; } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - return object; - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * 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()); + }; - /** - * 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"; - }; + /** + * 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; + }; - return Line; - })(); + /** + * 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; + }; - Page.Token = (function() { + /** + * 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; + }; - /** - * 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 - */ + /** + * 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); + }; - /** - * 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]]; - } + /** + * 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"; + }; - /** - * 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; + DocumentOutputConfig.GcsOutputConfig = (function() { - /** - * 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; + /** + * 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 + */ - /** - * Token detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @instance - */ - Token.prototype.detectedLanguages = $util.emptyArray; + /** + * 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]]; + } - /** - * 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; + /** + * GcsOutputConfig gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.gcsUri = ""; - /** - * 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); - }; + /** + * GcsOutputConfig fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.fieldMask = null; - /** - * 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(); - return writer; - }; + /** + * 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; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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) { - 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(); + /** + * 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) { + 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(); + 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) { + 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(); switch (tag >>> 3) { case 1: { - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); + message.pagesPerShard = reader.int32(); 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()); + message.pagesOverlap = reader.int32(); break; } default: @@ -61658,1864 +60933,1786 @@ }; /** - * Decodes a Token message from the specified reader or buffer, length delimited. + * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @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.Document.Page.Token} Token + * @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 */ - Token.decodeDelimited = function decodeDelimited(reader) { + ShardingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Token message. + * Verifies a ShardingConfig message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @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 */ - Token.verify = function verify(message) { + ShardingConfig.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.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 Token message from a plain object. Also converts values to their respective internal types. + * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Token} Token + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig */ - Token.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Token) + 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.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); - } + 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 Token message. Also converts values to other types if specified. + * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.Token} message Token + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} message ShardingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Token.toObject = function toObject(message, options) { + ShardingConfig.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; - } - 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); + object.pagesPerShard = 0; + object.pagesOverlap = 0; } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + 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 Token to JSON. + * Converts this ShardingConfig to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig * @instance * @returns {Object.} JSON object */ - Token.prototype.toJSON = function toJSON() { + ShardingConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Token + * Gets the default type url for ShardingConfig * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @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 */ - Token.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ShardingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.Token"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig"; }; - Token.DetectedBreak = (function() { + return ShardingConfig; + })(); - /** - * 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 - */ + return GcsOutputConfig; + })(); - /** - * 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]]; - } + return DocumentOutputConfig; + })(); - /** - * 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; + v1beta3.OcrConfig = (function() { - /** - * 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); - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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(); - }; + /** + * OcrConfig hints. + * @member {google.cloud.documentai.v1beta3.OcrConfig.IHints|null|undefined} hints + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.hints = null; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * OcrConfig enableNativePdfParsing. + * @member {boolean} enableNativePdfParsing + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.enableNativePdfParsing = false; - /** - * 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()); - }; + /** + * OcrConfig enableImageQualityScores. + * @member {boolean} enableImageQualityScores + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.enableImageQualityScores = false; - /** - * 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; - }; + /** + * OcrConfig advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.advancedOcrOptions = $util.emptyArray; - /** - * 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; - }; + /** + * OcrConfig enableSymbol. + * @member {boolean} enableSymbol + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.enableSymbol = false; - /** - * 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; - }; + /** + * OcrConfig computeStyleInfo. + * @member {boolean} computeStyleInfo + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.computeStyleInfo = false; - /** - * 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); - }; + /** + * 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); + }; - /** - * 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"; - }; + /** + * 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); + return writer; + }; - /** - * 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; - })(); + /** + * 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(); + }; - return DetectedBreak; - })(); + /** + * 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) { + 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(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return Token; - })(); + /** + * 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()); + }; - Page.Symbol = (function() { + /** + * 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"; + return null; + }; - /** - * 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 - */ + /** + * 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); + return message; + }; - /** - * 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]]; - } + /** + * 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; + } + 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; + return object; + }; - /** - * 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; + /** + * 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); + }; - /** - * Symbol detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol - * @instance - */ - Symbol.prototype.detectedLanguages = $util.emptyArray; + /** + * 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"; + }; - /** - * 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); - }; + OcrConfig.Hints = (function() { - /** - * 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; - }; + /** + * Properties of a Hints. + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @interface IHints + * @property {Array.|null} [languageHints] Hints languageHints + */ - /** - * 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(); - }; + /** + * 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]]; + } - /** - * 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) { - 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(); - 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; - }; + /** + * Hints languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @instance + */ + Hints.prototype.languageHints = $util.emptyArray; - /** - * 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()); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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(); + }; - /** - * 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); + /** + * 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) { + 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(); + 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 object; - }; + } + return message; + }; - /** - * 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); - }; + /** + * 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()); + }; - /** - * 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"; - }; + /** + * 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; + }; - return Symbol; - })(); + /** + * 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; + }; - Page.VisualElement = (function() { + /** + * 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; + }; - /** - * 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 - */ + /** + * 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); + }; - /** - * 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]]; + /** + * 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"; + }; - /** - * 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; + return Hints; + })(); - /** - * VisualElement type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.type = ""; + return OcrConfig; + })(); - /** - * VisualElement detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.detectedLanguages = $util.emptyArray; + v1beta3.PropertyMetadata = (function() { - /** - * 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); - }; + /** + * Properties of a PropertyMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IPropertyMetadata + * @property {boolean|null} [inactive] PropertyMetadata inactive + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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(); - }; + /** + * PropertyMetadata inactive. + * @member {boolean} inactive + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @instance + */ + PropertyMetadata.prototype.inactive = false; - /** - * 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) { - 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(); - 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()); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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); + return writer; + }; - /** - * 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; - }; + /** + * 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(); + }; - /** - * 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); + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 3: { + message.inactive = reader.bool(); + break; } - return object; - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * 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()); + }; - /** - * 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"; - }; + /** + * 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"; + return null; + }; - return VisualElement; - })(); + /** + * 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); + return message; + }; - Page.Table = (function() { + /** + * 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; + if (message.inactive != null && message.hasOwnProperty("inactive")) + object.inactive = message.inactive; + return object; + }; - /** - * 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 - */ + /** + * 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); + }; - /** - * 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]]; - } + /** + * 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"; + }; - /** - * 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; + return PropertyMetadata; + })(); - /** - * Table headerRows. - * @member {Array.} headerRows - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.headerRows = $util.emptyArray; + v1beta3.EntityTypeMetadata = (function() { - /** - * Table bodyRows. - * @member {Array.} bodyRows - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.bodyRows = $util.emptyArray; + /** + * Properties of an EntityTypeMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEntityTypeMetadata + * @property {boolean|null} [inactive] EntityTypeMetadata inactive + */ - /** - * Table detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.detectedLanguages = $util.emptyArray; + /** + * 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]]; + } - /** - * 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; + /** + * EntityTypeMetadata inactive. + * @member {boolean} inactive + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @instance + */ + EntityTypeMetadata.prototype.inactive = false; - /** - * 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); - }; + /** + * 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 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 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 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(); - }; + /** + * 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 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) { - 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(); - 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; - } + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 5: { + message.inactive = reader.bool(); + 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()); - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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 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; - }; + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - Table.TableRow = (function() { + /** + * 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"; + }; - /** - * Properties of a TableRow. - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @interface ITableRow - * @property {Array.|null} [cells] TableRow cells - */ + return EntityTypeMetadata; + })(); - /** - * 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]]; - } + v1beta3.DocumentSchema = (function() { - /** - * TableRow cells. - * @member {Array.} cells - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableRow - * @instance - */ - TableRow.prototype.cells = $util.emptyArray; + /** + * 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 + */ - /** - * 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); - }; + /** + * 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]]; + } - /** - * 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; - }; + /** + * DocumentSchema displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.displayName = ""; - /** - * 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(); - }; + /** + * DocumentSchema description. + * @member {string} description + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.description = ""; - /** - * 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) { - 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(); - 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; - }; + /** + * DocumentSchema entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.entityTypes = $util.emptyArray; - /** - * 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()); - }; + /** + * DocumentSchema metadata. + * @member {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null|undefined} metadata + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.metadata = null; - /** - * 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 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); + }; - /** - * 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; - }; + /** + * 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(); + return writer; + }; - /** - * 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; - }; + /** + * 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(); + }; - /** - * 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); - }; + /** + * 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) { + 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(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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"; - }; + /** + * 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()); + }; - return TableRow; - })(); + /** + * 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; + } + return null; + }; - Table.TableCell = (function() { + /** + * 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); + } + return message; + }; - /** - * 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 - */ + /** + * 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; + } + 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); + return object; + }; - /** - * 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]]; - } + /** + * 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); + }; - /** - * 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; + /** + * 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"; + }; - /** - * TableCell rowSpan. - * @member {number} rowSpan - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.rowSpan = 0; + DocumentSchema.EntityType = (function() { - /** - * TableCell colSpan. - * @member {number} colSpan - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.colSpan = 0; + /** + * 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 {Array.|null} [baseTypes] EntityType baseTypes + * @property {Array.|null} [properties] EntityType properties + * @property {google.cloud.documentai.v1beta3.IEntityTypeMetadata|null} [entityTypeMetadata] EntityType entityTypeMetadata + */ - /** - * TableCell detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.detectedLanguages = $util.emptyArray; + /** + * 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]]; + } - /** - * 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); - }; + /** + * 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; - /** - * 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; - }; + /** + * EntityType displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.displayName = ""; - /** - * 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(); - }; + /** + * EntityType name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.name = ""; - /** - * 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) { - 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(); - 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; - }; + /** + * EntityType baseTypes. + * @member {Array.} baseTypes + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.baseTypes = $util.emptyArray; - /** - * 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()); - }; + /** + * EntityType properties. + * @member {Array.} properties + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.properties = $util.emptyArray; - /** - * 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; - }; + /** + * EntityType entityTypeMetadata. + * @member {google.cloud.documentai.v1beta3.IEntityTypeMetadata|null|undefined} entityTypeMetadata + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.entityTypeMetadata = 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; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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; + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 14: { + message.enumValues = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.decode(reader, reader.uint32()); + break; } - 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); + case 13: { + message.displayName = reader.string(); + break; } - return object; - }; + 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.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; + }; - /** - * 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); - }; + /** + * 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()); + }; - /** - * 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"; - }; + /** + * 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.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; + }; - return TableCell; - })(); + /** + * 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.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; + }; - return Table; - })(); + /** + * 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 = ""; + } + 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"; + } + return object; + }; - Page.FormField = (function() { + /** + * 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 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 + * Properties of an EnumValues. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @interface IEnumValues + * @property {Array.|null} [values] EnumValues values */ /** - * Constructs a new FormField. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a FormField. - * @implements IFormField + * Constructs a new EnumValues. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @classdesc Represents an EnumValues. + * @implements IEnumValues * @constructor - * @param {google.cloud.documentai.v1beta3.Document.Page.IFormField=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set */ - function FormField(properties) { - this.nameDetectedLanguages = []; - this.valueDetectedLanguages = []; + function EnumValues(properties) { + this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63523,179 +62720,78 @@ } /** - * 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 + * EnumValues values. + * @member {Array.} values + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues * @instance */ - FormField.prototype.provenance = null; + EnumValues.prototype.values = $util.emptyArray; /** - * Creates a new FormField instance using the specified properties. + * Creates a new EnumValues instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IFormField=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Page.FormField} FormField instance + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues instance */ - FormField.create = function create(properties) { - return new FormField(properties); + EnumValues.create = function create(properties) { + return new EnumValues(properties); }; /** - * Encodes the specified FormField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Page.FormField.verify|verify} messages. + * 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.Document.Page.FormField + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IFormField} message FormField message or plain object to encode + * @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 */ - FormField.encode = function encode(message, writer) { + EnumValues.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(); + 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 FormField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Page.FormField.verify|verify} messages. + * 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.Document.Page.FormField + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IFormField} message FormField message or plain object to encode + * @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 */ - FormField.encodeDelimited = function encodeDelimited(message, writer) { + EnumValues.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FormField message from the specified reader or buffer. + * Decodes an EnumValues message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @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.Document.Page.FormField} FormField + * @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 */ - FormField.decode = function decode(reader, length) { + EnumValues.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Page.FormField(); + 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(); 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()); + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); break; } default: @@ -63707,231 +62803,137 @@ }; /** - * Decodes a FormField message from the specified reader or buffer, length delimited. + * Decodes an EnumValues message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @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.Document.Page.FormField} FormField + * @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 */ - FormField.decodeDelimited = function decodeDelimited(reader) { + EnumValues.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FormField message. + * Verifies an EnumValues message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @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 */ - FormField.verify = function verify(message) { + EnumValues.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; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; } return null; }; /** - * Creates a FormField message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValues message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.FormField} FormField + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues */ - FormField.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.FormField) + 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.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); + 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 a FormField message. Also converts values to other types if specified. + * Creates a plain object from an EnumValues message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.FormField} message FormField + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} message EnumValues * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FormField.toObject = function toObject(message, options) { + EnumValues.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 (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]; } - 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. + * Converts this EnumValues to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues * @instance * @returns {Object.} JSON object */ - FormField.prototype.toJSON = function toJSON() { + EnumValues.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FormField + * Gets the default type url for EnumValues * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @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 */ - FormField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.FormField"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues"; }; - return FormField; + return EnumValues; })(); - Page.DetectedBarcode = (function() { + EntityType.Property = (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 + * Properties of a Property. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [valueType] Property valueType + * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|null} [occurrenceType] Property occurrenceType + * @property {google.cloud.documentai.v1beta3.IPropertyMetadata|null} [propertyMetadata] Property propertyMetadata */ /** - * Constructs a new DetectedBarcode. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a DetectedBarcode. - * @implements IDetectedBarcode + * Constructs a new Property. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @classdesc Represents a Property. + * @implements IProperty * @constructor - * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty=} [properties] Properties to set */ - function DetectedBarcode(properties) { + function Property(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63939,89 +62941,117 @@ } /** - * DetectedBarcode layout. - * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * Property name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @instance */ - DetectedBarcode.prototype.layout = null; + Property.prototype.name = ""; /** - * DetectedBarcode barcode. - * @member {google.cloud.documentai.v1beta3.IBarcode|null|undefined} barcode - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * Property valueType. + * @member {string} valueType + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @instance */ - DetectedBarcode.prototype.barcode = null; + Property.prototype.valueType = ""; /** - * Creates a new DetectedBarcode instance using the specified properties. + * 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 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.Document.Page.DetectedBarcode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode} DetectedBarcode instance + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} Property instance */ - DetectedBarcode.create = function create(properties) { - return new DetectedBarcode(properties); + Property.create = function create(properties) { + return new Property(properties); }; /** - * Encodes the specified DetectedBarcode message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.verify|verify} messages. + * 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.Document.Page.DetectedBarcode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode} message DetectedBarcode message or plain object to encode + * @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 */ - DetectedBarcode.encode = function encode(message, writer) { + Property.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(); + 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(); return writer; }; /** - * Encodes the specified DetectedBarcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.verify|verify} messages. + * 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.Document.Page.DetectedBarcode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode} message DetectedBarcode message or plain object to encode + * @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 */ - DetectedBarcode.encodeDelimited = function encodeDelimited(message, writer) { + Property.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DetectedBarcode message from the specified reader or buffer. + * Decodes a Property message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @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.Document.Page.DetectedBarcode} DetectedBarcode + * @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 */ - DetectedBarcode.decode = function decode(reader, length) { + Property.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode(); + 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(); switch (tag >>> 3) { case 1: { - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.barcode = $root.google.cloud.documentai.v1beta3.Barcode.decode(reader, reader.uint32()); + message.valueType = reader.string(); + break; + } + case 3: { + message.occurrenceType = reader.int32(); + break; + } + case 5: { + message.propertyMetadata = $root.google.cloud.documentai.v1beta3.PropertyMetadata.decode(reader, reader.uint32()); break; } default: @@ -64033,857 +63063,1107 @@ }; /** - * Decodes a DetectedBarcode message from the specified reader or buffer, length delimited. + * Decodes a Property message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @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.Document.Page.DetectedBarcode} DetectedBarcode + * @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 */ - DetectedBarcode.decodeDelimited = function decodeDelimited(reader) { + Property.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DetectedBarcode message. + * Verifies a Property message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @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 */ - DetectedBarcode.verify = function verify(message) { + Property.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 (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.propertyMetadata != null && message.hasOwnProperty("propertyMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.PropertyMetadata.verify(message.propertyMetadata); if (error) - return "barcode." + error; + return "propertyMetadata." + error; } return null; }; /** - * Creates a DetectedBarcode message from a plain object. Also converts values to their respective internal types. + * Creates a Property message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode} DetectedBarcode + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} Property */ - DetectedBarcode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) + 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.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); + var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property(); + if (object.name != null) + message.name = String(object.name); + 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; } - 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); + 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 DetectedBarcode message. Also converts values to other types if specified. + * Creates a plain object from a Property message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode} message DetectedBarcode + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} message Property * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DetectedBarcode.toObject = function toObject(message, options) { + Property.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.layout = null; - object.barcode = null; + object.name = ""; + object.valueType = ""; + object.occurrenceType = options.enums === String ? "OCCURRENCE_TYPE_UNSPECIFIED" : 0; + object.propertyMetadata = 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); + 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); return object; }; /** - * Converts this DetectedBarcode to JSON. + * Converts this Property to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property * @instance * @returns {Object.} JSON object */ - DetectedBarcode.prototype.toJSON = function toJSON() { + Property.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DetectedBarcode + * Gets the default type url for Property * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @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 */ - DetectedBarcode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Property.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property"; }; - 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 + * 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; + })(); - /** - * 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]]; - } + return Property; + })(); - /** - * DetectedLanguage languageCode. - * @member {string} languageCode - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage - * @instance - */ - DetectedLanguage.prototype.languageCode = ""; + return EntityType; + })(); - /** - * DetectedLanguage confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage - * @instance - */ - DetectedLanguage.prototype.confidence = 0; + DocumentSchema.Metadata = (function() { - /** - * 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); - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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(); - }; + /** + * Metadata documentSplitter. + * @member {boolean} documentSplitter + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.documentSplitter = false; - /** - * 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) { - 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(); - 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; - }; + /** + * Metadata documentAllowMultipleLabels. + * @member {boolean} documentAllowMultipleLabels + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.documentAllowMultipleLabels = false; - /** - * 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()); - }; + /** + * Metadata prefixedNamingOnProperties. + * @member {boolean} prefixedNamingOnProperties + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.prefixedNamingOnProperties = false; - /** - * 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; - }; + /** + * Metadata skipNamingValidation. + * @member {boolean} skipNamingValidation + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.skipNamingValidation = false; - /** - * 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 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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); - }; + /** + * 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(); + }; - /** - * 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"; + /** + * 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) { + 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(); + 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 typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage"; - }; + } + return message; + }; - return DetectedLanguage; - })(); + /** + * 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()); + }; - Page.ImageQualityScores = (function() { + /** + * 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; + }; - /** - * 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 - */ + /** + * 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; + }; - /** - * 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]]; + /** + * 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; + }; - /** - * ImageQualityScores qualityScore. - * @member {number} qualityScore - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores - * @instance - */ - ImageQualityScores.prototype.qualityScore = 0; + /** + * 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); + }; - /** - * ImageQualityScores detectedDefects. - * @member {Array.} detectedDefects - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores - * @instance - */ - ImageQualityScores.prototype.detectedDefects = $util.emptyArray; + /** + * 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"; + }; - /** - * 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); - }; + return Metadata; + })(); - /** - * 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; - }; + return DocumentSchema; + })(); - /** - * 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(); - }; + v1beta3.Document = (function() { - /** - * 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) { - 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(); - 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()); - }; + /** + * 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} [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 + */ - /** - * 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; - }; + /** + * 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 = []; + if (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 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; - }; + /** + * Document uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.uri = null; - /** - * 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; - }; + /** + * Document content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.content = null; - /** - * 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); - }; + /** + * Document mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.mimeType = ""; - /** - * 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"; - }; + /** + * Document text. + * @member {string} text + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.text = ""; - ImageQualityScores.DetectedDefect = (function() { + /** + * Document textStyles. + * @member {Array.} textStyles + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.textStyles = $util.emptyArray; - /** - * 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 - */ + /** + * Document pages. + * @member {Array.} pages + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.pages = $util.emptyArray; - /** - * 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]]; - } + /** + * Document entities. + * @member {Array.} entities + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.entities = $util.emptyArray; - /** - * DetectedDefect type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @instance - */ - DetectedDefect.prototype.type = ""; + /** + * Document entityRelations. + * @member {Array.} entityRelations + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.entityRelations = $util.emptyArray; - /** - * DetectedDefect confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @instance - */ - DetectedDefect.prototype.confidence = 0; + /** + * Document textChanges. + * @member {Array.} textChanges + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.textChanges = $util.emptyArray; - /** - * 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); - }; + /** + * Document shardInfo. + * @member {google.cloud.documentai.v1beta3.Document.IShardInfo|null|undefined} shardInfo + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.shardInfo = null; - /** - * 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; - }; + /** + * Document error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.error = null; - /** - * 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(); - }; + /** + * Document revisions. + * @member {Array.} revisions + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.revisions = $util.emptyArray; - /** - * 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) { - 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(); - 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; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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()); - }; + /** + * 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) + }); - /** - * 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 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); + }; - /** - * 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; - }; + /** + * 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(); + return writer; + }; - /** - * 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; - }; + /** + * 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(); + }; - /** - * 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); - }; + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.content = reader.bytes(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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"; - }; + /** + * 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()); + }; - return DetectedDefect; - })(); + /** + * 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.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; + } + } + return null; + }; - return ImageQualityScores; - })(); + /** + * 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.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]); + } + } + return message; + }; - return Page; - })(); + /** + * 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 = []; + } + if (options.defaults) { + object.mimeType = ""; + object.text = ""; + object.shardInfo = null; + object.error = null; + } + 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); + } + return object; + }; - Document.Entity = (function() { + /** + * 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 an Entity. + * Properties of a ShardInfo. * @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 + * @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 Entity. + * Constructs a new ShardInfo. * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents an Entity. - * @implements IEntity + * @classdesc Represents a ShardInfo. + * @implements IShardInfo * @constructor - * @param {google.cloud.documentai.v1beta3.Document.IEntity=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.IShardInfo=} [properties] Properties to set */ - function Entity(properties) { - this.properties = []; + function ShardInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -64891,171 +64171,437 @@ } /** - * Entity textAnchor. - * @member {google.cloud.documentai.v1beta3.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * ShardInfo shardIndex. + * @member {number|Long} shardIndex + * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo * @instance */ - Entity.prototype.textAnchor = null; + ShardInfo.prototype.shardIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Entity type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * ShardInfo shardCount. + * @member {number|Long} shardCount + * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo * @instance */ - Entity.prototype.type = ""; + ShardInfo.prototype.shardCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Entity mentionText. - * @member {string} mentionText - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * ShardInfo textOffset. + * @member {number|Long} textOffset + * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo * @instance */ - Entity.prototype.mentionText = ""; + ShardInfo.prototype.textOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Entity mentionId. - * @member {string} mentionId - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance + * 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 */ - Entity.prototype.mentionId = ""; + ShardInfo.create = function create(properties) { + return new ShardInfo(properties); + }; /** - * Entity confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance + * 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 */ - Entity.prototype.confidence = 0; + 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; + }; /** - * Entity pageAnchor. - * @member {google.cloud.documentai.v1beta3.Document.IPageAnchor|null|undefined} pageAnchor - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance + * 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 */ - Entity.prototype.pageAnchor = null; + ShardInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Entity id. - * @member {string} id - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * 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) { + 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(); + 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 */ - Entity.prototype.id = ""; + ShardInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Entity normalizedValue. - * @member {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null|undefined} normalizedValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * 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 */ - Entity.prototype.normalizedValue = null; + Style.prototype.textAnchor = null; /** - * Entity properties. - * @member {Array.} properties - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * Style color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.documentai.v1beta3.Document.Style * @instance */ - Entity.prototype.properties = $util.emptyArray; + Style.prototype.color = null; /** - * Entity provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * Style backgroundColor. + * @member {google.type.IColor|null|undefined} backgroundColor + * @memberof google.cloud.documentai.v1beta3.Document.Style * @instance */ - Entity.prototype.provenance = null; + Style.prototype.backgroundColor = null; /** - * Entity redacted. - * @member {boolean} redacted - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * Style fontWeight. + * @member {string} fontWeight + * @memberof google.cloud.documentai.v1beta3.Document.Style * @instance */ - Entity.prototype.redacted = false; + Style.prototype.fontWeight = ""; /** - * Creates a new Entity instance using the specified properties. + * 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.Entity + * @memberof google.cloud.documentai.v1beta3.Document.Style * @static - * @param {google.cloud.documentai.v1beta3.Document.IEntity=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Entity} Entity instance + * @param {google.cloud.documentai.v1beta3.Document.IStyle=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Style} Style instance */ - Entity.create = function create(properties) { - return new Entity(properties); + Style.create = function create(properties) { + return new Style(properties); }; /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Entity.verify|verify} messages. + * 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.Entity + * @memberof google.cloud.documentai.v1beta3.Document.Style * @static - * @param {google.cloud.documentai.v1beta3.Document.IEntity} message Entity message or plain object to encode + * @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 */ - Entity.encode = function encode(message, 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.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.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 Entity message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Entity.verify|verify} messages. + * 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.Entity + * @memberof google.cloud.documentai.v1beta3.Document.Style * @static - * @param {google.cloud.documentai.v1beta3.Document.IEntity} message Entity message or plain object to encode + * @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 */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { + Style.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Entity message from the specified reader or buffer. + * Decodes a Style message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @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.Entity} Entity + * @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 */ - Entity.decode = function decode(reader, length) { + Style.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Entity(); + 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(); switch (tag >>> 3) { @@ -65064,45 +64610,31 @@ break; } case 2: { - message.type = reader.string(); + message.color = $root.google.type.Color.decode(reader, reader.uint32()); break; } case 3: { - message.mentionText = reader.string(); + message.backgroundColor = $root.google.type.Color.decode(reader, reader.uint32()); break; } case 4: { - message.mentionId = reader.string(); + message.fontWeight = reader.string(); break; } case 5: { - message.confidence = reader.float(); + message.textStyle = reader.string(); break; } case 6: { - message.pageAnchor = $root.google.cloud.documentai.v1beta3.Document.PageAnchor.decode(reader, reader.uint32()); + message.textDecoration = reader.string(); 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()); + message.fontSize = $root.google.cloud.documentai.v1beta3.Document.Style.FontSize.decode(reader, reader.uint32()); break; } - case 12: { - message.redacted = reader.bool(); + case 8: { + message.fontFamily = reader.string(); break; } default: @@ -65114,30 +64646,30 @@ }; /** - * Decodes an Entity message from the specified reader or buffer, length delimited. + * Decodes a Style message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @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.Entity} Entity + * @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 */ - Entity.decodeDelimited = function decodeDelimited(reader) { + Style.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Entity message. + * Verifies a Style message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @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 */ - Entity.verify = function verify(message) { + Style.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { @@ -65145,214 +64677,166 @@ 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 (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); if (error) - return "pageAnchor." + error; + return "color." + 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 (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) { + var error = $root.google.type.Color.verify(message.backgroundColor); 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; - } + return "backgroundColor." + error; } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1beta3.Document.Provenance.verify(message.provenance); + 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 "provenance." + error; + return "fontSize." + error; } - if (message.redacted != null && message.hasOwnProperty("redacted")) - if (typeof message.redacted !== "boolean") - return "redacted: boolean expected"; + if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) + if (!$util.isString(message.fontFamily)) + return "fontFamily: string expected"; return null; }; /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * Creates a Style message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @memberof google.cloud.documentai.v1beta3.Document.Style * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Entity} Entity + * @returns {google.cloud.documentai.v1beta3.Document.Style} Style */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Entity) + 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.Entity(); + 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.Entity.textAnchor: object expected"); + 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.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.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.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.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.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.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.redacted != null) - message.redacted = Boolean(object.redacted); + if (object.fontFamily != null) + message.fontFamily = String(object.fontFamily); return message; }; /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. + * Creates a plain object from a Style message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @memberof google.cloud.documentai.v1beta3.Document.Style * @static - * @param {google.cloud.documentai.v1beta3.Document.Entity} message Entity + * @param {google.cloud.documentai.v1beta3.Document.Style} message Style * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Entity.toObject = function toObject(message, options) { + Style.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.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.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.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 Entity to JSON. + * Converts this Style to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @memberof google.cloud.documentai.v1beta3.Document.Style * @instance * @returns {Object.} JSON object */ - Entity.prototype.toJSON = function toJSON() { + Style.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Entity + * Gets the default type url for Style * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @memberof google.cloud.documentai.v1beta3.Document.Style * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Style.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Entity"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Style"; }; - Entity.NormalizedValue = (function() { + Style.FontSize = (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 {string|null} [text] NormalizedValue text + * 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 NormalizedValue. - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @classdesc Represents a NormalizedValue. - * @implements INormalizedValue + * Constructs a new FontSize. + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @classdesc Represents a FontSize. + * @implements IFontSize * @constructor - * @param {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.Style.IFontSize=} [properties] Properties to set */ - function NormalizedValue(properties) { + function FontSize(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65360,187 +64844,89 @@ } /** - * 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 text. - * @member {string} text - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * FontSize size. + * @member {number} size + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @instance */ - NormalizedValue.prototype.text = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + FontSize.prototype.size = 0; /** - * NormalizedValue structuredValue. - * @member {"moneyValue"|"dateValue"|"datetimeValue"|"addressValue"|"booleanValue"|"integerValue"|"floatValue"|undefined} structuredValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * FontSize unit. + * @member {string} unit + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @instance */ - Object.defineProperty(NormalizedValue.prototype, "structuredValue", { - get: $util.oneOfGetter($oneOfFields = ["moneyValue", "dateValue", "datetimeValue", "addressValue", "booleanValue", "integerValue", "floatValue"]), - set: $util.oneOfSetter($oneOfFields) - }); + FontSize.prototype.unit = ""; /** - * Creates a new NormalizedValue instance using the specified properties. + * Creates a new FontSize instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @static - * @param {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue} NormalizedValue instance + * @param {google.cloud.documentai.v1beta3.Document.Style.IFontSize=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Style.FontSize} FontSize instance */ - NormalizedValue.create = function create(properties) { - return new NormalizedValue(properties); + FontSize.create = function create(properties) { + return new FontSize(properties); }; /** - * Encodes the specified NormalizedValue message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.verify|verify} messages. + * 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.Entity.NormalizedValue + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @static - * @param {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue} message NormalizedValue message or plain object to encode + * @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 */ - NormalizedValue.encode = function encode(message, writer) { + FontSize.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.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 NormalizedValue message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.verify|verify} messages. + * 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.Entity.NormalizedValue + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @static - * @param {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue} message NormalizedValue message or plain object to encode + * @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 */ - NormalizedValue.encodeDelimited = function encodeDelimited(message, writer) { + FontSize.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NormalizedValue message from the specified reader or buffer. + * Decodes a FontSize message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @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.Entity.NormalizedValue} NormalizedValue + * @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 */ - NormalizedValue.decode = function decode(reader, length) { + FontSize.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue(); + 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(); 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(); + case 1: { + message.size = reader.float(); break; } - case 1: { - message.text = reader.string(); + case 2: { + message.unit = reader.string(); break; } default: @@ -65552,248 +64938,161 @@ }; /** - * Decodes a NormalizedValue message from the specified reader or buffer, length delimited. + * Decodes a FontSize message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @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.Entity.NormalizedValue} NormalizedValue + * @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 */ - NormalizedValue.decodeDelimited = function decodeDelimited(reader) { + FontSize.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NormalizedValue message. + * Verifies a FontSize message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @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 */ - NormalizedValue.verify = function verify(message) { + FontSize.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.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string 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 NormalizedValue message from a plain object. Also converts values to their respective internal types. + * Creates a FontSize message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue} NormalizedValue + * @returns {google.cloud.documentai.v1beta3.Document.Style.FontSize} FontSize */ - NormalizedValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue) + 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.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.text != null) - message.text = String(object.text); + 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 NormalizedValue message. Also converts values to other types if specified. + * Creates a plain object from a FontSize message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @static - * @param {google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue} message NormalizedValue + * @param {google.cloud.documentai.v1beta3.Document.Style.FontSize} message FontSize * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NormalizedValue.toObject = function toObject(message, options) { + FontSize.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 (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 NormalizedValue to JSON. + * Converts this FontSize to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize * @instance * @returns {Object.} JSON object */ - NormalizedValue.prototype.toJSON = function toJSON() { + FontSize.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NormalizedValue + * Gets the default type url for FontSize * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @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 */ - NormalizedValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FontSize.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Style.FontSize"; }; - return NormalizedValue; + return FontSize; })(); - return Entity; + return Style; })(); - Document.EntityRelation = (function() { + Document.Page = (function() { /** - * Properties of an EntityRelation. + * Properties of a Page. * @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 + * @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 EntityRelation. + * Constructs a new Page. * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents an EntityRelation. - * @implements IEntityRelation + * @classdesc Represents a Page. + * @implements IPage * @constructor - * @param {google.cloud.documentai.v1beta3.Document.IEntityRelation=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.IPage=} [properties] Properties to set */ - function EntityRelation(properties) { + 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) @@ -65801,342 +65100,332 @@ } /** - * EntityRelation subjectId. - * @member {string} subjectId - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * Page pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.documentai.v1beta3.Document.Page * @instance */ - EntityRelation.prototype.subjectId = ""; + Page.prototype.pageNumber = 0; /** - * EntityRelation objectId. - * @member {string} objectId - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * Page image. + * @member {google.cloud.documentai.v1beta3.Document.Page.IImage|null|undefined} image + * @memberof google.cloud.documentai.v1beta3.Document.Page * @instance */ - EntityRelation.prototype.objectId = ""; + Page.prototype.image = null; /** - * EntityRelation relation. - * @member {string} relation - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * Page transforms. + * @member {Array.} transforms + * @memberof google.cloud.documentai.v1beta3.Document.Page * @instance */ - EntityRelation.prototype.relation = ""; + Page.prototype.transforms = $util.emptyArray; /** - * 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 + * Page dimension. + * @member {google.cloud.documentai.v1beta3.Document.Page.IDimension|null|undefined} dimension + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - EntityRelation.create = function create(properties) { - return new EntityRelation(properties); - }; + Page.prototype.dimension = null; /** - * 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 + * Page layout. + * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - 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; - }; + Page.prototype.layout = null; /** - * 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 + * Page detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - EntityRelation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Page.prototype.detectedLanguages = $util.emptyArray; /** - * 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 + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - EntityRelation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.EntityRelation(); - while (reader.pos < end) { - var tag = reader.uint32(); - 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; - }; + Page.prototype.blocks = $util.emptyArray; /** - * 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 + * Page paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - EntityRelation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Page.prototype.paragraphs = $util.emptyArray; /** - * 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 + * Page lines. + * @member {Array.} lines + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - 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; - }; + Page.prototype.lines = $util.emptyArray; /** - * 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 + * Page tokens. + * @member {Array.} tokens + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - 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; - }; + Page.prototype.tokens = $util.emptyArray; /** - * 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 + * Page visualElements. + * @member {Array.} visualElements + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - 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; - }; + Page.prototype.visualElements = $util.emptyArray; /** - * Converts this EntityRelation to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * Page tables. + * @member {Array.} tables + * @memberof google.cloud.documentai.v1beta3.Document.Page * @instance - * @returns {Object.} JSON object */ - EntityRelation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Page.prototype.tables = $util.emptyArray; /** - * 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 + * Page formFields. + * @member {Array.} formFields + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - 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() { + Page.prototype.formFields = $util.emptyArray; /** - * Properties of a TextAnchor. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface ITextAnchor - * @property {Array.|null} [textSegments] TextAnchor textSegments - * @property {string|null} [content] TextAnchor content + * Page symbols. + * @member {Array.} symbols + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ + Page.prototype.symbols = $util.emptyArray; /** - * 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 + * Page detectedBarcodes. + * @member {Array.} detectedBarcodes + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance */ - 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]]; - } + Page.prototype.detectedBarcodes = $util.emptyArray; /** - * TextAnchor textSegments. - * @member {Array.} textSegments - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * Page imageQualityScores. + * @member {google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null|undefined} imageQualityScores + * @memberof google.cloud.documentai.v1beta3.Document.Page * @instance */ - TextAnchor.prototype.textSegments = $util.emptyArray; + Page.prototype.imageQualityScores = null; /** - * TextAnchor content. - * @member {string} content - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * Page provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page * @instance */ - TextAnchor.prototype.content = ""; + Page.prototype.provenance = null; /** - * Creates a new TextAnchor instance using the specified properties. + * Creates a new Page instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page * @static - * @param {google.cloud.documentai.v1beta3.Document.ITextAnchor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor} TextAnchor instance + * @param {google.cloud.documentai.v1beta3.Document.IPage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Page} Page instance */ - TextAnchor.create = function create(properties) { - return new TextAnchor(properties); + Page.create = function create(properties) { + return new Page(properties); }; /** - * Encodes the specified TextAnchor message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.TextAnchor.verify|verify} messages. + * 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.TextAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page * @static - * @param {google.cloud.documentai.v1beta3.Document.ITextAnchor} message TextAnchor message or plain object to encode + * @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 */ - TextAnchor.encode = function encode(message, writer) { + Page.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); + 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 TextAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.TextAnchor.verify|verify} messages. + * 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.TextAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page * @static - * @param {google.cloud.documentai.v1beta3.Document.ITextAnchor} message TextAnchor message or plain object to encode + * @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 */ - TextAnchor.encodeDelimited = function encodeDelimited(message, writer) { + Page.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TextAnchor message from the specified reader or buffer. + * Decodes a Page message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @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.TextAnchor} TextAnchor + * @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 */ - TextAnchor.decode = function decode(reader, length) { + Page.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.TextAnchor(); + 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(); 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())); + 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.content = reader.string(); + 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: @@ -66148,146 +65437,464 @@ }; /** - * Decodes a TextAnchor message from the specified reader or buffer, length delimited. + * Decodes a Page message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @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.TextAnchor} TextAnchor + * @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 */ - TextAnchor.decodeDelimited = function decodeDelimited(reader) { + Page.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TextAnchor message. + * Verifies a Page message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @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 */ - TextAnchor.verify = function verify(message) { + Page.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 (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 "textSegments." + error; + return "transforms." + error; } } - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; + 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 TextAnchor message from a plain object. Also converts values to their respective internal types. + * Creates a Page message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor} TextAnchor + * @returns {google.cloud.documentai.v1beta3.Document.Page} Page */ - TextAnchor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextAnchor) + 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.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]); + 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.content != null) - message.content = String(object.content); + 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 TextAnchor message. Also converts values to other types if specified. + * Creates a plain object from a Page message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page * @static - * @param {google.cloud.documentai.v1beta3.Document.TextAnchor} message TextAnchor + * @param {google.cloud.documentai.v1beta3.Document.Page} message Page * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TextAnchor.toObject = function toObject(message, options) { + Page.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 (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 (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; + 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 TextAnchor to JSON. + * Converts this Page to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page * @instance * @returns {Object.} JSON object */ - TextAnchor.prototype.toJSON = function toJSON() { + Page.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TextAnchor + * Gets the default type url for Page * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TextAnchor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Page.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.TextAnchor"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page"; }; - TextAnchor.TextSegment = (function() { + Page.Dimension = (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 + * 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 TextSegment. - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor - * @classdesc Represents a TextSegment. - * @implements ITextSegment + * Constructs a new Dimension. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Dimension. + * @implements IDimension * @constructor - * @param {google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.Page.IDimension=} [properties] Properties to set */ - function TextSegment(properties) { + function Dimension(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66295,89 +65902,103 @@ } /** - * TextSegment startIndex. - * @member {number|Long} startIndex - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * Dimension width. + * @member {number} width + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @instance */ - TextSegment.prototype.startIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Dimension.prototype.width = 0; /** - * TextSegment endIndex. - * @member {number|Long} endIndex - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * Dimension height. + * @member {number} height + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @instance */ - TextSegment.prototype.endIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Dimension.prototype.height = 0; /** - * Creates a new TextSegment instance using the specified properties. + * 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.TextAnchor.TextSegment + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @static - * @param {google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment} TextSegment instance + * @param {google.cloud.documentai.v1beta3.Document.Page.IDimension=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Page.Dimension} Dimension instance */ - TextSegment.create = function create(properties) { - return new TextSegment(properties); + Dimension.create = function create(properties) { + return new Dimension(properties); }; /** - * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment.verify|verify} messages. + * 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.TextAnchor.TextSegment + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @static - * @param {google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment} message TextSegment message or plain object to encode + * @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 */ - TextSegment.encode = function encode(message, writer) { + Dimension.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); + 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 TextSegment message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment.verify|verify} messages. + * 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.TextAnchor.TextSegment + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @static - * @param {google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment} message TextSegment message or plain object to encode + * @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 */ - TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + Dimension.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TextSegment message from the specified reader or buffer. + * Decodes a Dimension message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @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.TextAnchor.TextSegment} TextSegment + * @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 */ - TextSegment.decode = function decode(reader, length) { + Dimension.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment(); + 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(); switch (tag >>> 3) { case 1: { - message.startIndex = reader.int64(); + message.width = reader.float(); break; } case 2: { - message.endIndex = reader.int64(); + message.height = reader.float(); + break; + } + case 3: { + message.unit = reader.string(); break; } default: @@ -66389,387 +66010,142 @@ }; /** - * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * Decodes a Dimension message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @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.TextAnchor.TextSegment} TextSegment + * @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 */ - TextSegment.decodeDelimited = function decodeDelimited(reader) { + Dimension.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TextSegment message. + * Verifies a Dimension message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @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 */ - TextSegment.verify = function verify(message) { + Dimension.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"; + 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 TextSegment message from a plain object. Also converts values to their respective internal types. + * Creates a Dimension message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment} TextSegment + * @returns {google.cloud.documentai.v1beta3.Document.Page.Dimension} Dimension */ - TextSegment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment) + 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.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(); + 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 TextSegment message. Also converts values to other types if specified. + * Creates a plain object from a Dimension message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @static - * @param {google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment} message TextSegment + * @param {google.cloud.documentai.v1beta3.Document.Page.Dimension} message Dimension * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TextSegment.toObject = function toObject(message, options) { + Dimension.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; + object.width = 0; + object.height = 0; + object.unit = ""; } - 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; + 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 TextSegment to JSON. + * Converts this Dimension to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension * @instance * @returns {Object.} JSON object */ - TextSegment.prototype.toJSON = function toJSON() { + Dimension.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TextSegment + * Gets the default type url for Dimension * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @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 */ - TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Dimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.Dimension"; }; - return TextSegment; + return Dimension; })(); - 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) { - 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(); - 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() { + Page.Image = (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 + * 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 PageRef. - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor - * @classdesc Represents a PageRef. - * @implements IPageRef + * Constructs a new Image. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents an Image. + * @implements IImage * @constructor - * @param {google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.Page.IImage=} [properties] Properties to set */ - function PageRef(properties) { + function Image(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66777,131 +66153,117 @@ } /** - * 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 + * Image content. + * @member {Uint8Array} content + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @instance */ - PageRef.prototype.layoutType = 0; + Image.prototype.content = $util.newBuffer([]); /** - * PageRef layoutId. - * @member {string} layoutId - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * Image mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @instance */ - PageRef.prototype.layoutId = ""; + Image.prototype.mimeType = ""; /** - * PageRef boundingPoly. - * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingPoly - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * Image width. + * @member {number} width + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @instance */ - PageRef.prototype.boundingPoly = null; + Image.prototype.width = 0; /** - * PageRef confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * Image height. + * @member {number} height + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @instance */ - PageRef.prototype.confidence = 0; + Image.prototype.height = 0; /** - * Creates a new PageRef instance using the specified properties. + * Creates a new Image instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @static - * @param {google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef} PageRef instance + * @param {google.cloud.documentai.v1beta3.Document.Page.IImage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Page.Image} Image instance */ - PageRef.create = function create(properties) { - return new PageRef(properties); + Image.create = function create(properties) { + return new Image(properties); }; /** - * Encodes the specified PageRef message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.verify|verify} messages. + * 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.PageAnchor.PageRef + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @static - * @param {google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef} message PageRef message or plain object to encode + * @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 */ - PageRef.encode = function encode(message, writer) { + Image.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); + 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 PageRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.verify|verify} messages. + * 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.PageAnchor.PageRef + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @static - * @param {google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef} message PageRef message or plain object to encode + * @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 */ - PageRef.encodeDelimited = function encodeDelimited(message, writer) { + Image.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PageRef message from the specified reader or buffer. + * Decodes an Image message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @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.PageAnchor.PageRef} PageRef + * @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 */ - PageRef.decode = function decode(reader, length) { + Image.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef(); + 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(); switch (tag >>> 3) { case 1: { - message.page = reader.int64(); + message.content = reader.bytes(); break; } case 2: { - message.layoutType = reader.int32(); + message.mimeType = reader.string(); break; } case 3: { - message.layoutId = reader.string(); + message.width = reader.int32(); break; } case 4: { - message.boundingPoly = $root.google.cloud.documentai.v1beta3.BoundingPoly.decode(reader, reader.uint32()); - break; - } - case 5: { - message.confidence = reader.float(); + message.height = reader.int32(); break; } default: @@ -66913,595 +66275,441 @@ }; /** - * Decodes a PageRef message from the specified reader or buffer, length delimited. + * Decodes an Image message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @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.PageAnchor.PageRef} PageRef + * @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 */ - PageRef.decodeDelimited = function decodeDelimited(reader) { + Image.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PageRef message. + * Verifies an Image message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @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 */ - PageRef.verify = function verify(message) { + Image.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"; + 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 a PageRef message from a plain object. Also converts values to their respective internal types. + * Creates an Image message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef} PageRef + * @returns {google.cloud.documentai.v1beta3.Document.Page.Image} Image */ - PageRef.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef) + 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.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); + 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 a PageRef message. Also converts values to other types if specified. + * Creates a plain object from an Image message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @static - * @param {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef} message PageRef + * @param {google.cloud.documentai.v1beta3.Document.Page.Image} message Image * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PageRef.toObject = function toObject(message, options) { + Image.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 (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.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; + 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 PageRef to JSON. + * Converts this Image to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image * @instance * @returns {Object.} JSON object */ - PageRef.prototype.toJSON = function toJSON() { + Image.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PageRef + * Gets the default type url for Image * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @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 */ - PageRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.Image"; }; - /** - * 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 Image; })(); - return PageAnchor; - })(); - - Document.Provenance = (function() { + Page.Matrix = (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 - */ + /** + * 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 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]]; - } + /** + * 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]]; + } - /** - * Provenance revision. - * @member {number} revision - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @instance - */ - Provenance.prototype.revision = 0; + /** + * Matrix rows. + * @member {number} rows + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @instance + */ + Matrix.prototype.rows = 0; - /** - * Provenance id. - * @member {number} id - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @instance - */ - Provenance.prototype.id = 0; + /** + * Matrix cols. + * @member {number} cols + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @instance + */ + Matrix.prototype.cols = 0; - /** - * Provenance parents. - * @member {Array.} parents - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @instance - */ - Provenance.prototype.parents = $util.emptyArray; + /** + * Matrix type. + * @member {number} type + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @instance + */ + Matrix.prototype.type = 0; - /** - * Provenance type. - * @member {google.cloud.documentai.v1beta3.Document.Provenance.OperationType} type - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @instance - */ - Provenance.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 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); - }; + /** + * 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 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 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 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(); - }; + /** + * 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 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) { - 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(); - 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(); + /** + * 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) { + 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(); + 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; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + 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()); - }; + /** + * 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 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; - }; + /** + * 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 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; + /** + * 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); + } } - 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; - }; + 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; + }; - /** - * 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 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); + }; - /** - * 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 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"; + }; - /** - * 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"; - }; + return Matrix; + })(); - Provenance.Parent = (function() { + Page.Layout = (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 + * 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 Parent. - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @classdesc Represents a Parent. - * @implements IParent + * Constructs a new Layout. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Layout. + * @implements ILayout * @constructor - * @param {google.cloud.documentai.v1beta3.Document.Provenance.IParent=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.Page.ILayout=} [properties] Properties to set */ - function Parent(properties) { + function Layout(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67509,103 +66717,117 @@ } /** - * Parent revision. - * @member {number} revision - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * Layout textAnchor. + * @member {google.cloud.documentai.v1beta3.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @instance */ - Parent.prototype.revision = 0; + Layout.prototype.textAnchor = null; /** - * Parent index. - * @member {number} index - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * Layout confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @instance */ - Parent.prototype.index = 0; + Layout.prototype.confidence = 0; /** - * Parent id. - * @member {number} id - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * Layout boundingPoly. + * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @instance */ - Parent.prototype.id = 0; + Layout.prototype.boundingPoly = null; /** - * Creates a new Parent instance using the specified properties. + * 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.Provenance.Parent + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @static - * @param {google.cloud.documentai.v1beta3.Document.Provenance.IParent=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Provenance.Parent} Parent instance + * @param {google.cloud.documentai.v1beta3.Document.Page.ILayout=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Page.Layout} Layout instance */ - Parent.create = function create(properties) { - return new Parent(properties); + Layout.create = function create(properties) { + return new Layout(properties); }; /** - * Encodes the specified Parent message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Provenance.Parent.verify|verify} messages. + * 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.Provenance.Parent + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @static - * @param {google.cloud.documentai.v1beta3.Document.Provenance.IParent} message Parent message or plain object to encode + * @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 */ - Parent.encode = function encode(message, writer) { + Layout.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); + 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 Parent message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Provenance.Parent.verify|verify} messages. + * 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.Provenance.Parent + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @static - * @param {google.cloud.documentai.v1beta3.Document.Provenance.IParent} message Parent message or plain object to encode + * @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 */ - Parent.encodeDelimited = function encodeDelimited(message, writer) { + Layout.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Parent message from the specified reader or buffer. + * Decodes a Layout message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @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.Provenance.Parent} Parent + * @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 */ - Parent.decode = function decode(reader, length) { + Layout.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Provenance.Parent(); + 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(); switch (tag >>> 3) { case 1: { - message.revision = reader.int32(); + message.textAnchor = $root.google.cloud.documentai.v1beta3.Document.TextAnchor.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); break; } case 3: { - message.index = reader.int32(); + message.boundingPoly = $root.google.cloud.documentai.v1beta3.BoundingPoly.decode(reader, reader.uint32()); break; } - case 2: { - message.id = reader.int32(); + case 4: { + message.orientation = reader.int32(); break; } default: @@ -67617,585 +66839,496 @@ }; /** - * Decodes a Parent message from the specified reader or buffer, length delimited. + * Decodes a Layout message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @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.Provenance.Parent} Parent + * @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 */ - Parent.decodeDelimited = function decodeDelimited(reader) { + Layout.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Parent message. + * Verifies a Layout message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @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 */ - Parent.verify = function verify(message) { + Layout.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"; + 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 Parent message from a plain object. Also converts values to their respective internal types. + * Creates a Layout message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Provenance.Parent} Parent + * @returns {google.cloud.documentai.v1beta3.Document.Page.Layout} Layout */ - Parent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Provenance.Parent) + 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.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; + 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 Parent message. Also converts values to other types if specified. + * Creates a plain object from a Layout message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @static - * @param {google.cloud.documentai.v1beta3.Document.Provenance.Parent} message Parent + * @param {google.cloud.documentai.v1beta3.Document.Page.Layout} message Layout * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Parent.toObject = function toObject(message, options) { + Layout.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; + 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 Parent to JSON. + * Converts this Layout to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout * @instance * @returns {Object.} JSON object */ - Parent.prototype.toJSON = function toJSON() { + Layout.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Parent + * Gets the default type url for Layout * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @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 */ - Parent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Layout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Provenance.Parent"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.Layout"; }; - return Parent; - })(); + /** + * 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; + })(); - /** - * 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 Layout; })(); - return Provenance; - })(); + Page.Block = (function() { - Document.Revision = (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 + */ - /** - * 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 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]]; + } - /** - * 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]]; - } + /** + * 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; - /** - * Revision agent. - * @member {string|null|undefined} agent - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.agent = null; + /** + * Block detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Block + * @instance + */ + Block.prototype.detectedLanguages = $util.emptyArray; - /** - * Revision processor. - * @member {string|null|undefined} processor - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.processor = null; + /** + * 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; - /** - * Revision id. - * @member {string} id - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.id = ""; + /** + * 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); + }; - /** - * Revision parent. - * @member {Array.} parent - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.parent = $util.emptyArray; + /** + * 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; + }; - /** - * Revision parentIds. - * @member {Array.} parentIds - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.parentIds = $util.emptyArray; + /** + * 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(); + }; - /** - * Revision createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.createTime = null; + /** + * 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) { + 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(); + 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; + }; - /** - * 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; + /** + * 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()); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * 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; + }; - /** - * 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 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 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); - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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); + }; - /** - * 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(); - }; + /** + * 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"; + }; - /** - * 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) { - 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(); - 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"; - }; + return Block; + })(); - Revision.HumanReview = (function() { + Page.Paragraph = (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 + * 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 HumanReview. - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @classdesc Represents a HumanReview. - * @implements IHumanReview + * Constructs a new Paragraph. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Paragraph. + * @implements IParagraph * @constructor - * @param {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.Page.IParagraph=} [properties] Properties to set */ - function HumanReview(properties) { + function Paragraph(properties) { + this.detectedLanguages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68203,89 +67336,106 @@ } /** - * HumanReview state. - * @member {string} state - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * Paragraph layout. + * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @instance */ - HumanReview.prototype.state = ""; + Paragraph.prototype.layout = null; /** - * HumanReview stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * Paragraph detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @instance */ - HumanReview.prototype.stateMessage = ""; + Paragraph.prototype.detectedLanguages = $util.emptyArray; /** - * Creates a new HumanReview instance using the specified properties. + * 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.Revision.HumanReview + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @static - * @param {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Revision.HumanReview} HumanReview instance + * @param {google.cloud.documentai.v1beta3.Document.Page.IParagraph=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Page.Paragraph} Paragraph instance */ - HumanReview.create = function create(properties) { - return new HumanReview(properties); + Paragraph.create = function create(properties) { + return new Paragraph(properties); }; /** - * Encodes the specified HumanReview message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Revision.HumanReview.verify|verify} messages. + * 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.Revision.HumanReview + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @static - * @param {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview} message HumanReview message or plain object to encode + * @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 */ - HumanReview.encode = function encode(message, writer) { + Paragraph.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); + 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 HumanReview message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Revision.HumanReview.verify|verify} messages. + * 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.Revision.HumanReview + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @static - * @param {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview} message HumanReview message or plain object to encode + * @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 */ - HumanReview.encodeDelimited = function encodeDelimited(message, writer) { + Paragraph.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HumanReview message from the specified reader or buffer. + * Decodes a Paragraph message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @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.Revision.HumanReview} HumanReview + * @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 */ - HumanReview.decode = function decode(reader, length) { + Paragraph.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Document.Revision.HumanReview(); + 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(); switch (tag >>> 3) { case 1: { - message.state = reader.string(); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); break; } case 2: { - message.stateMessage = reader.string(); + 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: @@ -68297,2515 +67447,7919 @@ }; /** - * Decodes a HumanReview message from the specified reader or buffer, length delimited. + * Decodes a Paragraph message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @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.Revision.HumanReview} HumanReview + * @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 */ - HumanReview.decodeDelimited = function decodeDelimited(reader) { + Paragraph.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HumanReview message. + * Verifies a Paragraph message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @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 */ - HumanReview.verify = function verify(message) { + Paragraph.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"; + 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 HumanReview message from a plain object. Also converts values to their respective internal types. + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Revision.HumanReview} HumanReview + * @returns {google.cloud.documentai.v1beta3.Document.Page.Paragraph} Paragraph */ - HumanReview.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Revision.HumanReview) + 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.Revision.HumanReview(); - if (object.state != null) - message.state = String(object.state); - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); + 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 HumanReview message. Also converts values to other types if specified. + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @static - * @param {google.cloud.documentai.v1beta3.Document.Revision.HumanReview} message HumanReview + * @param {google.cloud.documentai.v1beta3.Document.Page.Paragraph} message Paragraph * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HumanReview.toObject = function toObject(message, options) { + Paragraph.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; if (options.defaults) { - object.state = ""; - object.stateMessage = ""; + object.layout = null; + object.provenance = null; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; + 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 HumanReview to JSON. + * Converts this Paragraph to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph * @instance * @returns {Object.} JSON object */ - HumanReview.prototype.toJSON = function toJSON() { + Paragraph.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for HumanReview + * Gets the default type url for Paragraph * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @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 */ - HumanReview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Paragraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Revision.HumanReview"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.Paragraph"; }; - return HumanReview; + return Paragraph; })(); - return Revision; - })(); - - Document.TextChange = (function() { + Page.Line = (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 - */ + /** + * 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 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]]; - } + /** + * 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]]; + } - /** - * TextChange textAnchor. - * @member {google.cloud.documentai.v1beta3.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @instance - */ - TextChange.prototype.textAnchor = null; + /** + * 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; - /** - * TextChange changedText. - * @member {string} changedText - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @instance - */ - TextChange.prototype.changedText = ""; + /** + * Line detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Line + * @instance + */ + Line.prototype.detectedLanguages = $util.emptyArray; - /** - * TextChange provenance. - * @member {Array.} provenance - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @instance - */ - TextChange.prototype.provenance = $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 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); - }; + /** + * 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 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 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 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(); - }; + /** + * 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 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) { - 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(); - 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())); + /** + * 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) { + 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(); + 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; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + 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()); - }; + /** + * 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 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]); + /** + * 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; - }; + 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) + /** + * 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; - 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]); + }; + + /** + * 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 message; - }; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.Line"; + }; - /** - * 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; - }; + return Line; + })(); - /** - * 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); - }; + Page.Token = (function() { - /** - * 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"; + /** + * 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]]; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.TextChange"; - }; - return TextChange; - })(); + /** + * 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; - return Document; - })(); + /** + * 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; - v1beta3.Vertex = (function() { + /** + * Token detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @instance + */ + Token.prototype.detectedLanguages = $util.emptyArray; - /** - * Properties of a Vertex. - * @memberof google.cloud.documentai.v1beta3 - * @interface IVertex - * @property {number|null} [x] Vertex x - * @property {number|null} [y] Vertex y - */ + /** + * 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; - /** - * 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]]; - } + /** + * 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; - /** - * Vertex x. - * @member {number} x - * @memberof google.cloud.documentai.v1beta3.Vertex - * @instance - */ - Vertex.prototype.x = 0; + /** + * 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); + }; - /** - * Vertex y. - * @member {number} y - * @memberof google.cloud.documentai.v1beta3.Vertex - * @instance - */ - Vertex.prototype.y = 0; + /** + * 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; + }; - /** - * 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 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(); + }; - /** - * 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; - }; + /** + * 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) { + 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(); + 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; + }; - /** - * 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 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()); + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.x = reader.int32(); - break; + /** + * 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; } - case 2: { - message.y = reader.int32(); - break; + 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; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + 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; + }; - /** - * 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()); - }; + /** + * 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; + }; - /** - * 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 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; + }; - /** - * 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; - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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"; + }; - /** - * 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); - }; + Token.DetectedBreak = (function() { - /** - * 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"; - }; + /** + * 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 + */ - return Vertex; - })(); + /** + * 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]]; + } - v1beta3.NormalizedVertex = (function() { + /** + * 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; - /** - * Properties of a NormalizedVertex. - * @memberof google.cloud.documentai.v1beta3 - * @interface INormalizedVertex - * @property {number|null} [x] NormalizedVertex x - * @property {number|null} [y] NormalizedVertex y - */ + /** + * 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); + }; - /** - * 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]]; - } + /** + * 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; + }; - /** - * NormalizedVertex x. - * @member {number} x - * @memberof google.cloud.documentai.v1beta3.NormalizedVertex - * @instance - */ - NormalizedVertex.prototype.x = 0; + /** + * 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(); + }; - /** - * NormalizedVertex y. - * @member {number} y - * @memberof google.cloud.documentai.v1beta3.NormalizedVertex - * @instance - */ - NormalizedVertex.prototype.y = 0; + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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(); - }; + /** + * 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; + }; - /** - * 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) { - 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(); - 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; - }; + /** + * 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; + }; - /** - * 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()); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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"; + }; - /** - * 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; - }; + /** + * 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; + })(); - /** - * 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; - }; + return DetectedBreak; + })(); - /** - * 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); - }; + Token.StyleInfo = (function() { - /** - * 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"; - }; + /** + * 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 + */ - return NormalizedVertex; - })(); + /** + * 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]]; + } - v1beta3.BoundingPoly = (function() { + /** + * StyleInfo fontSize. + * @member {number} fontSize + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontSize = 0; - /** - * Properties of a BoundingPoly. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBoundingPoly - * @property {Array.|null} [vertices] BoundingPoly vertices - * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices - */ + /** + * StyleInfo pixelFontSize. + * @member {number} pixelFontSize + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.pixelFontSize = 0; - /** - * 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]]; - } + /** + * StyleInfo letterSpacing. + * @member {number} letterSpacing + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.letterSpacing = 0; - /** - * BoundingPoly vertices. - * @member {Array.} vertices - * @memberof google.cloud.documentai.v1beta3.BoundingPoly - * @instance - */ - BoundingPoly.prototype.vertices = $util.emptyArray; + /** + * StyleInfo fontType. + * @member {string} fontType + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontType = ""; - /** - * BoundingPoly normalizedVertices. - * @member {Array.} normalizedVertices - * @memberof google.cloud.documentai.v1beta3.BoundingPoly - * @instance - */ - BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + /** + * StyleInfo bold. + * @member {boolean} bold + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.bold = false; - /** - * 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); - }; + /** + * StyleInfo italic. + * @member {boolean} italic + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.italic = false; - /** - * 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; - }; + /** + * StyleInfo underlined. + * @member {boolean} underlined + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.underlined = false; - /** - * 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(); - }; + /** + * StyleInfo strikeout. + * @member {boolean} strikeout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.strikeout = false; - /** - * 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) { - 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(); - 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; - }; + /** + * StyleInfo subscript. + * @member {boolean} subscript + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.subscript = false; - /** - * 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()); - }; + /** + * StyleInfo superscript. + * @member {boolean} superscript + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.superscript = false; - /** - * 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; - }; + /** + * StyleInfo smallcaps. + * @member {boolean} smallcaps + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.smallcaps = false; - /** - * 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; - }; + /** + * StyleInfo fontWeight. + * @member {number} fontWeight + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontWeight = 0; - /** - * 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; - }; + /** + * StyleInfo handwritten. + * @member {boolean} handwritten + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.handwritten = false; - /** - * 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); - }; + /** + * StyleInfo textColor. + * @member {google.type.IColor|null|undefined} textColor + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.textColor = null; - /** - * 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"; - }; + /** + * StyleInfo backgroundColor. + * @member {google.type.IColor|null|undefined} backgroundColor + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.backgroundColor = null; - return BoundingPoly; - })(); + /** + * 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); + }; - v1beta3.RawDocument = (function() { + /** + * 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; + }; - /** - * Properties of a RawDocument. - * @memberof google.cloud.documentai.v1beta3 - * @interface IRawDocument - * @property {Uint8Array|null} [content] RawDocument content - * @property {string|null} [mimeType] RawDocument mimeType - */ + /** + * 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(); + }; - /** - * 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]]; - } + /** + * 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) { + 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(); + 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; + }; - /** - * RawDocument content. - * @member {Uint8Array} content - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @instance - */ - RawDocument.prototype.content = $util.newBuffer([]); + /** + * 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()); + }; - /** - * RawDocument mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @instance - */ - RawDocument.prototype.mimeType = ""; + /** + * 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 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); - }; + /** + * 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; + }; - /** - * 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); - return writer; - }; + /** + * 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; + }; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.content = reader.bytes(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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"; + }; - /** - * 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()); - }; + return StyleInfo; + })(); - /** - * 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"; - return null; - }; + return Token; + })(); - /** - * 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); - return message; - }; + Page.Symbol = (function() { - /** - * 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); + /** + * 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]]; } - object.mimeType = ""; - } - 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 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); - }; + /** + * 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; - /** - * 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"; - }; + /** + * Symbol detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol + * @instance + */ + Symbol.prototype.detectedLanguages = $util.emptyArray; - return RawDocument; - })(); + /** + * 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); + }; - v1beta3.GcsDocument = (function() { + /** + * 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; + }; - /** - * Properties of a GcsDocument. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGcsDocument - * @property {string|null} [gcsUri] GcsDocument gcsUri - * @property {string|null} [mimeType] GcsDocument mimeType - */ + /** + * 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(); + }; - /** - * 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]]; - } + /** + * 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) { + 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(); + 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; + }; - /** - * GcsDocument gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @instance - */ - GcsDocument.prototype.gcsUri = ""; + /** + * 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()); + }; - /** - * GcsDocument mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @instance - */ - GcsDocument.prototype.mimeType = ""; + /** + * 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 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); - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.gcsUri = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; + /** + * 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"; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Page.Symbol"; + }; - /** - * 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()); - }; + return Symbol; + })(); - /** - * 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; - }; + Page.VisualElement = (function() { - /** - * 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; - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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); - }; + /** + * 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + 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; + } + 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"; + 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); + 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; + } + 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; + 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 {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 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"|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"]), + 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); + 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) { + 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(); + 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 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.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.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"; + } + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ - /** - * 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"; + /** + * 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]]; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsDocument"; - }; - return GcsDocument; - })(); + /** + * Provenance revision. + * @member {number} revision + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.revision = 0; - v1beta3.GcsDocuments = (function() { + /** + * Provenance id. + * @member {number} id + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.id = 0; - /** - * Properties of a GcsDocuments. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGcsDocuments - * @property {Array.|null} [documents] GcsDocuments documents - */ + /** + * Provenance parents. + * @member {Array.} parents + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.parents = $util.emptyArray; - /** - * 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]]; - } + /** + * Provenance type. + * @member {google.cloud.documentai.v1beta3.Document.Provenance.OperationType} type + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.type = 0; - /** - * GcsDocuments documents. - * @member {Array.} documents - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @instance - */ - GcsDocuments.prototype.documents = $util.emptyArray; + /** + * 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); + }; - /** - * 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 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 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 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(); + }; - /** - * 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 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) { + 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(); + 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 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) { - 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(); - 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())); + /** + * 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: - reader.skipType(tag & 7); + 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; - }; + 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()); - }; + /** + * 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; + }; - /** - * 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; + /** + * 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 null; - }; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Provenance"; + }; - /** - * 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]); + 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]]; } - } - 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; - }; + /** + * 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; - /** - * 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); - }; + /** + * Parent id. + * @member {number} id + * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @instance + */ + Parent.prototype.id = 0; - /** - * 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"; - }; + /** + * 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); + }; - return GcsDocuments; - })(); + /** + * 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; + }; - v1beta3.GcsPrefix = (function() { + /** + * 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(); + }; - /** - * Properties of a GcsPrefix. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGcsPrefix - * @property {string|null} [gcsUriPrefix] GcsPrefix gcsUriPrefix - */ + /** + * 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) { + 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(); + 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; + }; - /** - * 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]]; - } + /** + * 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()); + }; - /** - * GcsPrefix gcsUriPrefix. - * @member {string} gcsUriPrefix - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @instance - */ - GcsPrefix.prototype.gcsUriPrefix = ""; + /** + * 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 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); - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.gcsUriPrefix = reader.string(); - break; + /** + * 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"; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Provenance.Parent"; + }; - /** - * 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()); - }; + return Parent; + })(); - /** - * 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; - }; + /** + * 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; + })(); - /** - * 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; - }; + return Provenance; + })(); - /** - * 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; - }; + Document.Revision = (function() { - /** - * 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); - }; + /** + * 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 + */ - /** - * 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"; + /** + * 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]]; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsPrefix"; - }; - return GcsPrefix; - })(); + /** + * Revision agent. + * @member {string|null|undefined} agent + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.agent = null; - v1beta3.BatchDocumentsInputConfig = (function() { + /** + * 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 = ""; - /** - * 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 - */ + /** + * Revision parent. + * @member {Array.} parent + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.parent = $util.emptyArray; - /** - * 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]]; - } + /** + * Revision parentIds. + * @member {Array.} parentIds + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.parentIds = $util.emptyArray; - /** - * BatchDocumentsInputConfig gcsPrefix. - * @member {google.cloud.documentai.v1beta3.IGcsPrefix|null|undefined} gcsPrefix - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @instance - */ - BatchDocumentsInputConfig.prototype.gcsPrefix = null; + /** + * Revision createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.createTime = null; - /** - * BatchDocumentsInputConfig gcsDocuments. - * @member {google.cloud.documentai.v1beta3.IGcsDocuments|null|undefined} gcsDocuments - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @instance - */ - BatchDocumentsInputConfig.prototype.gcsDocuments = 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; + // 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) - }); + /** + * 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 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); - }; + /** + * 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 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 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 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(); - }; + /** + * 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 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) { - 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(); - 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()); + /** + * 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) { + 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(); + 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; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + 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()); - }; + /** + * 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 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); + /** + * 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 "gcsPrefix." + error; + return "createTime." + 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 (message.humanReview != null && message.hasOwnProperty("humanReview")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Revision.HumanReview.verify(message.humanReview); if (error) - return "gcsDocuments." + error; + return "humanReview." + error; } - } - return null; - }; + 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 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 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; - }; + /** + * 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 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); - }; + /** + * 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 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"; - }; + /** + * 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"; + }; - return BatchDocumentsInputConfig; - })(); + Revision.HumanReview = (function() { - v1beta3.DocumentOutputConfig = (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 + */ - /** - * 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 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]]; + } - /** - * 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]]; - } + /** + * HumanReview state. + * @member {string} state + * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @instance + */ + HumanReview.prototype.state = ""; - /** - * DocumentOutputConfig gcsOutputConfig. - * @member {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null|undefined} gcsOutputConfig - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @instance - */ - DocumentOutputConfig.prototype.gcsOutputConfig = null; + /** + * HumanReview stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @instance + */ + HumanReview.prototype.stateMessage = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * 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); + }; - /** - * 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) - }); + /** + * 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; + }; - /** - * 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 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(); + }; - /** - * 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; - }; + /** + * 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) { + 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(); + 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; + }; - /** - * 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 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()); + }; - /** - * 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) { - 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(); - 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; - }; + /** + * 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; + }; - /** - * 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()); - }; + /** + * 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; + }; - /** - * 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 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; + }; - /** - * 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; - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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"; + }; - /** - * 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); - }; + return HumanReview; + })(); - /** - * 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"; - }; + return Revision; + })(); - DocumentOutputConfig.GcsOutputConfig = (function() { + Document.TextChange = (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 + * 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 GcsOutputConfig. - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @classdesc Represents a GcsOutputConfig. - * @implements IGcsOutputConfig + * Constructs a new TextChange. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a TextChange. + * @implements ITextChange * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Document.ITextChange=} [properties] Properties to set */ - function GcsOutputConfig(properties) { + function TextChange(properties) { + this.provenance = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70813,103 +75367,106 @@ } /** - * GcsOutputConfig gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * TextChange textAnchor. + * @member {google.cloud.documentai.v1beta3.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @instance */ - GcsOutputConfig.prototype.gcsUri = ""; + TextChange.prototype.textAnchor = null; /** - * GcsOutputConfig fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * TextChange changedText. + * @member {string} changedText + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @instance */ - GcsOutputConfig.prototype.fieldMask = null; + TextChange.prototype.changedText = ""; /** - * GcsOutputConfig shardingConfig. - * @member {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null|undefined} shardingConfig - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * TextChange provenance. + * @member {Array.} provenance + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @instance */ - GcsOutputConfig.prototype.shardingConfig = null; + TextChange.prototype.provenance = $util.emptyArray; /** - * Creates a new GcsOutputConfig instance using the specified properties. + * Creates a new TextChange instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig instance + * @param {google.cloud.documentai.v1beta3.Document.ITextChange=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.TextChange} TextChange instance */ - GcsOutputConfig.create = function create(properties) { - return new GcsOutputConfig(properties); + TextChange.create = function create(properties) { + return new TextChange(properties); }; /** - * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * 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.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @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 */ - GcsOutputConfig.encode = function encode(message, writer) { + TextChange.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(); + 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 GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * 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.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @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 */ - GcsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + TextChange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsOutputConfig message from the specified reader or buffer. + * Decodes a TextChange message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @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.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + * @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 */ - GcsOutputConfig.decode = function decode(reader, length) { + TextChange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig(); + 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(); switch (tag >>> 3) { case 1: { - message.gcsUri = reader.string(); + message.textAnchor = $root.google.cloud.documentai.v1beta3.Document.TextAnchor.decode(reader, reader.uint32()); break; } case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.changedText = reader.string(); break; } case 3: { - message.shardingConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.decode(reader, reader.uint32()); + if (!(message.provenance && message.provenance.length)) + message.provenance = []; + message.provenance.push($root.google.cloud.documentai.v1beta3.Document.Provenance.decode(reader, reader.uint32())); break; } default: @@ -70921,384 +75478,393 @@ }; /** - * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a TextChange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + * @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 */ - GcsOutputConfig.decodeDelimited = function decodeDelimited(reader) { + TextChange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsOutputConfig message. + * Verifies a TextChange message. * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @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 */ - GcsOutputConfig.verify = function verify(message) { + TextChange.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 (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { + var error = $root.google.cloud.documentai.v1beta3.Document.TextAnchor.verify(message.textAnchor); if (error) - return "fieldMask." + error; + return "textAnchor." + 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; + 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 GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a TextChange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + * @returns {google.cloud.documentai.v1beta3.Document.TextChange} TextChange */ - GcsOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig) + 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.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); + 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.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); + 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 GcsOutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a TextChange message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} message GcsOutputConfig + * @param {google.cloud.documentai.v1beta3.Document.TextChange} message TextChange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsOutputConfig.toObject = function toObject(message, options) { + TextChange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.provenance = []; if (options.defaults) { - object.gcsUri = ""; - object.fieldMask = null; - object.shardingConfig = null; + 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); } - 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. + * Converts this TextChange to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @instance * @returns {Object.} JSON object */ - GcsOutputConfig.prototype.toJSON = function toJSON() { + TextChange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GcsOutputConfig + * Gets the default type url for TextChange * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.Document.TextChange * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GcsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TextChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.TextChange"; }; - 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]]; - } + return TextChange; + })(); - /** - * ShardingConfig pagesPerShard. - * @member {number} pagesPerShard - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - */ - ShardingConfig.prototype.pagesPerShard = 0; + return Document; + })(); - /** - * ShardingConfig pagesOverlap. - * @member {number} pagesOverlap - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - */ - ShardingConfig.prototype.pagesOverlap = 0; + v1beta3.Vertex = (function() { - /** - * 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); - }; + /** + * Properties of a Vertex. + * @memberof google.cloud.documentai.v1beta3 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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(); - }; + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.documentai.v1beta3.Vertex + * @instance + */ + Vertex.prototype.x = 0; - /** - * 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) { - 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(); - 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; - }; + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.documentai.v1beta3.Vertex + * @instance + */ + Vertex.prototype.y = 0; - /** - * 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()); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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(); + }; - /** - * 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; + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.x = reader.int32(); + break; } - if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) - object.pagesPerShard = message.pagesPerShard; - if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) - object.pagesOverlap = message.pagesOverlap; - return object; - }; + 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()); + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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; + }; - return ShardingConfig; - })(); + /** + * 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; + }; - return GcsOutputConfig; - })(); + /** + * 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); + }; - return DocumentOutputConfig; + /** + * 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.OcrConfig = (function() { + v1beta3.NormalizedVertex = (function() { /** - * Properties of an OcrConfig. + * Properties of a NormalizedVertex. * @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 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y */ /** - * Constructs a new OcrConfig. + * Constructs a new NormalizedVertex. * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an OcrConfig. - * @implements IOcrConfig + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex * @constructor - * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.INormalizedVertex=} [properties] Properties to set */ - function OcrConfig(properties) { - this.advancedOcrOptions = []; + function NormalizedVertex(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -71306,134 +75872,324 @@ } /** - * OcrConfig hints. - * @member {google.cloud.documentai.v1beta3.OcrConfig.IHints|null|undefined} hints - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.documentai.v1beta3.NormalizedVertex * @instance */ - OcrConfig.prototype.hints = null; + NormalizedVertex.prototype.x = 0; /** - * OcrConfig enableNativePdfParsing. - * @member {boolean} enableNativePdfParsing - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.documentai.v1beta3.NormalizedVertex * @instance */ - OcrConfig.prototype.enableNativePdfParsing = false; + NormalizedVertex.prototype.y = 0; /** - * OcrConfig enableImageQualityScores. - * @member {boolean} enableImageQualityScores - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * 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) { + 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(); + 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 */ - OcrConfig.prototype.enableImageQualityScores = false; + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * OcrConfig advancedOcrOptions. - * @member {Array.} advancedOcrOptions - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * 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 */ - OcrConfig.prototype.advancedOcrOptions = $util.emptyArray; + BoundingPoly.prototype.vertices = $util.emptyArray; /** - * OcrConfig enableSymbol. - * @member {boolean} enableSymbol - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @instance */ - OcrConfig.prototype.enableSymbol = false; + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; /** - * Creates a new OcrConfig instance using the specified properties. + * Creates a new BoundingPoly instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @static - * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig instance + * @param {google.cloud.documentai.v1beta3.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BoundingPoly} BoundingPoly instance */ - OcrConfig.create = function create(properties) { - return new OcrConfig(properties); + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); }; /** - * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1beta3.BoundingPoly.verify|verify} messages. * @function encode - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @static - * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode + * @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 */ - OcrConfig.encode = function encode(message, writer) { + BoundingPoly.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.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 OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * 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.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @static - * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode + * @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 */ - OcrConfig.encodeDelimited = function encodeDelimited(message, writer) { + BoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OcrConfig message from the specified reader or buffer. + * Decodes a BoundingPoly message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @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.OcrConfig} OcrConfig + * @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 */ - OcrConfig.decode = function decode(reader, length) { + BoundingPoly.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.OcrConfig(); + 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(); 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()); + 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 6: { - message.enableSymbol = reader.bool(); + 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: @@ -71445,372 +76201,145 @@ }; /** - * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + * @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 */ - OcrConfig.decodeDelimited = function decodeDelimited(reader) { + BoundingPoly.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OcrConfig message. + * Verifies a BoundingPoly message. * @function verify - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @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 */ - OcrConfig.verify = function verify(message) { + BoundingPoly.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.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.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.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; + } } - if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) - if (typeof message.enableSymbol !== "boolean") - return "enableSymbol: boolean expected"; return null; }; /** - * Creates an OcrConfig message from a plain object. Also converts values to their respective internal types. + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + * @returns {google.cloud.documentai.v1beta3.BoundingPoly} BoundingPoly */ - OcrConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig) + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BoundingPoly) 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); + 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.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.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]); + } } - if (object.enableSymbol != null) - message.enableSymbol = Boolean(object.enableSymbol); return message; }; /** - * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig} message OcrConfig + * @param {google.cloud.documentai.v1beta3.BoundingPoly} message BoundingPoly * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OcrConfig.toObject = function toObject(message, options) { + BoundingPoly.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; + if (options.arrays || options.defaults) { + object.vertices = []; + object.normalizedVertices = []; } - 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.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); } - if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) - object.enableSymbol = message.enableSymbol; return object; }; /** - * Converts this OcrConfig to JSON. + * Converts this BoundingPoly to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @instance * @returns {Object.} JSON object */ - OcrConfig.prototype.toJSON = function toJSON() { + BoundingPoly.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OcrConfig + * Gets the default type url for BoundingPoly * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @memberof google.cloud.documentai.v1beta3.BoundingPoly * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OcrConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BoundingPoly"; }; - 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) { - 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(); - 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; - })(); - - return OcrConfig; + return BoundingPoly; })(); v1beta3.DocumentProcessorService = (function() { @@ -82008,6 +86537,7 @@ * Properties of a TrainProcessorVersionRequest. * @memberof google.cloud.documentai.v1beta3 * @interface ITrainProcessorVersionRequest + * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null} [customDocumentExtractionOptions] TrainProcessorVersionRequest customDocumentExtractionOptions * @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 @@ -82030,6 +86560,14 @@ 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 parent. * @member {string} parent @@ -82070,6 +86608,20 @@ */ TrainProcessorVersionRequest.prototype.baseProcessorVersion = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TrainProcessorVersionRequest processorFlags. + * @member {"customDocumentExtractionOptions"|undefined} processorFlags + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + Object.defineProperty(TrainProcessorVersionRequest.prototype, "processorFlags", { + get: $util.oneOfGetter($oneOfFields = ["customDocumentExtractionOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new TrainProcessorVersionRequest instance using the specified properties. * @function create @@ -82100,6 +86652,8 @@ $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")) @@ -82138,6 +86692,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 5: { + message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.decode(reader, reader.uint32()); + break; + } case 1: { message.parent = reader.string(); break; @@ -82193,6 +86751,15 @@ 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.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; @@ -82229,6 +86796,11 @@ 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.parent != null) message.parent = String(object.parent); if (object.processorVersion != null) { @@ -82277,6 +86849,11 @@ 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")) @@ -82547,6 +87124,249 @@ 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) { + 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(); + 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; + })(); + return TrainProcessorVersionRequest; })(); @@ -86407,28 +91227,314 @@ return ImportProcessorVersionMetadata; })(); - v1beta3.DocumentSchema = (function() { + v1beta3.EvaluationReference = (function() { /** - * Properties of a DocumentSchema. + * Properties of an EvaluationReference. * @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 + * @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 DocumentSchema. + * Constructs a new EvaluationReference. * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DocumentSchema. - * @implements IDocumentSchema + * @classdesc Represents an EvaluationReference. + * @implements IEvaluationReference * @constructor - * @param {google.cloud.documentai.v1beta3.IDocumentSchema=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.IEvaluationReference=} [properties] Properties to set */ - function DocumentSchema(properties) { - this.entityTypes = []; + 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) { + 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(); + 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 + */ + + /** + * 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 = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -86436,120 +91542,181 @@ } /** - * DocumentSchema displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * 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 */ - DocumentSchema.prototype.displayName = ""; + Evaluation.prototype.allEntitiesMetrics = null; /** - * DocumentSchema description. - * @member {string} description - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * Evaluation entityMetrics. + * @member {Object.} entityMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation * @instance */ - DocumentSchema.prototype.description = ""; + Evaluation.prototype.entityMetrics = $util.emptyObject; /** - * DocumentSchema entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * Evaluation kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1beta3.Evaluation * @instance */ - DocumentSchema.prototype.entityTypes = $util.emptyArray; + Evaluation.prototype.kmsKeyName = ""; /** - * DocumentSchema metadata. - * @member {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null|undefined} metadata - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * Evaluation kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.documentai.v1beta3.Evaluation * @instance */ - DocumentSchema.prototype.metadata = null; + Evaluation.prototype.kmsKeyVersionName = ""; /** - * Creates a new DocumentSchema instance using the specified properties. + * Creates a new Evaluation instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @memberof google.cloud.documentai.v1beta3.Evaluation * @static - * @param {google.cloud.documentai.v1beta3.IDocumentSchema=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentSchema} DocumentSchema instance + * @param {google.cloud.documentai.v1beta3.IEvaluation=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation instance */ - DocumentSchema.create = function create(properties) { - return new DocumentSchema(properties); + Evaluation.create = function create(properties) { + return new Evaluation(properties); }; /** - * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.verify|verify} messages. + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @memberof google.cloud.documentai.v1beta3.Evaluation * @static - * @param {google.cloud.documentai.v1beta3.IDocumentSchema} message DocumentSchema message or plain object to encode + * @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 */ - DocumentSchema.encode = function encode(message, writer) { + Evaluation.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.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); return writer; }; /** - * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.verify|verify} messages. + * 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.DocumentSchema + * @memberof google.cloud.documentai.v1beta3.Evaluation * @static - * @param {google.cloud.documentai.v1beta3.IDocumentSchema} message DocumentSchema message or plain object to encode + * @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 */ - DocumentSchema.encodeDelimited = function encodeDelimited(message, writer) { + Evaluation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DocumentSchema message from the specified reader or buffer. + * Decodes an Evaluation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @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.DocumentSchema} DocumentSchema + * @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 */ - DocumentSchema.decode = function decode(reader, length) { + Evaluation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.DocumentSchema(); + 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(); switch (tag >>> 3) { case 1: { - message.displayName = reader.string(); + message.name = reader.string(); break; } case 2: { - message.description = reader.string(); + 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: { - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.decode(reader, reader.uint32())); + message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); break; } case 4: { - message.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.decode(reader, reader.uint32()); + 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; } default: @@ -86561,1053 +91728,486 @@ }; /** - * Decodes a DocumentSchema message from the specified reader or buffer, length delimited. + * Decodes an Evaluation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @memberof google.cloud.documentai.v1beta3.Evaluation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentSchema} DocumentSchema + * @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 */ - DocumentSchema.decodeDelimited = function decodeDelimited(reader) { + Evaluation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DocumentSchema message. + * Verifies an Evaluation message. * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @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 */ - DocumentSchema.verify = function verify(message) { + Evaluation.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.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.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify(message.metadata); + if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.verify(message.documentCounters); if (error) - return "metadata." + 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"; return null; }; /** - * Creates a DocumentSchema message from a plain object. Also converts values to their respective internal types. + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @memberof google.cloud.documentai.v1beta3.Evaluation * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentSchema} DocumentSchema + * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation */ - DocumentSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema) + Evaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation) 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]); - } + 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.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.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); return message; }; /** - * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @memberof google.cloud.documentai.v1beta3.Evaluation * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema} message DocumentSchema + * @param {google.cloud.documentai.v1beta3.Evaluation} message Evaluation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DocumentSchema.toObject = function toObject(message, options) { + Evaluation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entityTypes = []; + if (options.objects || options.defaults) + object.entityMetrics = {}; if (options.defaults) { - object.displayName = ""; - object.description = ""; - object.metadata = null; + object.name = ""; + object.createTime = null; + object.allEntitiesMetrics = null; + object.documentCounters = null; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; } - 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.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.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.toObject(message.metadata, 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; return object; }; /** - * Converts this DocumentSchema to JSON. + * Converts this Evaluation to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @memberof google.cloud.documentai.v1beta3.Evaluation * @instance * @returns {Object.} JSON object */ - DocumentSchema.prototype.toJSON = function toJSON() { + Evaluation.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 {Array.|null} [baseTypes] EntityType baseTypes - * @property {Array.|null} [properties] EntityType properties - */ - - /** - * 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 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; - - // 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.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(); - 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) { - 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(); - 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 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + * 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() { /** - * 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 + * 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 */ - 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 + * 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 */ - 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.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; - } - } - return null; - }; + 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]]; + } /** - * 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 + * Counters inputDocumentsCount. + * @member {number} inputDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance */ - 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.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]); - } - } - return message; - }; + Counters.prototype.inputDocumentsCount = 0; /** - * 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 + * Counters invalidDocumentsCount. + * @member {number} invalidDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance */ - 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.v1beta3.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.v1beta3.DocumentSchema.EntityType.EnumValues.toObject(message.enumValues, options); - if (options.oneofs) - object.valueSource = "enumValues"; - } - return object; - }; + Counters.prototype.invalidDocumentsCount = 0; /** - * Converts this EntityType to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * Counters failedDocumentsCount. + * @member {number} failedDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters * @instance - * @returns {Object.} JSON object */ - EntityType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Counters.prototype.failedDocumentsCount = 0; /** - * 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 + * Counters evaluatedDocumentsCount. + * @member {number} evaluatedDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance */ - 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) { - 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(); - 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} [valueType] Property valueType - * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|null} [occurrenceType] Property occurrenceType - */ - - /** - * 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 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; - - /** - * 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); - }; + Counters.prototype.evaluatedDocumentsCount = 0; - /** - * 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); - return writer; - }; + /** + * 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 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(); - }; + /** + * 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; + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.valueType = reader.string(); - break; - } - case 3: { - message.occurrenceType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.inputDocumentsCount = reader.int32(); 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.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: + case 2: { + message.invalidDocumentsCount = reader.int32(); 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.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.valueType != null) - message.valueType = String(object.valueType); - switch (object.occurrenceType) { - default: - if (typeof object.occurrenceType === "number") { - message.occurrenceType = object.occurrenceType; + case 3: { + message.failedDocumentsCount = reader.int32(); 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; + case 4: { + message.evaluatedDocumentsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + 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; - } - 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; - return object; - }; + /** + * 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()); + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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; + }; - /** - * 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; - })(); + /** + * 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; + }; - return Property; - })(); + /** + * 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); + }; - return EntityType; + /** + * 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; })(); - DocumentSchema.Metadata = (function() { + Evaluation.Metrics = (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 + * 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 Metadata. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @classdesc Represents a Metadata. - * @implements IMetadata + * Constructs a new Metrics. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @classdesc Represents a Metrics. + * @implements IMetrics * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics=} [properties] Properties to set */ - function Metadata(properties) { + function Metrics(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87615,117 +92215,215 @@ } /** - * Metadata documentSplitter. - * @member {boolean} documentSplitter - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * Metrics precision. + * @member {number} precision + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @instance */ - Metadata.prototype.documentSplitter = false; + Metrics.prototype.precision = 0; /** - * Metadata documentAllowMultipleLabels. - * @member {boolean} documentAllowMultipleLabels - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * Metrics recall. + * @member {number} recall + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @instance */ - Metadata.prototype.documentAllowMultipleLabels = false; + Metrics.prototype.recall = 0; /** - * Metadata prefixedNamingOnProperties. - * @member {boolean} prefixedNamingOnProperties - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * Metrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @instance */ - Metadata.prototype.prefixedNamingOnProperties = false; + 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; /** - * Metadata skipNamingValidation. - * @member {boolean} skipNamingValidation - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * Metrics totalDocumentsCount. + * @member {number} totalDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @instance */ - Metadata.prototype.skipNamingValidation = false; + Metrics.prototype.totalDocumentsCount = 0; /** - * Creates a new Metadata instance using the specified properties. + * Creates a new Metrics instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata instance + * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics instance */ - Metadata.create = function create(properties) { - return new Metadata(properties); + Metrics.create = function create(properties) { + return new Metrics(properties); }; /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. + * 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.DocumentSchema.Metadata + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata} message Metadata message or plain object to encode + * @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 */ - Metadata.encode = function encode(message, writer) { + Metrics.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); + 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 Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. + * 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.DocumentSchema.Metadata + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata} message Metadata message or plain object to encode + * @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 */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { + Metrics.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Metadata message from the specified reader or buffer. + * Decodes a Metrics message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @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.DocumentSchema.Metadata} Metadata + * @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 */ - Metadata.decode = function decode(reader, length) { + Metrics.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata(); + 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(); switch (tag >>> 3) { case 1: { - message.documentSplitter = reader.bool(); + message.precision = reader.float(); break; } case 2: { - message.documentAllowMultipleLabels = reader.bool(); + 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.prefixedNamingOnProperties = reader.bool(); + message.truePositivesCount = reader.int32(); break; } case 7: { - message.skipNamingValidation = reader.bool(); + message.falsePositivesCount = reader.int32(); + break; + } + case 8: { + message.falseNegativesCount = reader.int32(); + break; + } + case 9: { + message.totalDocumentsCount = reader.int32(); break; } default: @@ -87737,833 +92435,443 @@ }; /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. + * Decodes a Metrics message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata + * @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 */ - Metadata.decodeDelimited = function decodeDelimited(reader) { + Metrics.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.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) { - 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(); - 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; - })(); + * 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; + }; - v1beta3.Evaluation = (function() { + /** + * 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; + }; - /** - * 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 - */ + /** + * 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; + }; - /** - * 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 = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * 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); + }; - /** - * Evaluation name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.name = ""; + /** + * 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"; + }; - /** - * Evaluation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.createTime = null; + return Metrics; + })(); - /** - * Evaluation documentCounters. - * @member {google.cloud.documentai.v1beta3.Evaluation.ICounters|null|undefined} documentCounters - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.documentCounters = null; + Evaluation.ConfidenceLevelMetrics = (function() { - /** - * Evaluation allEntitiesMetrics. - * @member {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.allEntitiesMetrics = null; + /** + * 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 + */ - /** - * Evaluation entityMetrics. - * @member {Object.} entityMetrics - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.entityMetrics = $util.emptyObject; + /** + * 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]]; + } - /** - * Evaluation kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.kmsKeyName = ""; + /** + * ConfidenceLevelMetrics confidenceLevel. + * @member {number} confidenceLevel + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @instance + */ + ConfidenceLevelMetrics.prototype.confidenceLevel = 0; - /** - * Evaluation kmsKeyVersionName. - * @member {string} kmsKeyVersionName - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.kmsKeyVersionName = ""; + /** + * 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 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); - }; + /** + * 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 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); - return writer; - }; + /** + * 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 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(); - }; + /** + * 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 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) { - 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(); - 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; - } + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.confidenceLevel = reader.float(); + break; } - message.entityMetrics[key] = value; - break; - } - case 6: { - message.kmsKeyName = reader.string(); - break; - } - case 7: { - message.kmsKeyVersionName = reader.string(); + case 2: { + message.metrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); 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]]); + 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 "entityMetrics." + error; + return "metrics." + 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; - }; + 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]]); + /** + * 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); } - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyVersionName != null) - message.kmsKeyVersionName = String(object.kmsKeyVersionName); - return message; - }; + 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.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; - return object; - }; + /** + * 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 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); - }; + /** + * 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 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"; - }; + /** + * 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"; + }; - Evaluation.Counters = (function() { + return ConfidenceLevelMetrics; + })(); + + Evaluation.MultiConfidenceMetrics = (function() { /** - * Properties of a Counters. + * Properties of a MultiConfidenceMetrics. * @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 + * @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 Counters. + * Constructs a new MultiConfidenceMetrics. * @memberof google.cloud.documentai.v1beta3.Evaluation - * @classdesc Represents a Counters. - * @implements ICounters + * @classdesc Represents a MultiConfidenceMetrics. + * @implements IMultiConfidenceMetrics * @constructor - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set */ - function Counters(properties) { + 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) @@ -88571,117 +92879,165 @@ } /** - * Counters inputDocumentsCount. - * @member {number} inputDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * MultiConfidenceMetrics confidenceLevelMetrics. + * @member {Array.} confidenceLevelMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @instance */ - Counters.prototype.inputDocumentsCount = 0; + MultiConfidenceMetrics.prototype.confidenceLevelMetrics = $util.emptyArray; /** - * Counters invalidDocumentsCount. - * @member {number} invalidDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * MultiConfidenceMetrics confidenceLevelMetricsExact. + * @member {Array.} confidenceLevelMetricsExact + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @instance */ - Counters.prototype.invalidDocumentsCount = 0; + MultiConfidenceMetrics.prototype.confidenceLevelMetricsExact = $util.emptyArray; /** - * Counters failedDocumentsCount. - * @member {number} failedDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * MultiConfidenceMetrics auprc. + * @member {number} auprc + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @instance */ - Counters.prototype.failedDocumentsCount = 0; + MultiConfidenceMetrics.prototype.auprc = 0; /** - * Counters evaluatedDocumentsCount. - * @member {number} evaluatedDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * MultiConfidenceMetrics estimatedCalibrationError. + * @member {number} estimatedCalibrationError + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @instance */ - Counters.prototype.evaluatedDocumentsCount = 0; + MultiConfidenceMetrics.prototype.estimatedCalibrationError = 0; /** - * Creates a new Counters instance using the specified properties. + * 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.Counters + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters instance + * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics instance */ - Counters.create = function create(properties) { - return new Counters(properties); + MultiConfidenceMetrics.create = function create(properties) { + return new MultiConfidenceMetrics(properties); }; /** - * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. + * 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.Counters + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters} message Counters message or plain object to encode + * @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 */ - Counters.encode = function encode(message, writer) { + MultiConfidenceMetrics.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); + 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 Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. + * 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.Counters + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters} message Counters message or plain object to encode + * @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 */ - Counters.encodeDelimited = function encodeDelimited(message, writer) { + MultiConfidenceMetrics.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Counters message from the specified reader or buffer. + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @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.Counters} Counters + * @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 */ - Counters.decode = function decode(reader, length) { + MultiConfidenceMetrics.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Evaluation.Counters(); + 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(); switch (tag >>> 3) { case 1: { - message.inputDocumentsCount = reader.int32(); + 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.invalidDocumentsCount = reader.int32(); + message.auprc = reader.float(); break; } case 3: { - message.failedDocumentsCount = reader.int32(); + message.estimatedCalibrationError = reader.float(); break; } - case 4: { - message.evaluatedDocumentsCount = reader.int32(); + case 5: { + message.auprcExact = reader.float(); + break; + } + case 6: { + message.estimatedCalibrationErrorExact = reader.float(); + break; + } + case 7: { + message.metricsType = reader.int32(); break; } default: @@ -88693,821 +93049,1093 @@ }; /** - * Decodes a Counters message from the specified reader or buffer, length delimited. + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @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.Counters} Counters + * @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 */ - Counters.decodeDelimited = function decodeDelimited(reader) { + MultiConfidenceMetrics.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Counters message. + * Verifies a MultiConfidenceMetrics message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @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 */ - Counters.verify = function verify(message) { + MultiConfidenceMetrics.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"; + 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 Counters message from a plain object. Also converts values to their respective internal types. + * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters + * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics */ - Counters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.Counters) + 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.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; + 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 Counters message. Also converts values to other types if specified. + * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.Counters} message Counters + * @param {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} message MultiConfidenceMetrics * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Counters.toObject = function toObject(message, options) { + MultiConfidenceMetrics.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.confidenceLevelMetrics = []; + object.confidenceLevelMetricsExact = []; + } if (options.defaults) { - object.inputDocumentsCount = 0; - object.invalidDocumentsCount = 0; - object.failedDocumentsCount = 0; - object.evaluatedDocumentsCount = 0; + object.auprc = 0; + object.estimatedCalibrationError = 0; + object.auprcExact = 0; + object.estimatedCalibrationErrorExact = 0; + object.metricsType = options.enums === String ? "METRICS_TYPE_UNSPECIFIED" : 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; + 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 Counters to JSON. + * Converts this MultiConfidenceMetrics to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @instance * @returns {Object.} JSON object */ - Counters.prototype.toJSON = function toJSON() { + MultiConfidenceMetrics.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Counters + * Gets the default type url for MultiConfidenceMetrics * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Counters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MultiConfidenceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.Counters"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics"; }; - return Counters; + /** + * 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.Metrics = (function() { + return Evaluation; + })(); - /** - * 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 - */ + v1beta3.CommonOperationMetadata = (function() { - /** - * 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]]; - } + /** + * 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 + */ - /** - * Metrics precision. - * @member {number} precision - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.precision = 0; + /** + * 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]]; + } - /** - * Metrics recall. - * @member {number} recall - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.recall = 0; + /** + * CommonOperationMetadata state. + * @member {google.cloud.documentai.v1beta3.CommonOperationMetadata.State} state + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.state = 0; - /** - * Metrics f1Score. - * @member {number} f1Score - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.f1Score = 0; + /** + * CommonOperationMetadata stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.stateMessage = ""; - /** - * Metrics predictedOccurrencesCount. - * @member {number} predictedOccurrencesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.predictedOccurrencesCount = 0; + /** + * CommonOperationMetadata resource. + * @member {string} resource + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.resource = ""; - /** - * Metrics groundTruthOccurrencesCount. - * @member {number} groundTruthOccurrencesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.groundTruthOccurrencesCount = 0; + /** + * CommonOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.createTime = null; - /** - * Metrics predictedDocumentCount. - * @member {number} predictedDocumentCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.predictedDocumentCount = 0; + /** + * CommonOperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.updateTime = null; - /** - * Metrics groundTruthDocumentCount. - * @member {number} groundTruthDocumentCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.groundTruthDocumentCount = 0; + /** + * 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); + }; - /** - * Metrics truePositivesCount. - * @member {number} truePositivesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.truePositivesCount = 0; + /** + * 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; + }; - /** - * Metrics falsePositivesCount. - * @member {number} falsePositivesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.falsePositivesCount = 0; + /** + * 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(); + }; - /** - * Metrics falseNegativesCount. - * @member {number} falseNegativesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.falseNegativesCount = 0; + /** + * 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) { + 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(); + 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; + }; - /** - * Metrics totalDocumentsCount. - * @member {number} totalDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.totalDocumentsCount = 0; + /** + * 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()); + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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); + }; - /** - * 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(); - }; + /** + * 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"; + }; - /** - * 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) { - 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(); - 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; - }; + /** + * 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; + })(); - /** - * 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()); - }; + return CommonOperationMetadata; + })(); - /** - * 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; - }; + v1beta3.ProcessorVersion = (function() { - /** - * 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; - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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); - }; + /** + * ProcessorVersion name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.name = ""; - /** - * 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"; - }; + /** + * ProcessorVersion displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.displayName = ""; - return Metrics; - })(); + /** + * ProcessorVersion documentSchema. + * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.documentSchema = null; - Evaluation.ConfidenceLevelMetrics = (function() { + /** + * ProcessorVersion state. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.State} state + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.state = 0; - /** - * 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 - */ + /** + * ProcessorVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.createTime = null; - /** - * 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]]; - } + /** + * ProcessorVersion latestEvaluation. + * @member {google.cloud.documentai.v1beta3.IEvaluationReference|null|undefined} latestEvaluation + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.latestEvaluation = null; - /** - * ConfidenceLevelMetrics confidenceLevel. - * @member {number} confidenceLevel - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @instance - */ - ConfidenceLevelMetrics.prototype.confidenceLevel = 0; + /** + * ProcessorVersion kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.kmsKeyName = ""; - /** - * ConfidenceLevelMetrics metrics. - * @member {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null|undefined} metrics - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @instance - */ - ConfidenceLevelMetrics.prototype.metrics = null; + /** + * ProcessorVersion kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.kmsKeyVersionName = ""; - /** - * 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); - }; + /** + * ProcessorVersion googleManaged. + * @member {boolean} googleManaged + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.googleManaged = false; - /** - * 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; - }; + /** + * ProcessorVersion deprecationInfo. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null|undefined} deprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.deprecationInfo = 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 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(); - }; + /** + * 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(); + return writer; + }; - /** - * 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) { - 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(); - 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); + /** + * 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) { + 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(); + 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; } + 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()); - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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); + /** + * 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; } - return message; - }; + 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; + } + return null; + }; - /** - * 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); + /** + * 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); + } + return message; + }; - /** - * 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); - }; + /** + * 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; + } + 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); + return object; + }; - /** - * 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"; - }; + /** + * 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); + }; - return ConfidenceLevelMetrics; - })(); + /** + * 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"; + }; - Evaluation.MultiConfidenceMetrics = (function() { + ProcessorVersion.DeprecationInfo = (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 + * 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 MultiConfidenceMetrics. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @classdesc Represents a MultiConfidenceMetrics. - * @implements IMultiConfidenceMetrics + * Constructs a new DeprecationInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @classdesc Represents a DeprecationInfo. + * @implements IDeprecationInfo * @constructor - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set */ - function MultiConfidenceMetrics(properties) { - this.confidenceLevelMetrics = []; - this.confidenceLevelMetricsExact = []; + function DeprecationInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89515,165 +94143,89 @@ } /** - * 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 + * DeprecationInfo deprecationTime. + * @member {google.protobuf.ITimestamp|null|undefined} deprecationTime + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @instance */ - MultiConfidenceMetrics.prototype.estimatedCalibrationErrorExact = 0; + DeprecationInfo.prototype.deprecationTime = null; /** - * MultiConfidenceMetrics metricsType. - * @member {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType} metricsType - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * DeprecationInfo replacementProcessorVersion. + * @member {string} replacementProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @instance */ - MultiConfidenceMetrics.prototype.metricsType = 0; + DeprecationInfo.prototype.replacementProcessorVersion = ""; /** - * Creates a new MultiConfidenceMetrics instance using the specified properties. + * Creates a new DeprecationInfo instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics instance + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo instance */ - MultiConfidenceMetrics.create = function create(properties) { - return new MultiConfidenceMetrics(properties); + DeprecationInfo.create = function create(properties) { + return new DeprecationInfo(properties); }; /** - * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * 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.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode + * @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 */ - MultiConfidenceMetrics.encode = function encode(message, writer) { + DeprecationInfo.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); + 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 MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * 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.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode + * @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 */ - MultiConfidenceMetrics.encodeDelimited = function encodeDelimited(message, writer) { + DeprecationInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. + * Decodes a DeprecationInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @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.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + * @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 */ - MultiConfidenceMetrics.decode = function decode(reader, length) { + DeprecationInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics(); + 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(); 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())); + message.deprecationTime = $root.google.protobuf.Timestamp.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(); + message.replacementProcessorVersion = reader.string(); break; } default: @@ -89685,247 +94237,174 @@ }; /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. + * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + * @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 */ - MultiConfidenceMetrics.decodeDelimited = function decodeDelimited(reader) { + DeprecationInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MultiConfidenceMetrics message. + * Verifies a DeprecationInfo message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @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 */ - MultiConfidenceMetrics.verify = function verify(message) { + DeprecationInfo.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.deprecationTime != null && message.hasOwnProperty("deprecationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deprecationTime); + if (error) + return "deprecationTime." + 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; - } + if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) + if (!$util.isString(message.replacementProcessorVersion)) + return "replacementProcessorVersion: string expected"; return null; }; /** - * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. + * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo */ - MultiConfidenceMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics) + 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.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; + 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 MultiConfidenceMetrics message. Also converts values to other types if specified. + * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} message MultiConfidenceMetrics + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} message DeprecationInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MultiConfidenceMetrics.toObject = function toObject(message, options) { + DeprecationInfo.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); + object.deprecationTime = null; + object.replacementProcessorVersion = ""; } - 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; + 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 MultiConfidenceMetrics to JSON. + * Converts this DeprecationInfo to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @instance * @returns {Object.} JSON object */ - MultiConfidenceMetrics.prototype.toJSON = function toJSON() { + DeprecationInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MultiConfidenceMetrics + * Gets the default type url for DeprecationInfo * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MultiConfidenceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeprecationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo"; }; - /** - * 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 DeprecationInfo; + })(); - return MultiConfidenceMetrics; + /** + * 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; })(); - return Evaluation; + return ProcessorVersion; })(); - v1beta3.CommonOperationMetadata = (function() { + v1beta3.Processor = (function() { /** - * Properties of a CommonOperationMetadata. + * Properties of a Processor. * @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 + * @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 {string|null} [processEndpoint] Processor processEndpoint + * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime + * @property {string|null} [kmsKeyName] Processor kmsKeyName */ /** - * Constructs a new CommonOperationMetadata. + * Constructs a new Processor. * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a CommonOperationMetadata. - * @implements ICommonOperationMetadata + * @classdesc Represents a Processor. + * @implements IProcessor * @constructor - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.IProcessor=} [properties] Properties to set */ - function CommonOperationMetadata(properties) { + function Processor(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89933,131 +94412,173 @@ } /** - * CommonOperationMetadata state. - * @member {google.cloud.documentai.v1beta3.CommonOperationMetadata.State} state - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * Processor name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.Processor * @instance */ - CommonOperationMetadata.prototype.state = 0; + Processor.prototype.name = ""; /** - * CommonOperationMetadata stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * Processor type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.Processor * @instance */ - CommonOperationMetadata.prototype.stateMessage = ""; + Processor.prototype.type = ""; /** - * CommonOperationMetadata resource. - * @member {string} resource - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * Processor displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.Processor * @instance */ - CommonOperationMetadata.prototype.resource = ""; + Processor.prototype.displayName = ""; /** - * CommonOperationMetadata createTime. + * 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 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.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @instance */ - CommonOperationMetadata.prototype.createTime = null; + Processor.prototype.createTime = null; /** - * CommonOperationMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * Processor kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1beta3.Processor * @instance */ - CommonOperationMetadata.prototype.updateTime = null; + Processor.prototype.kmsKeyName = ""; /** - * Creates a new CommonOperationMetadata instance using the specified properties. + * Creates a new Processor instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @static - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata instance + * @param {google.cloud.documentai.v1beta3.IProcessor=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Processor} Processor instance */ - CommonOperationMetadata.create = function create(properties) { - return new CommonOperationMetadata(properties); + Processor.create = function create(properties) { + return new Processor(properties); }; /** - * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. + * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. * @function encode - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @static - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode + * @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 */ - CommonOperationMetadata.encode = function encode(message, 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 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); + 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 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); + $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); return writer; }; /** - * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. + * 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.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @static - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode + * @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 */ - CommonOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + Processor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer. + * Decodes a Processor message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @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.CommonOperationMetadata} CommonOperationMetadata + * @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 */ - CommonOperationMetadata.decode = function decode(reader, length) { + Processor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.CommonOperationMetadata(); + 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(); switch (tag >>> 3) { case 1: { - message.state = reader.int32(); + message.name = reader.string(); break; } case 2: { - message.stateMessage = reader.string(); + message.type = reader.string(); break; } - case 5: { - message.resource = reader.string(); + case 3: { + message.displayName = reader.string(); break; } - case 3: { + case 4: { + message.state = reader.int32(); + break; + } + case 9: { + message.defaultProcessorVersion = reader.string(); + break; + } + case 6: { + message.processEndpoint = reader.string(); + break; + } + case 7: { message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 8: { + message.kmsKeyName = reader.string(); break; } default: @@ -90069,32 +94590,41 @@ }; /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a Processor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata + * @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 */ - CommonOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + Processor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CommonOperationMetadata message. + * Verifies a Processor message. * @function verify - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @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 */ - CommonOperationMetadata.verify = function verify(message) { + 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: @@ -90105,39 +94635,45 @@ case 3: case 4: case 5: + case 6: + case 7: 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.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + if (!$util.isString(message.defaultProcessorVersion)) + return "defaultProcessorVersion: string expected"; + 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.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; /** - * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Processor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata + * @returns {google.cloud.documentai.v1beta3.Processor} Processor */ - CommonOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.CommonOperationMetadata) + Processor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Processor) return object; - var message = new $root.google.cloud.documentai.v1beta3.CommonOperationMetadata(); + 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") { @@ -90149,155 +94685,172 @@ case 0: message.state = 0; break; - case "RUNNING": + case "ENABLED": case 1: message.state = 1; break; - case "CANCELLING": + case "DISABLED": case 2: message.state = 2; break; - case "SUCCEEDED": + case "ENABLING": case 3: message.state = 3; break; - case "FAILED": + case "DISABLING": case 4: message.state = 4; break; - case "CANCELLED": + 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.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.resource != null) - message.resource = String(object.resource); + if (object.defaultProcessorVersion != null) + message.defaultProcessorVersion = String(object.defaultProcessorVersion); + if (object.processEndpoint != null) + message.processEndpoint = String(object.processEndpoint); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.CommonOperationMetadata.createTime: object expected"); + throw TypeError(".google.cloud.documentai.v1beta3.Processor.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); - } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; /** - * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a Processor message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @static - * @param {google.cloud.documentai.v1beta3.CommonOperationMetadata} message CommonOperationMetadata + * @param {google.cloud.documentai.v1beta3.Processor} message Processor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommonOperationMetadata.toObject = function toObject(message, options) { + Processor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + object.name = ""; + object.type = ""; + object.displayName = ""; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; + object.processEndpoint = ""; object.createTime = null; - object.updateTime = null; - object.resource = ""; + object.kmsKeyName = ""; + object.defaultProcessorVersion = ""; } + 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.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; + 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.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; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + object.defaultProcessorVersion = message.defaultProcessorVersion; return object; }; /** - * Converts this CommonOperationMetadata to JSON. + * Converts this Processor to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @instance * @returns {Object.} JSON object */ - CommonOperationMetadata.prototype.toJSON = function toJSON() { + Processor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CommonOperationMetadata + * Gets the default type url for Processor * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @memberof google.cloud.documentai.v1beta3.Processor * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CommonOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Processor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.CommonOperationMetadata"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Processor"; }; /** * State enum. - * @name google.cloud.documentai.v1beta3.CommonOperationMetadata.State + * @name google.cloud.documentai.v1beta3.Processor.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 + * @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 */ - CommonOperationMetadata.State = (function() { + Processor.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; + 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 CommonOperationMetadata; + return Processor; })(); - v1beta3.ProcessorVersion = (function() { + v1beta3.ProcessorType = (function() { /** - * Properties of a ProcessorVersion. + * Properties of a ProcessorType. * @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 + * @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 ProcessorVersion. + * Constructs a new ProcessorType. * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ProcessorVersion. - * @implements IProcessorVersion + * @classdesc Represents a ProcessorType. + * @implements IProcessorType * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessorVersion=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.IProcessorType=} [properties] Properties to set */ - function ProcessorVersion(properties) { + 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) @@ -90305,160 +94858,132 @@ } /** - * ProcessorVersion name. + * ProcessorType 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 + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance */ - ProcessorVersion.prototype.state = 0; + ProcessorType.prototype.name = ""; /** - * ProcessorVersion createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * ProcessorType type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance */ - ProcessorVersion.prototype.createTime = null; + ProcessorType.prototype.type = ""; /** - * ProcessorVersion latestEvaluation. - * @member {google.cloud.documentai.v1beta3.IEvaluationReference|null|undefined} latestEvaluation - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * ProcessorType category. + * @member {string} category + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance */ - ProcessorVersion.prototype.latestEvaluation = null; + ProcessorType.prototype.category = ""; /** - * ProcessorVersion kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * ProcessorType availableLocations. + * @member {Array.} availableLocations + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance */ - ProcessorVersion.prototype.kmsKeyName = ""; + ProcessorType.prototype.availableLocations = $util.emptyArray; /** - * ProcessorVersion kmsKeyVersionName. - * @member {string} kmsKeyVersionName - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * ProcessorType allowCreation. + * @member {boolean} allowCreation + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance */ - ProcessorVersion.prototype.kmsKeyVersionName = ""; + ProcessorType.prototype.allowCreation = false; /** - * ProcessorVersion googleManaged. - * @member {boolean} googleManaged - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * ProcessorType launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance */ - ProcessorVersion.prototype.googleManaged = false; + ProcessorType.prototype.launchStage = 0; /** - * ProcessorVersion deprecationInfo. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null|undefined} deprecationInfo - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * ProcessorType sampleDocumentUris. + * @member {Array.} sampleDocumentUris + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance */ - ProcessorVersion.prototype.deprecationInfo = null; + ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; /** - * Creates a new ProcessorVersion instance using the specified properties. + * Creates a new ProcessorType instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersion=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion instance + * @param {google.cloud.documentai.v1beta3.IProcessorType=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType instance */ - ProcessorVersion.create = function create(properties) { - return new ProcessorVersion(properties); + ProcessorType.create = function create(properties) { + return new ProcessorType(properties); }; /** - * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. + * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersion} message ProcessorVersion message or plain object to encode + * @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 */ - ProcessorVersion.encode = function encode(message, 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.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.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 ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. + * 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.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersion} message ProcessorVersion message or plain object to encode + * @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 */ - ProcessorVersion.encodeDelimited = function encodeDelimited(message, writer) { + ProcessorType.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProcessorVersion message from the specified reader or buffer. + * Decodes a ProcessorType message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @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.ProcessorVersion} ProcessorVersion + * @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 */ - ProcessorVersion.decode = function decode(reader, length) { + ProcessorType.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion(); + 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(); switch (tag >>> 3) { @@ -90467,39 +94992,31 @@ break; } case 2: { - message.displayName = reader.string(); + message.type = reader.string(); break; } - case 12: { - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); + case 3: { + message.category = reader.string(); break; } - case 6: { - message.state = reader.int32(); + 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 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 6: { + message.allowCreation = reader.bool(); break; } case 8: { - message.latestEvaluation = $root.google.cloud.documentai.v1beta3.EvaluationReference.decode(reader, reader.uint32()); + message.launchStage = reader.int32(); 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()); + if (!(message.sampleDocumentUris && message.sampleDocumentUris.length)) + message.sampleDocumentUris = []; + message.sampleDocumentUris.push(reader.string()); break; } default: @@ -90511,262 +95028,248 @@ }; /** - * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. + * Decodes a ProcessorType message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion + * @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 */ - ProcessorVersion.decodeDelimited = function decodeDelimited(reader) { + ProcessorType.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProcessorVersion message. + * Verifies a ProcessorType message. * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @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 */ - ProcessorVersion.verify = function verify(message) { + 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.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: - break; + 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.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.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 ProcessorVersion message from a plain object. Also converts values to their respective internal types. + * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion + * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType */ - ProcessorVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion) + ProcessorType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorType) return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion(); + var message = new $root.google.cloud.documentai.v1beta3.ProcessorType(); 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); + 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]); + } } - switch (object.state) { + if (object.allowCreation != null) + message.allowCreation = Boolean(object.allowCreation); + switch (object.launchStage) { default: - if (typeof object.state === "number") { - message.state = object.state; + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; break; } break; - case "STATE_UNSPECIFIED": + case "LAUNCH_STAGE_UNSPECIFIED": case 0: - message.state = 0; + message.launchStage = 0; break; - case "DEPLOYED": + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": case 1: - message.state = 1; + message.launchStage = 1; break; - case "DEPLOYING": + case "ALPHA": case 2: - message.state = 2; + message.launchStage = 2; break; - case "UNDEPLOYED": + case "BETA": case 3: - message.state = 3; + message.launchStage = 3; break; - case "UNDEPLOYING": + case "GA": case 4: - message.state = 4; + message.launchStage = 4; break; - case "CREATING": + case "DEPRECATED": case 5: - message.state = 5; - break; - case "DELETING": - case 6: - message.state = 6; - break; - case "FAILED": - case 7: - message.state = 7; + message.launchStage = 5; 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); + 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 ProcessorVersion message. Also converts values to other types if specified. + * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion} message ProcessorVersion + * @param {google.cloud.documentai.v1beta3.ProcessorType} message ProcessorType * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProcessorVersion.toObject = function toObject(message, options) { + 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.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.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.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.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 ProcessorVersion to JSON. + * Converts this ProcessorType to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @instance * @returns {Object.} JSON object */ - ProcessorVersion.prototype.toJSON = function toJSON() { + ProcessorType.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ProcessorVersion + * Gets the default type url for ProcessorType * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorType * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ProcessorVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ProcessorType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorType"; }; - ProcessorVersion.DeprecationInfo = (function() { + ProcessorType.LocationInfo = (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 + * Properties of a LocationInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @interface ILocationInfo + * @property {string|null} [locationId] LocationInfo locationId */ /** - * Constructs a new DeprecationInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @classdesc Represents a DeprecationInfo. - * @implements IDeprecationInfo + * Constructs a new LocationInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set + * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo=} [properties] Properties to set */ - function DeprecationInfo(properties) { + function LocationInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90774,89 +95277,75 @@ } /** - * 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 + * LocationInfo locationId. + * @member {string} locationId + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @instance */ - DeprecationInfo.prototype.replacementProcessorVersion = ""; + LocationInfo.prototype.locationId = ""; /** - * Creates a new DeprecationInfo instance using the specified properties. + * Creates a new LocationInfo instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo instance + * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo instance */ - DeprecationInfo.create = function create(properties) { - return new DeprecationInfo(properties); + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); }; /** - * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * 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.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode + * @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 */ - DeprecationInfo.encode = function encode(message, writer) { + LocationInfo.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); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); return writer; }; /** - * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * 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.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode + * @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 */ - DeprecationInfo.encodeDelimited = function encodeDelimited(message, writer) { + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeprecationInfo message from the specified reader or buffer. + * Decodes a LocationInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @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.ProcessorVersion.DeprecationInfo} DeprecationInfo + * @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 */ - DeprecationInfo.decode = function decode(reader, length) { + LocationInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo(); + 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(); switch (tag >>> 3) { case 1: { - message.deprecationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.replacementProcessorVersion = reader.string(); + message.locationId = reader.string(); break; } default: @@ -90868,346 +95357,572 @@ }; /** - * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo + * @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 */ - DeprecationInfo.decodeDelimited = function decodeDelimited(reader) { + LocationInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeprecationInfo message. + * Verifies a LocationInfo message. * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @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 */ - DeprecationInfo.verify = function verify(message) { + LocationInfo.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"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; return null; }; /** - * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo + * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo */ - DeprecationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + 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.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); + 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 DeprecationInfo message. Also converts values to other types if specified. + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} message DeprecationInfo + * @param {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} message LocationInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeprecationInfo.toObject = function toObject(message, options) { + LocationInfo.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; + if (options.defaults) + object.locationId = ""; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; return object; }; /** - * Converts this DeprecationInfo to JSON. + * Converts this LocationInfo to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @instance * @returns {Object.} JSON object */ - DeprecationInfo.prototype.toJSON = function toJSON() { + LocationInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeprecationInfo + * Gets the default type url for LocationInfo * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeprecationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LocationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorType.LocationInfo"; }; - return DeprecationInfo; + return LocationInfo; })(); + return ProcessorType; + })(); + + v1beta3.DocumentService = (function() { + /** - * 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 + * 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 */ - 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; - return values; - })(); + function DocumentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - return ProcessorVersion; + (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|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; })(); - v1beta3.Processor = (function() { + 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(); + }; /** - * 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 {string|null} [processEndpoint] Processor processEndpoint - * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime - * @property {string|null} [kmsKeyName] Processor kmsKeyName + * 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) { + 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(); + 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; + }; /** - * 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 + * 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 */ - function Processor(properties) { - if (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.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Processor name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance + * 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 */ - Processor.prototype.name = ""; + 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; + }; /** - * Processor type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance + * 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 */ - Processor.prototype.type = ""; + 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; + }; /** - * Processor displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance + * 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 */ - Processor.prototype.displayName = ""; + 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; + }; /** - * Processor state. - * @member {google.cloud.documentai.v1beta3.Processor.State} state - * @memberof google.cloud.documentai.v1beta3.Processor + * Converts this UpdateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest * @instance + * @returns {Object.} JSON object */ - Processor.prototype.state = 0; + UpdateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Processor defaultProcessorVersion. - * @member {string} defaultProcessorVersion - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance + * 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 */ - Processor.prototype.defaultProcessorVersion = ""; + UpdateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetRequest"; + }; + + return UpdateDatasetRequest; + })(); + + v1beta3.UpdateDatasetOperationMetadata = (function() { /** - * Processor processEndpoint. - * @member {string} processEndpoint - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance + * Properties of an UpdateDatasetOperationMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUpdateDatasetOperationMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UpdateDatasetOperationMetadata commonMetadata */ - Processor.prototype.processEndpoint = ""; /** - * Processor createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance + * 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 */ - Processor.prototype.createTime = null; + 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]]; + } /** - * Processor kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1beta3.Processor + * UpdateDatasetOperationMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @instance */ - Processor.prototype.kmsKeyName = ""; + UpdateDatasetOperationMetadata.prototype.commonMetadata = null; /** - * Creates a new Processor instance using the specified properties. + * Creates a new UpdateDatasetOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @static - * @param {google.cloud.documentai.v1beta3.IProcessor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Processor} Processor instance + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata instance */ - Processor.create = function create(properties) { - return new Processor(properties); + UpdateDatasetOperationMetadata.create = function create(properties) { + return new UpdateDatasetOperationMetadata(properties); }; /** - * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. + * Encodes the specified UpdateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.documentai.v1beta3.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @static - * @param {google.cloud.documentai.v1beta3.IProcessor} message Processor message or plain object to encode + * @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 */ - Processor.encode = function encode(message, writer) { + UpdateDatasetOperationMetadata.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.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 Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. + * 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.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @static - * @param {google.cloud.documentai.v1beta3.IProcessor} message Processor message or plain object to encode + * @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 */ - Processor.encodeDelimited = function encodeDelimited(message, writer) { + UpdateDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Processor message from the specified reader or buffer. + * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.Processor + * @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.Processor} Processor + * @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 */ - Processor.decode = function decode(reader, length) { + UpdateDatasetOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.Processor(); + 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(); 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 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(); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -91219,433 +95934,445 @@ }; /** - * Decodes a Processor message from the specified reader or buffer, length delimited. + * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Processor} Processor + * @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 */ - Processor.decodeDelimited = function decodeDelimited(reader) { + UpdateDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Processor message. + * Verifies an UpdateDatasetOperationMetadata message. * @function verify - * @memberof google.cloud.documentai.v1beta3.Processor + * @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 */ - Processor.verify = function verify(message) { + UpdateDatasetOperationMetadata.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.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 (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); if (error) - return "createTime." + error; + return "commonMetadata." + error; } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; return null; }; /** - * Creates a Processor message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Processor} Processor + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata */ - Processor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Processor) + UpdateDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata) 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.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); + 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); } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); return message; }; /** - * Creates a plain object from a Processor message. Also converts values to other types if specified. + * Creates a plain object from an UpdateDatasetOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @static - * @param {google.cloud.documentai.v1beta3.Processor} message Processor + * @param {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} message UpdateDatasetOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Processor.toObject = function toObject(message, options) { + UpdateDatasetOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - 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 = ""; - } - 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 (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 Processor to JSON. + * Converts this UpdateDatasetOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @instance * @returns {Object.} JSON object */ - Processor.prototype.toJSON = function toJSON() { + UpdateDatasetOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Processor + * Gets the default type url for UpdateDatasetOperationMetadata * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Processor + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Processor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateDatasetOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Processor"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata"; }; + return UpdateDatasetOperationMetadata; + })(); + + v1beta3.GetDatasetSchemaRequest = (function() { + /** - * 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 + * Properties of a GetDatasetSchemaRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetDatasetSchemaRequest + * @property {string|null} [name] GetDatasetSchemaRequest name + * @property {boolean|null} [visibleFieldsOnly] GetDatasetSchemaRequest visibleFieldsOnly */ - 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; - })(); + /** + * 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]]; + } - v1beta3.ProcessorType = (function() { + /** + * GetDatasetSchemaRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @instance + */ + GetDatasetSchemaRequest.prototype.name = ""; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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 */ - 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]]; - } + 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; + }; /** - * ProcessorType name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * Converts this GetDatasetSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest * @instance + * @returns {Object.} JSON object */ - ProcessorType.prototype.name = ""; + GetDatasetSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * ProcessorType type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance + * 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 */ - ProcessorType.prototype.type = ""; + GetDatasetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetDatasetSchemaRequest"; + }; - /** - * ProcessorType category. - * @member {string} category - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.category = ""; + return GetDatasetSchemaRequest; + })(); + + v1beta3.UpdateDatasetSchemaRequest = (function() { /** - * ProcessorType availableLocations. - * @member {Array.} availableLocations - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance + * 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 */ - ProcessorType.prototype.availableLocations = $util.emptyArray; /** - * ProcessorType allowCreation. - * @member {boolean} allowCreation - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance + * 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 */ - ProcessorType.prototype.allowCreation = false; + 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]]; + } /** - * ProcessorType launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * UpdateDatasetSchemaRequest datasetSchema. + * @member {google.cloud.documentai.v1beta3.IDatasetSchema|null|undefined} datasetSchema + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @instance */ - ProcessorType.prototype.launchStage = 0; + UpdateDatasetSchemaRequest.prototype.datasetSchema = null; /** - * ProcessorType sampleDocumentUris. - * @member {Array.} sampleDocumentUris - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * UpdateDatasetSchemaRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @instance */ - ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; + UpdateDatasetSchemaRequest.prototype.updateMask = null; /** - * Creates a new ProcessorType instance using the specified properties. + * Creates a new UpdateDatasetSchemaRequest instance using the specified properties. * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @static - * @param {google.cloud.documentai.v1beta3.IProcessorType=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType instance + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest instance */ - ProcessorType.create = function create(properties) { - return new ProcessorType(properties); + UpdateDatasetSchemaRequest.create = function create(properties) { + return new UpdateDatasetSchemaRequest(properties); }; /** - * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. + * Encodes the specified UpdateDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @static - * @param {google.cloud.documentai.v1beta3.IProcessorType} message ProcessorType message or plain object to encode + * @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 */ - ProcessorType.encode = function encode(message, writer) { + UpdateDatasetSchemaRequest.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]); + 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 ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. + * 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.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @static - * @param {google.cloud.documentai.v1beta3.IProcessorType} message ProcessorType message or plain object to encode + * @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 */ - ProcessorType.encodeDelimited = function encodeDelimited(message, writer) { + UpdateDatasetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProcessorType message from the specified reader or buffer. + * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @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.ProcessorType} ProcessorType + * @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 */ - ProcessorType.decode = function decode(reader, length) { + UpdateDatasetSchemaRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.ProcessorType(); + 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(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.datasetSchema = $root.google.cloud.documentai.v1beta3.DatasetSchema.decode(reader, reader.uint32()); 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()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -91657,434 +96384,121 @@ }; /** - * Decodes a ProcessorType message from the specified reader or buffer, length delimited. + * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType + * @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 */ - ProcessorType.decodeDelimited = function decodeDelimited(reader) { + UpdateDatasetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProcessorType message. + * Verifies an UpdateDatasetSchemaRequest message. * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @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 */ - ProcessorType.verify = function verify(message) { + UpdateDatasetSchemaRequest.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.datasetSchema != null && message.hasOwnProperty("datasetSchema")) { + var error = $root.google.cloud.documentai.v1beta3.DatasetSchema.verify(message.datasetSchema); + if (error) + return "datasetSchema." + 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"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest */ - ProcessorType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorType) + UpdateDatasetSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest) 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; + 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.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]); + 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 a ProcessorType message. Also converts values to other types if specified. + * Creates a plain object from an UpdateDatasetSchemaRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @static - * @param {google.cloud.documentai.v1beta3.ProcessorType} message ProcessorType + * @param {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} message UpdateDatasetSchemaRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProcessorType.toObject = function toObject(message, options) { + UpdateDatasetSchemaRequest.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]; + 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 ProcessorType to JSON. + * Converts this UpdateDatasetSchemaRequest to JSON. * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @instance * @returns {Object.} JSON object */ - ProcessorType.prototype.toJSON = function toJSON() { + UpdateDatasetSchemaRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ProcessorType + * Gets the default type url for UpdateDatasetSchemaRequest * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ProcessorType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateDatasetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorType"; + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest"; }; - 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) { - 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(); - 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; + return UpdateDatasetSchemaRequest; })(); return v1beta3; diff --git a/packages/google-cloud-documentai/protos/protos.json b/packages/google-cloud-documentai/protos/protos.json index 97dd1d876fc..d09e96d602f 100644 --- a/packages/google-cloud-documentai/protos/protos.json +++ b/packages/google-cloud-documentai/protos/protos.json @@ -433,6 +433,10 @@ "options": { "deprecated": true } + }, + "styleInfo": { + "type": "StyleInfo", + "id": 5 } }, "nested": { @@ -453,6 +457,70 @@ } } } + }, + "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 + } + } } } }, @@ -509,7 +577,10 @@ }, "provenance": { "type": "Provenance", - "id": 5 + "id": 5, + "options": { + "deprecated": true + } } }, "nested": { @@ -2858,7 +2929,8 @@ "UNDEPLOYING": 4, "CREATING": 5, "DELETING": 6, - "FAILED": 7 + "FAILED": 7, + "IMPORTING": 8 } } } @@ -4803,7 +4875,7 @@ "csharp_namespace": "Google.Cloud.DocumentAI.V1Beta3", "go_package": "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb", "java_multiple_files": true, - "java_outer_classname": "DocumentAiProcessorType", + "java_outer_classname": "DocumentAiDocumentService", "java_package": "com.google.cloud.documentai.v1beta3", "php_namespace": "Google\\Cloud\\DocumentAI\\V1beta3", "ruby_package": "Google::Cloud::DocumentAI::V1beta3", @@ -4827,109 +4899,521 @@ } } }, - "Document": { + "Dataset": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/dataset" + }, "oneofs": { - "source": { + "storageSource": { "oneof": [ - "uri", - "content" + "gcsManagedConfig", + "documentWarehouseConfig", + "unmanagedDatasetConfig" + ] + }, + "indexingSource": { + "oneof": [ + "spannerIndexingConfig" ] } }, "fields": { - "uri": { - "type": "string", - "id": 1, + "gcsManagedConfig": { + "type": "GCSManagedConfig", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "content": { - "type": "bytes", - "id": 2, + "documentWarehouseConfig": { + "type": "DocumentWarehouseConfig", + "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "mimeType": { - "type": "string", - "id": 3 + "unmanagedDatasetConfig": { + "type": "UnmanagedDatasetConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "text": { - "type": "string", + "spannerIndexingConfig": { + "type": "SpannerIndexingConfig", "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "textStyles": { - "rule": "repeated", - "type": "Style", - "id": 5, + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2, "options": { - "deprecated": true + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "GCSManagedConfig": { + "fields": { + "gcsPrefix": { + "type": "GcsPrefix", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } } }, - "pages": { - "rule": "repeated", - "type": "Page", - "id": 6 + "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" + } + } + } }, - "entities": { - "rule": "repeated", - "type": "Entity", - "id": 7 + "UnmanagedDatasetConfig": { + "fields": {} }, - "entityRelations": { - "rule": "repeated", - "type": "EntityRelation", - "id": 8 + "SpannerIndexingConfig": { + "fields": {} }, - "textChanges": { - "rule": "repeated", - "type": "TextChange", - "id": 14 + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "UNINITIALIZED": 1, + "INITIALIZING": 2, + "INITIALIZED": 3 + } + } + } + }, + "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 }, - "shardInfo": { - "type": "ShardInfo", - "id": 9 + "documentSchema": { + "type": "DocumentSchema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RawDocument": { + "fields": { + "content": { + "type": "bytes", + "id": 1 }, - "error": { - "type": "google.rpc.Status", - "id": 10 + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "GcsDocument": { + "fields": { + "gcsUri": { + "type": "string", + "id": 1 }, - "revisions": { + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "GcsDocuments": { + "fields": { + "documents": { "rule": "repeated", - "type": "Revision", - "id": 13 + "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": { - "ShardInfo": { + "GcsOutputConfig": { "fields": { - "shardIndex": { - "type": "int64", + "gcsUri": { + "type": "string", "id": 1 }, - "shardCount": { - "type": "int64", + "fieldMask": { + "type": "google.protobuf.FieldMask", "id": 2 }, - "textOffset": { - "type": "int64", + "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 }, - "Style": { - "fields": { - "textAnchor": { - "type": "TextAnchor", - "id": 1 - }, - "color": { - "type": "google.type.Color", - "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 + } + }, + "nested": { + "Hints": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "PropertyMetadata": { + "fields": { + "inactive": { + "type": "bool", + "id": 3 + } + } + }, + "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 + } + }, + "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 + }, + "entityTypeMetadata": { + "type": "EntityTypeMetadata", + "id": 11 + } + }, + "nested": { + "EnumValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "valueType": { + "type": "string", + "id": 2 + }, + "occurrenceType": { + "type": "OccurrenceType", + "id": 3 + }, + "propertyMetadata": { + "type": "PropertyMetadata", + "id": 5 + } + }, + "nested": { + "OccurrenceType": { + "values": { + "OCCURRENCE_TYPE_UNSPECIFIED": 0, + "OPTIONAL_ONCE": 1, + "OPTIONAL_MULTIPLE": 2, + "REQUIRED_ONCE": 3, + "REQUIRED_MULTIPLE": 4 + } + } + } + } + } + }, + "Metadata": { + "fields": { + "documentSplitter": { + "type": "bool", + "id": 1 + }, + "documentAllowMultipleLabels": { + "type": "bool", + "id": 2 + }, + "prefixedNamingOnProperties": { + "type": "bool", + "id": 6 + }, + "skipNamingValidation": { + "type": "bool", + "id": 7 + } + } + } + } + }, + "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" + } + }, + "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 + } + }, + "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", @@ -5225,6 +5709,10 @@ "options": { "deprecated": true } + }, + "styleInfo": { + "type": "StyleInfo", + "id": 5 } }, "nested": { @@ -5245,6 +5733,70 @@ } } } + }, + "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 + } + } } } }, @@ -5301,7 +5853,10 @@ }, "provenance": { "type": "Provenance", - "id": 5 + "id": 5, + "options": { + "deprecated": true + } } }, "nested": { @@ -5720,9 +6275,6 @@ }, "OperationType": { "valuesOptions": { - "REPLACE": { - "deprecated": true - }, "EVAL_REQUESTED": { "deprecated": true }, @@ -5840,172 +6392,28 @@ } }, "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 - } - } - }, - "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 + "fields": { + "x": { + "type": "float", + "id": 1 }, - "advancedOcrOptions": { + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { "rule": "repeated", - "type": "string", - "id": 5 + "type": "Vertex", + "id": 1 }, - "enableSymbol": { - "type": "bool", - "id": 6 - } - }, - "nested": { - "Hints": { - "fields": { - "languageHints": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 } } }, @@ -7130,7 +7538,18 @@ } }, "TrainProcessorVersionRequest": { + "oneofs": { + "processorFlags": { + "oneof": [ + "customDocumentExtractionOptions" + ] + } + }, "fields": { + "customDocumentExtractionOptions": { + "type": "CustomDocumentExtractionOptions", + "id": 5 + }, "parent": { "type": "string", "id": 1, @@ -7180,6 +7599,23 @@ "id": 4 } } + }, + "CustomDocumentExtractionOptions": { + "fields": { + "trainingMethod": { + "type": "TrainingMethod", + "id": 3 + } + }, + "nested": { + "TrainingMethod": { + "values": { + "TRAINING_METHOD_UNSPECIFIED": 0, + "MODEL_BASED": 1, + "TEMPLATE_BASED": 2 + } + } + } } } }, @@ -7471,120 +7907,6 @@ } } }, - "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 - }, - "valueType": { - "type": "string", - "id": 2 - }, - "occurrenceType": { - "type": "OccurrenceType", - "id": 3 - } - }, - "nested": { - "OccurrenceType": { - "values": { - "OCCURRENCE_TYPE_UNSPECIFIED": 0, - "OPTIONAL_ONCE": 1, - "OPTIONAL_MULTIPLE": 2, - "REQUIRED_ONCE": 3, - "REQUIRED_MULTIPLE": 4 - } - } - } - } - } - }, - "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": { @@ -7877,7 +8199,8 @@ "UNDEPLOYING": 4, "CREATING": 5, "DELETING": 6, - "FAILED": 7 + "FAILED": 7, + "IMPORTING": 8 } } } @@ -7995,6 +8318,134 @@ } } } + }, + "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" + } + } + ] + }, + "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" + } + ] + } + } + }, + "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 + } + } + }, + "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 + } + } } } } diff --git a/packages/google-cloud-documentai/samples/README.md b/packages/google-cloud-documentai/samples/README.md index e6960c83ff5..05eb07ee206 100644 --- a/packages/google-cloud-documentai/samples/README.md +++ b/packages/google-cloud-documentai/samples/README.md @@ -60,8 +60,10 @@ * [Document_processor_service.set_default_processor_version](#document_processor_service.set_default_processor_version) * [Document_processor_service.train_processor_version](#document_processor_service.train_processor_version) * [Document_processor_service.undeploy_processor_version](#document_processor_service.undeploy_processor_version) + * [Document_service.get_dataset_schema](#document_service.get_dataset_schema) + * [Document_service.update_dataset](#document_service.update_dataset) + * [Document_service.update_dataset_schema](#document_service.update_dataset_schema) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -894,16 +896,33 @@ __Usage:__ -### Quickstart +### Document_service.get_dataset_schema -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js,samples/README.md) __Usage:__ -`node packages/google-cloud-documentai/samples/quickstart.js` +`node packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js` + + +----- + + + + +### Document_service.update_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js` ----- @@ -911,16 +930,33 @@ __Usage:__ -### Quickstart.test +### Document_service.update_dataset_schema -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/test/quickstart.test.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/test/quickstart.test.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js,samples/README.md) __Usage:__ -`node packages/google-cloud-documentai/samples/test/quickstart.test.js` +`node packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-documentai/samples/quickstart.js` diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js index 66d311c7eb3..c07cae1348a 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js @@ -38,16 +38,20 @@ function main(name) { */ // const name = 'abc123' /** - * The input documents for batch process. + * The input documents for the + * BatchProcessDocuments google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments + * method. */ // const inputDocuments = {} /** - * The overall output config for batch process. + * The output configuration for the + * BatchProcessDocuments google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments + * method. */ // const documentOutputConfig = {} /** - * Whether Human Review feature should be skipped for this request. Default to - * false. + * Whether human review should be skipped for this request. Default to + * `false`. */ // const skipHumanReview = true diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js index 25c9db58078..870a7de3702 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js @@ -34,9 +34,11 @@ function main(parent, processor) { */ // const parent = 'abc123' /** - * Required. The processor to be created, requires processor_type and - * display_name to be set. Also, the processor is under CMEK if CMEK fields - * are set. + * Required. The processor to be created, requires + * Processor.type google.cloud.documentai.v1.Processor.type and + * 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 = {} diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js index f71aa353b70..756f23fc87b 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js @@ -29,9 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. */ // const parent = 'abc123' diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js index ab88b57a12f..3fe6b477331 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js @@ -37,8 +37,8 @@ function main(parent) { // const parent = 'abc123' /** * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * If unspecified, at most `5` evaluations are returned. + * The maximum value is `100`. Values above `100` are coerced to `100`. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js index de080082ff4..1cfd4ad4a06 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js @@ -29,15 +29,14 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js index b18098fa0ed..ac8136c11a3 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js @@ -36,8 +36,8 @@ function main(parent) { // 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. + * 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 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js index e393b6c32cb..afb3bfd0da0 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js @@ -35,8 +35,8 @@ function main(parent) { // 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. + * 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 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js index 7ff2c94ce45..b01fe1f7a45 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js @@ -50,14 +50,15 @@ function main(name) { */ // const name = 'abc123' /** - * Whether Human Review feature should be skipped for this request. Default to - * false. + * Whether human review should be skipped for this request. Default to + * `false`. */ // const skipHumanReview = true /** - * Specifies which fields to include in ProcessResponse's document. - * Only supports top level document and pages field so it must be in the form - * of `{document_field_name}` or `pages.{page_field_name}`. + * 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 = {} diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js index dcec7f35b65..454e629846f 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js @@ -33,8 +33,9 @@ function main(humanReviewConfig) { */ // const inlineDocument = {} /** - * Required. The resource name of the HumanReviewConfig that the document will - * be reviewed with. + * Required. The resource name of the + * HumanReviewConfig google.cloud.documentai.v1.HumanReviewConfig that the + * document will be reviewed with. */ // const humanReviewConfig = 'abc123' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js index aa75bcfeb20..b759cd16c32 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js @@ -43,7 +43,8 @@ function main(parent, processorVersion) { */ // const documentSchema = {} /** - * Optional. The input data used to train the `ProcessorVersion`. + * Optional. The input data used to train the + * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion. */ // const inputData = {} /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json b/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json index d5a85bb6a3d..5d9e551cd59 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json +++ b/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-documentai", - "version": "7.3.0", + "version": "7.3.1", "language": "TYPESCRIPT", "apis": [ { @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 81, + "end": 82, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 76, "type": "FULL" } ], @@ -123,14 +123,14 @@ "regionTag": "documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_async", "title": "DocumentProcessorService fetchProcessorTypes Sample", "origin": "API_DEFINITION", - "description": " Fetches processor types. Note that we do not use ListProcessorTypes here because it is not paginated.", + "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": 55, + "end": 54, "type": "FULL" } ], @@ -170,7 +170,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 66, "type": "FULL" } ], @@ -339,14 +339,14 @@ "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 cloud_documentai_core.TrainProcessorVersionMetadata.", + "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": 75, + "end": 76, "type": "FULL" } ], @@ -603,14 +603,14 @@ "regionTag": "documentai_v1_generated_DocumentProcessorService_CreateProcessor_async", "title": "DocumentProcessorService createProcessor Sample", "origin": "API_DEFINITION", - "description": " Creates a processor from the type processor that the user chose. The processor will be at \"ENABLED\" state by default after its creation.", + "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.", "canonical": true, "file": "document_processor_service.create_processor.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 61, + "end": 63, "type": "FULL" } ], @@ -818,7 +818,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 72, "type": "FULL" } ], diff --git a/packages/google-cloud-documentai/samples/generated/v1beta1/snippet_metadata.google.cloud.documentai.v1beta1.json b/packages/google-cloud-documentai/samples/generated/v1beta1/snippet_metadata.google.cloud.documentai.v1beta1.json index cb277a4f875..0e4c320fa79 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta1/snippet_metadata.google.cloud.documentai.v1beta1.json +++ b/packages/google-cloud-documentai/samples/generated/v1beta1/snippet_metadata.google.cloud.documentai.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-documentai", - "version": "7.3.0", + "version": "7.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-documentai/samples/generated/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json b/packages/google-cloud-documentai/samples/generated/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json index 23fa81c87e2..b90f05aa71c 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json +++ b/packages/google-cloud-documentai/samples/generated/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-documentai", - "version": "7.3.0", + "version": "7.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js index 1cf7cacce90..9eaaaa3f3d2 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js @@ -46,16 +46,20 @@ function main(name) { */ // const outputConfig = {} /** - * The input documents for batch process. + * The input documents for the + * BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments + * method. */ // const inputDocuments = {} /** - * The overall output config for batch process. + * The output configuration for the + * BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments + * method. */ // const documentOutputConfig = {} /** - * Whether Human Review feature should be skipped for this request. Default to - * false. + * Whether human review should be skipped for this request. Default to + * `false`. */ // const skipHumanReview = true /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js index dfb35ca039f..65a46825348 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js @@ -34,9 +34,11 @@ function main(parent, processor) { */ // const parent = 'abc123' /** - * Required. The processor to be created, requires processor_type and - * display_name to be set. Also, the processor is under CMEK if CMEK fields - * are set. + * Required. The processor to be created, requires + * Processor.type google.cloud.documentai.v1beta3.Processor.type and + * 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 = {} diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js index 20395512e4c..11f84702f29 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js @@ -29,9 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. */ // const parent = 'abc123' diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js index e9342a566b6..5ea49261d75 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js @@ -29,7 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * The source processor version to import from. + * 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' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js index 3b3afbf11f6..c5e9d381fad 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js @@ -37,8 +37,8 @@ function main(parent) { // const parent = 'abc123' /** * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * If unspecified, at most `5` evaluations are returned. + * The maximum value is `100`. Values above `100` are coerced to `100`. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js index 67fb19f766a..3c3a1ad6d55 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js @@ -29,15 +29,14 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js index 0b651091eab..c68358ac285 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js @@ -36,8 +36,8 @@ function main(parent) { // 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. + * 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 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js index 2a8344d6be0..2954af47787 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js @@ -35,8 +35,8 @@ function main(parent) { // 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. + * 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 /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js index b0009d79b55..81a65dc1311 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js @@ -50,18 +50,22 @@ function main(name) { */ // const name = 'abc123' /** - * The document payload, the content and mime_type fields must be set. + * 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 feature should be skipped for this request. Default to - * false. + * Whether human review should be skipped for this request. Default to + * `false`. */ // const skipHumanReview = true /** - * Specifies which fields to include in ProcessResponse's document. - * Only supports top level document and pages field so it must be in the form - * of `{document_field_name}` or `pages.{page_field_name}`. + * 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 = {} /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js index a2fc2cdd1ad..d47a678757c 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js @@ -33,8 +33,9 @@ function main(humanReviewConfig) { */ // const inlineDocument = {} /** - * Required. The resource name of the HumanReviewConfig that the document will - * be reviewed with. + * Required. The resource name of the + * HumanReviewConfig google.cloud.documentai.v1beta3.HumanReviewConfig that + * the document will be reviewed with. */ // const humanReviewConfig = 'abc123' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js index 8c3929417ad..9371d5e326d 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js @@ -28,6 +28,10 @@ function main(parent, processorVersion) { * 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 = {} /** * Required. The parent (project, location and processor) to create the new * version for. Format: @@ -43,7 +47,8 @@ function main(parent, processorVersion) { */ // const documentSchema = {} /** - * Optional. The input data used to train the `ProcessorVersion`. + * Optional. The input data used to train the + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion. */ // const inputData = {} /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js new file mode 100644 index 00000000000..912cc7e92ac --- /dev/null +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js new file mode 100644 index 00000000000..703284e9805 --- /dev/null +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js new file mode 100644 index 00000000000..1fddfa7fbf4 --- /dev/null +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json b/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json index 711dada236f..148efb7a31b 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-documentai", - "version": "7.3.0", + "version": "7.3.1", "language": "TYPESCRIPT", "apis": [ { @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 89, + "end": 93, "type": "FULL" } ], @@ -86,7 +86,7 @@ "segments": [ { "start": 25, - "end": 84, + "end": 88, "type": "FULL" } ], @@ -143,14 +143,14 @@ "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_async", "title": "DocumentProcessorService fetchProcessorTypes Sample", "origin": "API_DEFINITION", - "description": " Fetches processor types. Note that we do not use ListProcessorTypes here because it is not paginated.", + "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": 55, + "end": 54, "type": "FULL" } ], @@ -190,7 +190,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 66, "type": "FULL" } ], @@ -359,14 +359,14 @@ "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 cloud_documentai_core.TrainProcessorVersionMetadata.", + "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": 75, + "end": 80, "type": "FULL" } ], @@ -375,6 +375,10 @@ "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", "async": true, "parameters": [ + { + "name": "custom_document_extraction_options", + "type": ".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions" + }, { "name": "parent", "type": "TYPE_STRING" @@ -623,14 +627,14 @@ "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_async", "title": "DocumentProcessorService createProcessor Sample", "origin": "API_DEFINITION", - "description": " Creates a processor from the type processor that the user chose. The processor will be at \"ENABLED\" state by default after its creation.", + "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.", "canonical": true, "file": "document_processor_service.create_processor.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 61, + "end": 63, "type": "FULL" } ], @@ -838,7 +842,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 76, "type": "FULL" } ], @@ -1030,7 +1034,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 61, "type": "FULL" } ], @@ -1062,6 +1066,138 @@ } } } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_UpdateDataset_async", + "title": "DocumentProcessorService updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates metadata associated with a dataset.", + "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_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" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts b/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts index 19348ba6ef7..b44cbfba955 100644 --- a/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts +++ b/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts @@ -42,7 +42,7 @@ import * as gapicConfig from './document_processor_service_client_config.json'; const version = require('../../../package.json').version; /** - * Service to call Cloud DocumentAI to process documents according to the + * 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. @@ -624,12 +624,13 @@ export class DocumentProcessorServiceClient { * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {boolean} request.skipHumanReview - * Whether Human Review feature should be skipped for this request. Default to - * false. + * Whether human review should be skipped for this request. Default to + * `false`. * @param {google.protobuf.FieldMask} request.fieldMask - * Specifies which fields to include in ProcessResponse's document. - * Only supports top level document and pages field so it must be in the form - * of `{document_field_name}` or `pages.{page_field_name}`. + * Specifies which fields to include in the + * {@link 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 {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -707,15 +708,15 @@ export class DocumentProcessorServiceClient { return this.innerApiCalls.processDocument(request, options, callback); } /** - * Fetches processor types. Note that we do not use ListProcessorTypes here - * because it is not paginated. + * Fetches processor types. Note that we don't use + * {@link 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 project of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. @@ -1068,8 +1069,9 @@ export class DocumentProcessorServiceClient { return this.innerApiCalls.getProcessorVersion(request, options, callback); } /** - * Creates a processor from the type processor that the user chose. - * The processor will be at "ENABLED" state by default after its creation. + * Creates a processor from the + * {@link google.cloud.documentai.v1.ProcessorType|ProcessorType} provided. The + * processor will be at `ENABLED` state by default after its creation. * * @param {Object} request * The request object that will be sent. @@ -1077,9 +1079,11 @@ export class DocumentProcessorServiceClient { * 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 [processor_type] and - * [display_name] to be set. Also, the processor is under CMEK if CMEK fields - * are set. + * Required. The processor to be created, requires + * {@link google.cloud.documentai.v1.Processor.type|Processor.type} and + * {@link |Processor.display_name]} to be set. Also, the + * {@link 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. @@ -1272,12 +1276,16 @@ export class DocumentProcessorServiceClient { * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {google.cloud.documentai.v1.BatchDocumentsInputConfig} request.inputDocuments - * The input documents for batch process. + * The input documents for the + * {@link google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. * @param {google.cloud.documentai.v1.DocumentOutputConfig} request.documentOutputConfig - * The overall output config for batch process. + * The output configuration for the + * {@link google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. * @param {boolean} request.skipHumanReview - * Whether Human Review feature should be skipped for this request. Default to - * false. + * Whether human review should be skipped for this request. Default to + * `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1412,7 +1420,7 @@ export class DocumentProcessorServiceClient { /** * Trains a new processor version. * Operation metadata is returned as - * cloud_documentai_core.TrainProcessorVersionMetadata. + * {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata|TrainProcessorVersionMetadata}. * * @param {Object} request * The request object that will be sent. @@ -1425,7 +1433,8 @@ export class DocumentProcessorServiceClient { * @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 `ProcessorVersion`. + * Optional. The input data used to train the + * {@link 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: @@ -2565,8 +2574,9 @@ export class DocumentProcessorServiceClient { * @param {google.cloud.documentai.v1.Document} request.inlineDocument * An inline document proto. * @param {string} request.humanReviewConfig - * Required. The resource name of the HumanReviewConfig that the document will - * be reviewed with. + * Required. The resource name of the + * {@link 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 @@ -2859,13 +2869,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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] @@ -2961,13 +2970,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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] @@ -3011,13 +3019,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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] @@ -3064,8 +3071,8 @@ export class DocumentProcessorServiceClient { * 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. + * 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. @@ -3166,8 +3173,8 @@ export class DocumentProcessorServiceClient { * 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. + * 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. @@ -3216,8 +3223,8 @@ export class DocumentProcessorServiceClient { * 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. + * 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. @@ -3266,8 +3273,8 @@ export class DocumentProcessorServiceClient { * `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. + * 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. @@ -3369,8 +3376,8 @@ export class DocumentProcessorServiceClient { * `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. + * 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. @@ -3420,8 +3427,8 @@ export class DocumentProcessorServiceClient { * `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. + * 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. @@ -3471,8 +3478,8 @@ export class DocumentProcessorServiceClient { * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * 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. @@ -3575,8 +3582,8 @@ export class DocumentProcessorServiceClient { * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * 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. @@ -3627,8 +3634,8 @@ export class DocumentProcessorServiceClient { * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * 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. diff --git a/packages/google-cloud-documentai/src/v1/document_processor_service_client_config.json b/packages/google-cloud-documentai/src/v1/document_processor_service_client_config.json index 2657b5ec58e..82435251ecd 100644 --- a/packages/google-cloud-documentai/src/v1/document_processor_service_client_config.json +++ b/packages/google-cloud-documentai/src/v1/document_processor_service_client_config.json @@ -21,7 +21,7 @@ }, "methods": { "ProcessDocument": { - "timeout_millis": 120000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, 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 34e15465d3a..18a755831a6 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 @@ -42,7 +42,7 @@ import * as gapicConfig from './document_processor_service_client_config.json'; const version = require('../../../package.json').version; /** - * Service to call Cloud DocumentAI to process documents according to the + * 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. @@ -192,6 +192,12 @@ export class DocumentProcessorServiceClient { // 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}' ), @@ -639,14 +645,18 @@ export class DocumentProcessorServiceClient { * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {google.cloud.documentai.v1beta3.Document} request.document - * The document payload, the [content] and [mime_type] fields must be set. + * The document payload, the + * {@link google.cloud.documentai.v1beta3.Document.content|content} and + * {@link google.cloud.documentai.v1beta3.Document.mime_type|mime_type} fields must + * be set. * @param {boolean} request.skipHumanReview - * Whether Human Review feature should be skipped for this request. Default to - * false. + * Whether human review should be skipped for this request. Default to + * `false`. * @param {google.protobuf.FieldMask} request.fieldMask - * Specifies which fields to include in ProcessResponse's document. - * Only supports top level document and pages field so it must be in the form - * of `{document_field_name}` or `pages.{page_field_name}`. + * Specifies which fields to include in the + * {@link 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 {object} [options] @@ -728,15 +738,15 @@ export class DocumentProcessorServiceClient { return this.innerApiCalls.processDocument(request, options, callback); } /** - * Fetches processor types. Note that we do not use ListProcessorTypes here - * because it is not paginated. + * Fetches processor types. Note that we don't use + * {@link 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 project of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. @@ -1113,8 +1123,9 @@ export class DocumentProcessorServiceClient { return this.innerApiCalls.getProcessorVersion(request, options, callback); } /** - * Creates a processor from the type processor that the user chose. - * The processor will be at "ENABLED" state by default after its creation. + * Creates a processor from the + * {@link google.cloud.documentai.v1beta3.ProcessorType|ProcessorType} provided. + * The processor will be at `ENABLED` state by default after its creation. * * @param {Object} request * The request object that will be sent. @@ -1122,9 +1133,11 @@ export class DocumentProcessorServiceClient { * 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 [processor_type] and - * [display_name] to be set. Also, the processor is under CMEK if CMEK fields - * are set. + * Required. The processor to be created, requires + * {@link google.cloud.documentai.v1beta3.Processor.type|Processor.type} and + * {@link |Processor.display_name]} to be set. Also, the + * {@link 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. @@ -1327,12 +1340,16 @@ export class DocumentProcessorServiceClient { * @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 batch process. + * The input documents for the + * {@link google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig} request.documentOutputConfig - * The overall output config for batch process. + * The output configuration for the + * {@link google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. * @param {boolean} request.skipHumanReview - * Whether Human Review feature should be skipped for this request. Default to - * false. + * 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 {object} [options] @@ -1469,10 +1486,12 @@ export class DocumentProcessorServiceClient { /** * Trains a new processor version. * Operation metadata is returned as - * cloud_documentai_core.TrainProcessorVersionMetadata. + * {@link 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 {string} request.parent * Required. The parent (project, location and processor) to create the new * version for. Format: @@ -1482,7 +1501,8 @@ export class DocumentProcessorServiceClient { * @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 `ProcessorVersion`. + * Optional. The input data used to train the + * {@link 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: @@ -2622,8 +2642,9 @@ export class DocumentProcessorServiceClient { * @param {google.cloud.documentai.v1beta3.Document} request.inlineDocument * An inline document proto. * @param {string} request.humanReviewConfig - * Required. The resource name of the HumanReviewConfig that the document will - * be reviewed with. + * Required. The resource name of the + * {@link 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 @@ -2918,7 +2939,8 @@ export class DocumentProcessorServiceClient { * @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 to import from. The source processor version + * and destination processor need to be in the same environment and region. * @param {string} request.parent * Required. The destination processor name to create the processor version * in. Format: @@ -3064,13 +3086,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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] @@ -3166,13 +3187,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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] @@ -3216,13 +3236,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The location of processor type to list. - * The available processor types may depend on the allow-listing on projects. - * Format: `projects/{project}/locations/{location}` + * 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. + * 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] @@ -3269,8 +3288,8 @@ export class DocumentProcessorServiceClient { * 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. + * 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. @@ -3371,8 +3390,8 @@ export class DocumentProcessorServiceClient { * 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. + * 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. @@ -3421,8 +3440,8 @@ export class DocumentProcessorServiceClient { * 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. + * 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. @@ -3471,8 +3490,8 @@ export class DocumentProcessorServiceClient { * `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. + * 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. @@ -3574,8 +3593,8 @@ export class DocumentProcessorServiceClient { * `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. + * 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. @@ -3625,8 +3644,8 @@ export class DocumentProcessorServiceClient { * `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. + * 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. @@ -3676,8 +3695,8 @@ export class DocumentProcessorServiceClient { * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * 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. @@ -3780,8 +3799,8 @@ export class DocumentProcessorServiceClient { * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * 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. @@ -3832,8 +3851,8 @@ export class DocumentProcessorServiceClient { * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. - * If unspecified, at most 5 evaluations will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. + * 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. @@ -4130,6 +4149,107 @@ export class DocumentProcessorServiceClient { // -- 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. * diff --git a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json index 5bd71049a27..e6b9cc46e4e 100644 --- a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json +++ b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json @@ -21,7 +21,7 @@ }, "methods": { "ProcessDocument": { - "timeout_millis": 120000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, diff --git a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json index 673527d6d32..db4c908da7b 100644 --- a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json +++ b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json @@ -1,9 +1,11 @@ [ "../../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", diff --git a/packages/google-cloud-documentai/src/v1beta3/document_service_client.ts b/packages/google-cloud-documentai/src/v1beta3/document_service_client.ts new file mode 100644 index 00000000000..383e4c9e9ee --- /dev/null +++ b/packages/google-cloud-documentai/src/v1beta3/document_service_client.ts @@ -0,0 +1,1398 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * 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}; + 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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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: 'rest'}, 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; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // 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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.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 !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + 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}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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 === 'rest') { + 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; + + this.descriptors.longrunning = { + updateDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDatasetResponse.decode.bind(updateDatasetResponse), + updateDatasetMetadata.decode.bind(updateDatasetMetadata) + ), + }; + + // 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', + '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.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. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'documentai.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'documentai.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * 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 google.cloud.documentai.v1beta3.DatasetSchema | DatasetSchema}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/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(); + return this.innerApiCalls.getDatasetSchema(request, options, callback); + } + /** + * 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 google.cloud.documentai.v1beta3.DatasetSchema | DatasetSchema}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/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(); + return this.innerApiCalls.updateDatasetSchema(request, options, callback); + } + + /** + * Updates metadata associated with a dataset. + * + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * 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.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateDataset( + request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, + callback: Callback< + LROperation< + protos.google.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + >, + 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(); + return this.innerApiCalls.updateDataset(request, options, callback); + } + /** + * 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * 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< + LROperation< + protos.google.cloud.documentai.v1beta3.Dataset, + protos.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + > + > { + 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< + protos.google.cloud.documentai.v1beta3.Dataset, + protos.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + >; + } + /** + * 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + 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._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-documentai/src/v1beta3/document_service_client_config.json b/packages/google-cloud-documentai/src/v1beta3/document_service_client_config.json new file mode 100644 index 00000000000..e38773c2ff0 --- /dev/null +++ b/packages/google-cloud-documentai/src/v1beta3/document_service_client_config.json @@ -0,0 +1,38 @@ +{ + "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" + }, + "GetDatasetSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDatasetSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-documentai/src/v1beta3/document_service_proto_list.json b/packages/google-cloud-documentai/src/v1beta3/document_service_proto_list.json new file mode 100644 index 00000000000..db4c908da7b --- /dev/null +++ b/packages/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/packages/google-cloud-documentai/src/v1beta3/gapic_metadata.json b/packages/google-cloud-documentai/src/v1beta3/gapic_metadata.json index 1b5e866fb3f..1934b8a8741 100644 --- a/packages/google-cloud-documentai/src/v1beta3/gapic_metadata.json +++ b/packages/google-cloud-documentai/src/v1beta3/gapic_metadata.json @@ -264,6 +264,50 @@ } } } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "GetDatasetSchema": { + "methods": [ + "getDatasetSchema" + ] + }, + "UpdateDatasetSchema": { + "methods": [ + "updateDatasetSchema" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "GetDatasetSchema": { + "methods": [ + "getDatasetSchema" + ] + }, + "UpdateDatasetSchema": { + "methods": [ + "updateDatasetSchema" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + } + } + } + } } } } diff --git a/packages/google-cloud-documentai/src/v1beta3/index.ts b/packages/google-cloud-documentai/src/v1beta3/index.ts index 4b4b7136177..1c7f8e9da61 100644 --- a/packages/google-cloud-documentai/src/v1beta3/index.ts +++ b/packages/google-cloud-documentai/src/v1beta3/index.ts @@ -17,3 +17,4 @@ // ** All changes to this file may be overwritten. ** export {DocumentProcessorServiceClient} from './document_processor_service_client'; +export {DocumentServiceClient} from './document_service_client'; 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 b0242a3e01f..1156fc5691d 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 @@ -5838,6 +5838,140 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { }); describe('Path templates', () => { + describe('dataset', () => { + 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', + } + ); + 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', () => { + 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', + } + ); + 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', () => { const fakePath = '/rendered/path/evaluation'; const expectedParameters = { diff --git a/packages/google-cloud-documentai/test/gapic_document_service_v1beta3.ts b/packages/google-cloud-documentai/test/gapic_document_service_v1beta3.ts new file mode 100644 index 00000000000..8539aa9cd89 --- /dev/null +++ b/packages/google-cloud-documentai/test/gapic_document_service_v1beta3.ts @@ -0,0 +1,1618 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 { + 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 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 servicePath', () => { + const servicePath = + documentserviceModule.v1beta3.DocumentServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + documentserviceModule.v1beta3.DocumentServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + 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(); + assert(client.documentServiceStub); + client.close().then(() => { + done(); + }); + }); + + 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(); + }); + }); + + 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('getDatasetSchema', () => { + it('invokes getDatasetSchema without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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< + protos.google.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.documentai.v1beta3.IDataset, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata + >; + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + } + ); + }); + 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', + }); + 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); + } + } + ); + }); + 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', + }); + 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); + } + } + ); + }); + 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.ListOperationsResponse[] = + []; + 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', + }); + 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.ListOperationsResponse[] = + []; + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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) + ); + }); + }); + }); +});