From bda28336e37ecf417953bbd14a56485e04dae0fe Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 12 Sep 2023 19:50:57 +0000 Subject: [PATCH 1/2] docs: update client libraries for Enterprise OCR add-ons PiperOrigin-RevId: 564763833 Source-Link: https://github.com/googleapis/googleapis/commit/8d03450c69ebcf6e0f71c59436d2a1d4df613ae1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a06479a4aa9fb213db52869bf8188bf31dec8758 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRvY3VtZW50X2FpLXYxYmV0YTMvLk93bEJvdC55YW1sIiwiaCI6ImEwNjQ3OWE0YWE5ZmIyMTNkYjUyODY5YmY4MTg4YmYzMWRlYzg3NTgifQ== --- .../.gitignore | 22 + .../.repo-metadata.json | 19 + .../.rubocop.yml | 33 + .../.yardopts | 12 + .../AUTHENTICATION.md | 151 + .../CHANGELOG.md | 2 + .../google-cloud-document_ai-v1beta3/Gemfile | 3 + .../LICENSE.md | 201 ++ .../README.md | 144 + .../google-cloud-document_ai-v1beta3/Rakefile | 201 ++ .../gapic_metadata.json | 172 ++ .../google-cloud-document_ai-v1beta3.gemspec | 38 + .../lib/google-cloud-document_ai-v1beta3.rb | 21 + .../lib/google/cloud/document_ai/v1beta3.rb | 46 + .../document_ai/v1beta3/bindings_override.rb | 118 + .../v1beta3/document_processor_service.rb | 59 + .../document_processor_service/client.rb | 2742 +++++++++++++++++ .../document_processor_service/credentials.rb | 51 + .../document_processor_service/operations.rb | 779 +++++ .../document_processor_service/paths.rb | 151 + .../document_processor_service/rest.rb | 57 + .../document_processor_service/rest/client.rb | 2560 +++++++++++++++ .../rest/operations.rb | 890 ++++++ .../rest/service_stub.rb | 1433 +++++++++ .../document_ai/v1beta3/document_service.rb | 56 + .../v1beta3/document_service/client.rb | 941 ++++++ .../v1beta3/document_service/credentials.rb | 51 + .../v1beta3/document_service/operations.rb | 779 +++++ .../v1beta3/document_service/paths.rb | 90 + .../v1beta3/document_service/rest.rb | 54 + .../v1beta3/document_service/rest/client.rb | 878 ++++++ .../document_service/rest/operations.rb | 890 ++++++ .../document_service/rest/service_stub.rb | 406 +++ .../google/cloud/document_ai/v1beta3/rest.rb | 39 + .../cloud/document_ai/v1beta3/version.rb | 28 + .../cloud/documentai/v1beta3/barcode_pb.rb | 42 + .../cloud/documentai/v1beta3/dataset_pb.rb | 62 + .../documentai/v1beta3/document_io_pb.rb | 55 + .../cloud/documentai/v1beta3/document_pb.rb | 104 + .../v1beta3/document_processor_service_pb.rb | 135 + .../document_processor_service_services_pb.rb | 107 + .../documentai/v1beta3/document_schema_pb.rb | 49 + .../documentai/v1beta3/document_service_pb.rb | 78 + .../v1beta3/document_service_services_pb.rb | 55 + .../cloud/documentai/v1beta3/evaluation_pb.rb | 52 + .../cloud/documentai/v1beta3/geometry_pb.rb | 44 + .../v1beta3/operation_metadata_pb.rb | 46 + .../cloud/documentai/v1beta3/processor_pb.rb | 55 + .../documentai/v1beta3/processor_type_pb.rb | 46 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 381 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 ++ .../cloud/documentai/v1beta3/barcode.rb | 73 + .../cloud/documentai/v1beta3/dataset.rb | 187 ++ .../cloud/documentai/v1beta3/document.rb | 1071 +++++++ .../cloud/documentai/v1beta3/document_io.rb | 193 ++ .../v1beta3/document_processor_service.rb | 1082 +++++++ .../documentai/v1beta3/document_schema.rb | 186 ++ .../documentai/v1beta3/document_service.rb | 275 ++ .../cloud/documentai/v1beta3/evaluation.rb | 199 ++ .../cloud/documentai/v1beta3/geometry.rb | 65 + .../documentai/v1beta3/operation_metadata.rb | 68 + .../cloud/documentai/v1beta3/processor.rb | 180 ++ .../documentai/v1beta3/processor_type.rb | 66 + .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 121 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/color.rb | 173 ++ .../proto_docs/google/type/date.rb | 53 + .../proto_docs/google/type/datetime.rb | 99 + .../proto_docs/google/type/money.rb | 43 + .../proto_docs/google/type/postal_address.rb | 135 + .../snippets/Gemfile | 32 + .../batch_process_documents.rb | 49 + .../create_processor.rb | 42 + .../delete_processor.rb | 49 + .../delete_processor_version.rb | 49 + .../deploy_processor_version.rb | 49 + .../disable_processor.rb | 49 + .../enable_processor.rb | 49 + .../evaluate_processor_version.rb | 49 + .../fetch_processor_types.rb | 42 + .../get_evaluation.rb | 42 + .../get_processor.rb | 42 + .../get_processor_type.rb | 42 + .../get_processor_version.rb | 42 + .../import_processor_version.rb | 49 + .../list_evaluations.rb | 46 + .../list_processor_types.rb | 46 + .../list_processor_versions.rb | 46 + .../list_processors.rb | 46 + .../process_document.rb | 42 + .../review_document.rb | 49 + .../set_default_processor_version.rb | 49 + .../train_processor_version.rb | 49 + .../undeploy_processor_version.rb | 49 + .../batch_delete_documents.rb | 49 + .../document_service/get_dataset_schema.rb | 42 + .../snippets/document_service/get_document.rb | 42 + .../document_service/import_documents.rb | 49 + .../document_service/update_dataset.rb | 49 + .../document_service/update_dataset_schema.rb | 42 + ...adata_google.cloud.documentai.v1beta3.json | 1175 +++++++ ...ument_processor_service_operations_test.rb | 380 +++ .../document_processor_service_paths_test.rb | 97 + .../document_processor_service_rest_test.rb | 1357 ++++++++ .../document_processor_service_test.rb | 1564 ++++++++++ .../document_service_operations_test.rb | 380 +++ .../v1beta3/document_service_paths_test.rb | 61 + .../v1beta3/document_service_rest_test.rb | 414 +++ .../v1beta3/document_service_test.rb | 459 +++ .../test/helper.rb | 25 + 119 files changed, 28206 insertions(+) create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/README.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore b/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json new file mode 100644 index 000000000000..e4eca1154624 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_id": "us-documentai.googleapis.com", + "api_shortname": "documentai", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest", + "distribution_name": "google-cloud-document_ai-v1beta3", + "is_cloud": true, + "language": "ruby", + "name": "documentai", + "name_pretty": "Document AI V1beta3 API", + "product_documentation": "https://cloud.google.com/document-ai/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details.", + "ruby-cloud-env-prefix": "DOCUMENT_AI", + "ruby-cloud-product-url": "https://cloud.google.com/document-ai/", + "ruby-cloud-namespace-override": "DocumentAi=DocumentAI", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml b/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml new file mode 100644 index 000000000000..945616d355d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-document_ai-v1beta3.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-document_ai-v1beta3.rb" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts b/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts new file mode 100644 index 000000000000..fd21d6f25a32 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Document AI V1beta3 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md new file mode 100644 index 000000000000..ebe733081f48 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md @@ -0,0 +1,151 @@ +# Authentication + +In general, the google-cloud-document_ai-v1beta3 library uses +[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) +credentials to connect to Google Cloud services. When running within +[Google Cloud Platform environments](#google-cloud-platform-environments) the +credentials will be discovered automatically. When running on other +environments, the Service Account credentials can be specified by providing the +path to the +[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) +for the account (or the JSON itself) in +[environment variables](#environment-variables). Additionally, Cloud SDK +credentials can also be discovered automatically, but this is only recommended +during development. + +## Quickstart + +1. [Create a service account and credentials](#creating-a-service-account). +2. Set the [environment variable](#environment-variables). + +```sh +export DOCUMENT_AI_CREDENTIALS=path/to/keyfile.json +``` + +3. Initialize the client. + +```ruby +require "google/cloud/document_ai/v1beta3" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +``` + +## Credential Lookup + +The google-cloud-document_ai-v1beta3 library aims to make authentication +as simple as possible, and provides several mechanisms to configure your system +without requiring **Service Account Credentials** directly in code. + +**Credentials** are discovered in the following order: + +1. Specify credentials in method arguments +2. Specify credentials in configuration +3. Discover credentials path in environment variables +4. Discover credentials JSON in environment variables +5. Discover credentials file in the Cloud SDK's path +6. Discover GCP credentials + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. +Code should be written as if already authenticated. + +### Environment Variables + +The **Credentials JSON** can be placed in environment variables instead of +declaring them directly in code. Each service has its own environment variable, +allowing for different service accounts to be used for different services. (See +the READMEs for the individual service gems for details.) The path to the +**Credentials JSON** file can be stored in the environment variable, or the +**Credentials JSON** itself can be stored for environments such as Docker +containers where writing files is difficult or not encouraged. + +The environment variables that google-cloud-document_ai-v1beta3 +checks for credentials are configured on the service Credentials class (such as +{::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials}): + +* `DOCUMENT_AI_CREDENTIALS` - Path to JSON file, or JSON contents +* `DOCUMENT_AI_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/document_ai/v1beta3" + +ENV["DOCUMENT_AI_CREDENTIALS"] = "path/to/keyfile.json" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +``` + +### Configuration + +The path to the **Credentials JSON** file can be configured instead of storing +it in an environment variable. Either on an individual client initialization: + +```ruby +require "google/cloud/document_ai/v1beta3" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = "path/to/keyfile.json" +end +``` + +Or globally for all clients: + +```ruby +require "google/cloud/document_ai/v1beta3" + +::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| + config.credentials = "path/to/keyfile.json" +end + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +``` + +### Cloud SDK + +This option allows for an easy way to authenticate during development. If +credentials are not provided in code or in environment variables, then Cloud SDK +credentials are discovered. + +To configure your system for this, simply: + +1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) +2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` +3. Write code as if already authenticated. + +**NOTE:** This is _not_ recommended for running in production. The Cloud SDK +*should* only be used during development. + +## Creating a Service Account + +Google Cloud requires **Service Account Credentials** to +connect to the APIs. You will use the **JSON key file** to +connect to most services with google-cloud-document_ai-v1beta3. + +If you are not running this client within +[Google Cloud Platform environments](#google-cloud-platform-environments), you +need a Google Developers service account. + +1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). +2. Create a new project or click on an existing project. +3. Activate the menu in the upper left and select **APIs & Services**. From + here, you will enable the APIs that your application requires. + + *Note: You may need to enable billing in order to use these services.* + +4. Select **Credentials** from the side navigation. + + Find the "Create credentials" drop down near the top of the page, and select + "Service account" to be guided through downloading a new JSON key file. + + If you want to re-use an existing service account, you can easily generate a + new key file. Just select the account you wish to re-use, click the pencil + tool on the right side to edit the service account, select the **Keys** tab, + and then select **Add Key**. + + The key file you download will be used by this library to authenticate API + requests and should be stored in a secure location. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile new file mode 100644 index 000000000000..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md new file mode 100644 index 000000000000..a9540356e91d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Document AI V1beta3 API + +Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML. + +Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Document AI V1beta3 API. Most users should consider using +the main client gem, +[google-cloud-document_ai](https://rubygems.org/gems/google-cloud-document_ai). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-document_ai-v1beta3 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/us-documentai.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/document_ai/v1beta3" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +request = ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new # (request fields as keyword arguments...) +response = client.process_document request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/document-ai/) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-document_ai`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-document_ai-v1beta3`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-document_ai`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-document_ai-v1beta3`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile new file mode 100644 index 000000000000..eefce4d611cb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-document_ai-v1beta3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-document_ai-v1beta3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +end + +# Acceptance tests +desc "Run the google-cloud-document_ai-v1beta3 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["DOCUMENT_AI_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["DOCUMENT_AI_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["DOCUMENT_AI_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or DOCUMENT_AI_TEST_PROJECT=test123 DOCUMENT_AI_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["DOCUMENT_AI_PROJECT"] = project + ENV["DOCUMENT_AI_TEST_PROJECT"] = project + ENV["DOCUMENT_AI_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-document_ai-v1beta3 gem has no acceptance tests." + end + end + + desc "Run acceptance tests with coverage." + task :coverage do + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-document_ai-v1beta3 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-document_ai-v1beta3" + header "google-cloud-document_ai-v1beta3 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-document_ai-v1beta3 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-document_ai-v1beta3 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-document_ai-v1beta3 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-document_ai-v1beta3 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json new file mode 100644 index 000000000000..1134d91d09c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json @@ -0,0 +1,172 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.documentai.v1beta3", + "libraryPackage": "::Google::Cloud::DocumentAI::V1beta3", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client", + "rpcs": { + "ProcessDocument": { + "methods": [ + "process_document" + ] + }, + "BatchProcessDocuments": { + "methods": [ + "batch_process_documents" + ] + }, + "FetchProcessorTypes": { + "methods": [ + "fetch_processor_types" + ] + }, + "ListProcessorTypes": { + "methods": [ + "list_processor_types" + ] + }, + "GetProcessorType": { + "methods": [ + "get_processor_type" + ] + }, + "ListProcessors": { + "methods": [ + "list_processors" + ] + }, + "GetProcessor": { + "methods": [ + "get_processor" + ] + }, + "TrainProcessorVersion": { + "methods": [ + "train_processor_version" + ] + }, + "GetProcessorVersion": { + "methods": [ + "get_processor_version" + ] + }, + "ListProcessorVersions": { + "methods": [ + "list_processor_versions" + ] + }, + "DeleteProcessorVersion": { + "methods": [ + "delete_processor_version" + ] + }, + "DeployProcessorVersion": { + "methods": [ + "deploy_processor_version" + ] + }, + "UndeployProcessorVersion": { + "methods": [ + "undeploy_processor_version" + ] + }, + "CreateProcessor": { + "methods": [ + "create_processor" + ] + }, + "DeleteProcessor": { + "methods": [ + "delete_processor" + ] + }, + "EnableProcessor": { + "methods": [ + "enable_processor" + ] + }, + "DisableProcessor": { + "methods": [ + "disable_processor" + ] + }, + "SetDefaultProcessorVersion": { + "methods": [ + "set_default_processor_version" + ] + }, + "ReviewDocument": { + "methods": [ + "review_document" + ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluate_processor_version" + ] + }, + "GetEvaluation": { + "methods": [ + "get_evaluation" + ] + }, + "ListEvaluations": { + "methods": [ + "list_evaluations" + ] + }, + "ImportProcessorVersion": { + "methods": [ + "import_processor_version" + ] + } + } + } + } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client", + "rpcs": { + "UpdateDataset": { + "methods": [ + "update_dataset" + ] + }, + "ImportDocuments": { + "methods": [ + "import_documents" + ] + }, + "GetDocument": { + "methods": [ + "get_document" + ] + }, + "BatchDeleteDocuments": { + "methods": [ + "batch_delete_documents" + ] + }, + "GetDatasetSchema": { + "methods": [ + "get_dataset_schema" + ] + }, + "UpdateDatasetSchema": { + "methods": [ + "update_dataset_schema" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec b/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec new file mode 100644 index 000000000000..364e7462d316 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec @@ -0,0 +1,38 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/document_ai/v1beta3/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-document_ai-v1beta3" + gem.version = Google::Cloud::DocumentAI::V1beta3::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details." + gem.summary = "Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb new file mode 100644 index 000000000000..8aad94dd490d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/document_ai/v1beta3" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb new file mode 100644 index 000000000000..6e23c80b71c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/document_ai/v1beta3/document_processor_service" +require "google/cloud/document_ai/v1beta3/document_service" +require "google/cloud/document_ai/v1beta3/version" + +module Google + module Cloud + module DocumentAI + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/document_ai/v1beta3" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/document_ai/v1beta3" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + module V1beta3 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta3", "_helpers.rb" +require "google/cloud/document_ai/v1beta3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb new file mode 100644 index 000000000000..f10525932f59 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module DocumentAI + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/document_ai/v1beta3/rest" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + module V1beta3 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DocumentAI"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = Configuration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/uiv1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta3/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/uiv1beta3/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + + ## + # @private + # Configuration class for the google.cloud.documentai.v1beta3 package. + # + # This class contains common configuration for all services + # of the google.cloud.documentai.v1beta3 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb new file mode 100644 index 000000000000..6609f25652fb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/document_ai/v1beta3/version" + +require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" +require "google/cloud/document_ai/v1beta3/document_processor_service/paths" +require "google/cloud/document_ai/v1beta3/document_processor_service/operations" +require "google/cloud/document_ai/v1beta3/document_processor_service/client" +require "google/cloud/document_ai/v1beta3/document_processor_service/rest" + +module Google + module Cloud + module DocumentAI + module V1beta3 + ## + # 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. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/document_ai/v1beta3/document_processor_service" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/document_ai/v1beta3/document_processor_service/rest" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + module DocumentProcessorService + end + end + end + end +end + +helper_path = ::File.join __dir__, "document_processor_service", "helpers.rb" +require "google/cloud/document_ai/v1beta3/document_processor_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb new file mode 100644 index 000000000000..e84e89ebb6a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb @@ -0,0 +1,2742 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + ## + # Client for the DocumentProcessorService service. + # + # Service to call Document AI to process documents according to the + # processor's definition. Processors are built using state-of-the-art Google + # AI such as natural language, computer vision, and translation to extract + # structured information from unstructured or semi-structured documents. + # + class Client + include Paths + + # @private + attr_reader :document_processor_service_stub + + ## + # Configure the DocumentProcessorService Client class. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentProcessorService clients + # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.process_document.timeout = 300.0 + default_config.rpcs.process_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_process_documents.timeout = 120.0 + default_config.rpcs.batch_process_documents.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.review_document.timeout = 120.0 + default_config.rpcs.review_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentProcessorService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new DocumentProcessorService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DocumentProcessorService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @document_processor_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Processes a single document. + # + # @overload process_document(request, options = nil) + # Pass arguments to `process_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil) + # Pass arguments to `process_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # An inline document proto. + # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash] + # A raw document content (bytes). + # @param gcs_document [::Google::Cloud::DocumentAI::V1beta3::GcsDocument, ::Hash] + # A raw document on Google Cloud Storage. + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the + # server will use its [default + # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # The document payload, the + # {::Google::Cloud::DocumentAI::V1beta3::Document#content content} and + # {::Google::Cloud::DocumentAI::V1beta3::Document#mime_type mime_type} fields must + # be set. + # @param skip_human_review [::Boolean] + # Whether human review should be skipped for this request. Default to + # `false`. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Specifies which fields to include in the + # {::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 process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] + # Inference-time options for the process API + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new + # + # # Call the process_document method. + # result = client.process_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. + # p result + # + def process_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.process_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.process_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.process_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :process_document, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # LRO endpoint to batch process many documents. The output is written + # to Cloud Storage as JSON in the [Document] format. + # + # @overload batch_process_documents(request, options = nil) + # Pass arguments to `batch_process_documents` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil) + # Pass arguments to `batch_process_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param input_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, ::Hash>] + # The input config for each single document in the batch process. + # @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash] + # The overall output config for batch process. + # @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] + # The input documents for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} + # method. + # @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash] + # The output configuration for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} + # method. + # @param skip_human_review [::Boolean] + # Whether human review should be skipped for this request. Default to + # `false`. + # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] + # Inference-time options for the process API + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new + # + # # Call the batch_process_documents method. + # result = client.batch_process_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_process_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_process_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_process_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :batch_process_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetches processor types. Note that we don't use + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} + # here, because it isn't paginated. + # + # @overload fetch_processor_types(request, options = nil) + # Pass arguments to `fetch_processor_types` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_processor_types(parent: nil) + # Pass arguments to `fetch_processor_types` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of processor types to list. + # Format: `projects/{project}/locations/{location}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new + # + # # Call the fetch_processor_types method. + # result = client.fetch_processor_types request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. + # p result + # + def fetch_processor_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_processor_types.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_processor_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :fetch_processor_types, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the processor types that exist. + # + # @overload list_processor_types(request, options = nil) + # Pass arguments to `list_processor_types` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_processor_types(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processor_types` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of processor types to list. + # Format: `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of processor types to return. + # If unspecified, at most `100` processor types will be returned. + # The maximum value is `500`. Values above `500` will be coerced to `500`. + # @param page_token [::String] + # Used to retrieve the next page of results, empty if at the end of the list. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new + # + # # Call the list_processor_types method. + # result = client.list_processor_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p item + # end + # + def list_processor_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_processor_types.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_processor_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processor_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_processor_types, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor type detail. + # + # @overload get_processor_type(request, options = nil) + # Pass arguments to `get_processor_type` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_processor_type(name: nil) + # Pass arguments to `get_processor_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor type resource name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new + # + # # Call the get_processor_type method. + # result = client.get_processor_type request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p result + # + def get_processor_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_processor_type.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_processor_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_processor_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_processor_type, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all processors which belong to this project. + # + # @overload list_processors(request, options = nil) + # Pass arguments to `list_processors` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_processors(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processors` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) which owns this collection of + # Processors. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of processors to return. + # If unspecified, at most `50` processors will be returned. + # The maximum value is `100`. Values above `100` will be coerced to `100`. + # @param page_token [::String] + # We will return the processors sorted by creation time. The page token + # will point to the next processor. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new + # + # # Call the list_processors method. + # result = client.list_processors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. + # p item + # end + # + def list_processors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_processors.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_processors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_processors, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processors, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor detail. + # + # @overload get_processor(request, options = nil) + # Pass arguments to `get_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_processor(name: nil) + # Pass arguments to `get_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # + def get_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_processor, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Trains a new processor version. + # Operation metadata is returned as + # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata TrainProcessorVersionMetadata}. + # + # @overload train_processor_version(request, options = nil) + # Pass arguments to `train_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload train_processor_version(custom_document_extraction_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil) + # Pass arguments to `train_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] + # Options to control Custom Document Extraction (CDE) Processor. + # @param parent [::String] + # Required. The parent (project, location and processor) to create the new + # version for. Format: + # `projects/{project}/locations/{location}/processors/{processor}`. + # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash] + # Required. The processor version to be created. + # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] + # Optional. The schema the processor version will be trained with. + # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash] + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # @param base_processor_version [::String] + # Optional. The processor version to use as a base for training. This + # processor version must be a child of `parent`. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + # + # # Call the train_processor_version method. + # result = client.train_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def train_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.train_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.train_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor version detail. + # + # @overload get_processor_version(request, options = nil) + # Pass arguments to `get_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_processor_version(name: nil) + # Pass arguments to `get_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new + # + # # Call the get_processor_version method. + # result = client.get_processor_version request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p result + # + def get_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_processor_version, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all versions of a processor. + # + # @overload list_processor_versions(request, options = nil) + # Pass arguments to `list_processor_versions` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_processor_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processor_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project, location and processor) to list all + # versions. Format: + # `projects/{project}/locations/{location}/processors/{processor}` + # @param page_size [::Integer] + # The maximum number of processor versions to return. + # If unspecified, at most `10` processor versions will be returned. + # The maximum value is `20`. Values above `20` will be coerced to `20`. + # @param page_token [::String] + # We will return the processor versions sorted by creation time. The page + # token will point to the next processor version. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new + # + # # Call the list_processor_versions method. + # result = client.list_processor_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p item + # end + # + def list_processor_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_processor_versions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_processor_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processor_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_processor_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the processor version, all artifacts under the processor version + # will be deleted. + # + # @overload delete_processor_version(request, options = nil) + # Pass arguments to `delete_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_processor_version(name: nil) + # Pass arguments to `delete_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new + # + # # Call the delete_processor_version method. + # result = client.delete_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :delete_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deploys the processor version. + # + # @overload deploy_processor_version(request, options = nil) + # Pass arguments to `deploy_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload deploy_processor_version(name: nil) + # Pass arguments to `deploy_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be deployed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new + # + # # Call the deploy_processor_version method. + # result = client.deploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def deploy_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.deploy_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.deploy_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :deploy_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeploys the processor version. + # + # @overload undeploy_processor_version(request, options = nil) + # Pass arguments to `undeploy_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undeploy_processor_version(name: nil) + # Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be undeployed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new + # + # # Call the undeploy_processor_version method. + # result = client.undeploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undeploy_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.undeploy_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.undeploy_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undeploy_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :undeploy_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a processor from the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorType ProcessorType} provided. + # The processor will be at `ENABLED` state by default after its creation. + # + # @overload create_processor(request, options = nil) + # Pass arguments to `create_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_processor(parent: nil, processor: nil) + # Pass arguments to `create_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` + # @param processor [::Google::Cloud::DocumentAI::V1beta3::Processor, ::Hash] + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1beta3::Processor#type Processor.type} and + # [Processor.display_name]][] to be set. Also, the + # {::Google::Cloud::DocumentAI::V1beta3::Processor#kms_key_name Processor.kms_key_name} + # field must be set if the processor is under CMEK. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # + def create_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :create_processor, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the processor, unloads all deployed model artifacts if it was + # enabled and then deletes all artifacts associated with this processor. + # + # @overload delete_processor(request, options = nil) + # Pass arguments to `delete_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_processor(name: nil) + # Pass arguments to `delete_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new + # + # # Call the delete_processor method. + # result = client.delete_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :delete_processor, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a processor + # + # @overload enable_processor(request, options = nil) + # Pass arguments to `enable_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_processor(name: nil) + # Pass arguments to `enable_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be enabled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new + # + # # Call the enable_processor method. + # result = client.enable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def enable_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :enable_processor, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a processor + # + # @overload disable_processor(request, options = nil) + # Pass arguments to `disable_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_processor(name: nil) + # Pass arguments to `disable_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be disabled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new + # + # # Call the disable_processor method. + # result = client.disable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def disable_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :disable_processor, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Set the default (active) version of a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} that will be used in + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} + # and + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. + # + # @overload set_default_processor_version(request, options = nil) + # Pass arguments to `set_default_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_default_processor_version(processor: nil, default_processor_version: nil) + # Pass arguments to `set_default_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default + # version. + # @param default_processor_version [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use + # as default. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new + # + # # Call the set_default_processor_version method. + # result = client.set_default_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def set_default_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_default_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.processor + header_params["processor"] = request.processor + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_default_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_default_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :set_default_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Send a document for Human Review. The input document should be processed by + # the specified processor. + # + # @overload review_document(request, options = nil) + # Pass arguments to `review_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload review_document(inline_document: nil, human_review_config: nil, document: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) + # Pass arguments to `review_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # An inline document proto. + # @param human_review_config [::String] + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1beta3.HumanReviewConfig] that + # the document will be reviewed with. + # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # The document that needs human review. + # @param enable_schema_validation [::Boolean] + # Whether the validation should be performed on the ad-hoc review request. + # @param priority [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] + # The document schema of the human review task. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new + # + # # Call the review_document method. + # result = client.review_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def review_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.review_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.human_review_config + header_params["human_review_config"] = request.human_review_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.review_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.review_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :review_document, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + # + # @overload evaluate_processor_version(request, options = nil) + # Pass arguments to `evaluate_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil) + # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor_version [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] + # Optional. The documents used in the evaluation. If unspecified, use the + # processor's dataset as evaluation input. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + # + # # Call the evaluate_processor_version method. + # result = client.evaluate_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def evaluate_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.evaluate_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.processor_version + header_params["processor_version"] = request.processor_version + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.evaluate_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a specific evaluation. + # + # @overload get_evaluation(request, options = nil) + # Pass arguments to `get_evaluation` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_evaluation(name: nil) + # Pass arguments to `get_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p result + # + def get_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_evaluation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a set of evaluations for a given processor version. + # + # @overload list_evaluations(request, options = nil) + # Pass arguments to `list_evaluations` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_evaluations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # list evaluations for. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param page_size [::Integer] + # The standard list page size. + # If unspecified, at most `5` evaluations are returned. + # The maximum value is `100`. Values above `100` are coerced to `100`. + # @param page_token [::String] + # A page token, received from a previous `ListEvaluations` call. + # Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + # + # # Call the list_evaluations method. + # result = client.list_evaluations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p item + # end + # + def list_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_evaluations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports a processor version from source processor version. + # + # @overload import_processor_version(request, options = nil) + # Pass arguments to `import_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_processor_version(processor_version_source: nil, external_processor_version_source: nil, parent: nil) + # Pass arguments to `import_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor_version_source [::String] + # The source processor version to import from. The source processor version + # and destination processor need to be in the same environment and region. + # @param external_processor_version_source [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource, ::Hash] + # The source processor version to import from, and can be from different + # environment and region than the destination processor. + # @param parent [::String] + # Required. The destination processor name to create the processor version + # in. Format: + # `projects/{project}/locations/{location}/processors/{processor}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new + # + # # Call the import_processor_version method. + # result = client.import_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :import_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DocumentProcessorService API. + # + # This class represents the configuration for DocumentProcessorService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # process_document to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DocumentProcessorService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `process_document` + # @return [::Gapic::Config::Method] + # + attr_reader :process_document + ## + # RPC-specific configuration for `batch_process_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_process_documents + ## + # RPC-specific configuration for `fetch_processor_types` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_processor_types + ## + # RPC-specific configuration for `list_processor_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processor_types + ## + # RPC-specific configuration for `get_processor_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor_type + ## + # RPC-specific configuration for `list_processors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processors + ## + # RPC-specific configuration for `get_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor + ## + # RPC-specific configuration for `train_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :train_processor_version + ## + # RPC-specific configuration for `get_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor_version + ## + # RPC-specific configuration for `list_processor_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processor_versions + ## + # RPC-specific configuration for `delete_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_processor_version + ## + # RPC-specific configuration for `deploy_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_processor_version + ## + # RPC-specific configuration for `undeploy_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_processor_version + ## + # RPC-specific configuration for `create_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :create_processor + ## + # RPC-specific configuration for `delete_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_processor + ## + # RPC-specific configuration for `enable_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_processor + ## + # RPC-specific configuration for `disable_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_processor + ## + # RPC-specific configuration for `set_default_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :set_default_processor_version + ## + # RPC-specific configuration for `review_document` + # @return [::Gapic::Config::Method] + # + attr_reader :review_document + ## + # RPC-specific configuration for `evaluate_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :evaluate_processor_version + ## + # RPC-specific configuration for `get_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_evaluation + ## + # RPC-specific configuration for `list_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_evaluations + ## + # RPC-specific configuration for `import_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :import_processor_version + + # @private + def initialize parent_rpcs = nil + process_document_config = parent_rpcs.process_document if parent_rpcs.respond_to? :process_document + @process_document = ::Gapic::Config::Method.new process_document_config + batch_process_documents_config = parent_rpcs.batch_process_documents if parent_rpcs.respond_to? :batch_process_documents + @batch_process_documents = ::Gapic::Config::Method.new batch_process_documents_config + fetch_processor_types_config = parent_rpcs.fetch_processor_types if parent_rpcs.respond_to? :fetch_processor_types + @fetch_processor_types = ::Gapic::Config::Method.new fetch_processor_types_config + list_processor_types_config = parent_rpcs.list_processor_types if parent_rpcs.respond_to? :list_processor_types + @list_processor_types = ::Gapic::Config::Method.new list_processor_types_config + get_processor_type_config = parent_rpcs.get_processor_type if parent_rpcs.respond_to? :get_processor_type + @get_processor_type = ::Gapic::Config::Method.new get_processor_type_config + list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors + @list_processors = ::Gapic::Config::Method.new list_processors_config + get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor + @get_processor = ::Gapic::Config::Method.new get_processor_config + train_processor_version_config = parent_rpcs.train_processor_version if parent_rpcs.respond_to? :train_processor_version + @train_processor_version = ::Gapic::Config::Method.new train_processor_version_config + get_processor_version_config = parent_rpcs.get_processor_version if parent_rpcs.respond_to? :get_processor_version + @get_processor_version = ::Gapic::Config::Method.new get_processor_version_config + list_processor_versions_config = parent_rpcs.list_processor_versions if parent_rpcs.respond_to? :list_processor_versions + @list_processor_versions = ::Gapic::Config::Method.new list_processor_versions_config + delete_processor_version_config = parent_rpcs.delete_processor_version if parent_rpcs.respond_to? :delete_processor_version + @delete_processor_version = ::Gapic::Config::Method.new delete_processor_version_config + deploy_processor_version_config = parent_rpcs.deploy_processor_version if parent_rpcs.respond_to? :deploy_processor_version + @deploy_processor_version = ::Gapic::Config::Method.new deploy_processor_version_config + undeploy_processor_version_config = parent_rpcs.undeploy_processor_version if parent_rpcs.respond_to? :undeploy_processor_version + @undeploy_processor_version = ::Gapic::Config::Method.new undeploy_processor_version_config + create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor + @create_processor = ::Gapic::Config::Method.new create_processor_config + delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor + @delete_processor = ::Gapic::Config::Method.new delete_processor_config + enable_processor_config = parent_rpcs.enable_processor if parent_rpcs.respond_to? :enable_processor + @enable_processor = ::Gapic::Config::Method.new enable_processor_config + disable_processor_config = parent_rpcs.disable_processor if parent_rpcs.respond_to? :disable_processor + @disable_processor = ::Gapic::Config::Method.new disable_processor_config + set_default_processor_version_config = parent_rpcs.set_default_processor_version if parent_rpcs.respond_to? :set_default_processor_version + @set_default_processor_version = ::Gapic::Config::Method.new set_default_processor_version_config + review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document + @review_document = ::Gapic::Config::Method.new review_document_config + evaluate_processor_version_config = parent_rpcs.evaluate_processor_version if parent_rpcs.respond_to? :evaluate_processor_version + @evaluate_processor_version = ::Gapic::Config::Method.new evaluate_processor_version_config + get_evaluation_config = parent_rpcs.get_evaluation if parent_rpcs.respond_to? :get_evaluation + @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config + list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations + @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config + import_processor_version_config = parent_rpcs.import_processor_version if parent_rpcs.respond_to? :import_processor_version + @import_processor_version = ::Gapic::Config::Method.new import_processor_version_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb new file mode 100644 index 000000000000..75ae5a98a886 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Credentials for the DocumentProcessorService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DOCUMENT_AI_CREDENTIALS", + "DOCUMENT_AI_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DOCUMENT_AI_CREDENTIALS_JSON", + "DOCUMENT_AI_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb new file mode 100644 index 000000000000..e9104f254115 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb @@ -0,0 +1,779 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the DocumentProcessorService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentProcessorService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 + # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb new file mode 100644 index 000000000000..bd199612e369 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Path helper methods for the DocumentProcessorService API. + module Paths + ## + # Create a fully-qualified Evaluation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # @param processor_version [String] + # @param evaluation [String] + # + # @return [::String] + def evaluation_path project:, location:, processor:, processor_version:, evaluation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" + raise ::ArgumentError, "processor_version cannot contain /" if processor_version.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}/evaluations/#{evaluation}" + end + + ## + # Create a fully-qualified HumanReviewConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # + # @return [::String] + def human_review_config_path project:, location:, processor: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/humanReviewConfig" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Processor resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # + # @return [::String] + def processor_path project:, location:, processor: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}" + end + + ## + # Create a fully-qualified ProcessorType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processorTypes/{processor_type}` + # + # @param project [String] + # @param location [String] + # @param processor_type [String] + # + # @return [::String] + def processor_type_path project:, location:, processor_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processorTypes/#{processor_type}" + end + + ## + # Create a fully-qualified ProcessorVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # @param processor_version [String] + # + # @return [::String] + def processor_version_path project:, location:, processor:, processor_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb new file mode 100644 index 000000000000..26f2fc6e52bb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/document_ai/v1beta3/version" +require "google/cloud/document_ai/v1beta3/bindings_override" + +require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" +require "google/cloud/document_ai/v1beta3/document_processor_service/paths" +require "google/cloud/document_ai/v1beta3/document_processor_service/rest/operations" +require "google/cloud/document_ai/v1beta3/document_processor_service/rest/client" + +module Google + module Cloud + module DocumentAI + module V1beta3 + ## + # 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. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/document_ai/v1beta3/document_processor_service/rest" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + module DocumentProcessorService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/document_ai/v1beta3/document_processor_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb new file mode 100644 index 000000000000..d7db1cf29d3e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb @@ -0,0 +1,2560 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + module Rest + ## + # REST client for the DocumentProcessorService service. + # + # Service to call Document AI to process documents according to the + # processor's definition. Processors are built using state-of-the-art Google + # AI such as natural language, computer vision, and translation to extract + # structured information from unstructured or semi-structured documents. + # + class Client + include Paths + + # @private + attr_reader :document_processor_service_stub + + ## + # Configure the DocumentProcessorService Client class. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentProcessorService clients + # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.process_document.timeout = 300.0 + default_config.rpcs.process_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_process_documents.timeout = 120.0 + default_config.rpcs.batch_process_documents.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.review_document.timeout = 120.0 + default_config.rpcs.review_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentProcessorService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new DocumentProcessorService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DocumentProcessorService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.bindings_override = @config.bindings_override + end + + @document_processor_service_stub = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Processes a single document. + # + # @overload process_document(request, options = nil) + # Pass arguments to `process_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil) + # Pass arguments to `process_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # An inline document proto. + # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash] + # A raw document content (bytes). + # @param gcs_document [::Google::Cloud::DocumentAI::V1beta3::GcsDocument, ::Hash] + # A raw document on Google Cloud Storage. + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the + # server will use its [default + # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # The document payload, the + # {::Google::Cloud::DocumentAI::V1beta3::Document#content content} and + # {::Google::Cloud::DocumentAI::V1beta3::Document#mime_type mime_type} fields must + # be set. + # @param skip_human_review [::Boolean] + # Whether human review should be skipped for this request. Default to + # `false`. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Specifies which fields to include in the + # {::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 process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] + # Inference-time options for the process API + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new + # + # # Call the process_document method. + # result = client.process_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. + # p result + # + def process_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.process_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.process_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.process_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.process_document request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # LRO endpoint to batch process many documents. The output is written + # to Cloud Storage as JSON in the [Document] format. + # + # @overload batch_process_documents(request, options = nil) + # Pass arguments to `batch_process_documents` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil) + # Pass arguments to `batch_process_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param input_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, ::Hash>] + # The input config for each single document in the batch process. + # @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash] + # The overall output config for batch process. + # @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] + # The input documents for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments} + # method. + # @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash] + # The output configuration for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments} + # method. + # @param skip_human_review [::Boolean] + # Whether human review should be skipped for this request. Default to + # `false`. + # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] + # Inference-time options for the process API + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new + # + # # Call the batch_process_documents method. + # result = client.batch_process_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_process_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_process_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_process_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.batch_process_documents request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetches processor types. Note that we don't use + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#list_processor_types ListProcessorTypes} + # here, because it isn't paginated. + # + # @overload fetch_processor_types(request, options = nil) + # Pass arguments to `fetch_processor_types` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_processor_types(parent: nil) + # Pass arguments to `fetch_processor_types` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of processor types to list. + # Format: `projects/{project}/locations/{location}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new + # + # # Call the fetch_processor_types method. + # result = client.fetch_processor_types request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. + # p result + # + def fetch_processor_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fetch_processor_types.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_processor_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.fetch_processor_types request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the processor types that exist. + # + # @overload list_processor_types(request, options = nil) + # Pass arguments to `list_processor_types` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_processor_types(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processor_types` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of processor types to list. + # Format: `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of processor types to return. + # If unspecified, at most `100` processor types will be returned. + # The maximum value is `500`. Values above `500` will be coerced to `500`. + # @param page_token [::String] + # Used to retrieve the next page of results, empty if at the end of the list. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new + # + # # Call the list_processor_types method. + # result = client.list_processor_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p item + # end + # + def list_processor_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_processor_types.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_processor_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_processor_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.list_processor_types request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, "processor_types", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor type detail. + # + # @overload get_processor_type(request, options = nil) + # Pass arguments to `get_processor_type` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_processor_type(name: nil) + # Pass arguments to `get_processor_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor type resource name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new + # + # # Call the get_processor_type method. + # result = client.get_processor_type request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p result + # + def get_processor_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_processor_type.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_processor_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_processor_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.get_processor_type request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all processors which belong to this project. + # + # @overload list_processors(request, options = nil) + # Pass arguments to `list_processors` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_processors(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processors` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) which owns this collection of + # Processors. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of processors to return. + # If unspecified, at most `50` processors will be returned. + # The maximum value is `100`. Values above `100` will be coerced to `100`. + # @param page_token [::String] + # We will return the processors sorted by creation time. The page token + # will point to the next processor. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new + # + # # Call the list_processors method. + # result = client.list_processors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. + # p item + # end + # + def list_processors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_processors.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_processors.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_processors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.list_processors request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processors, "processors", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor detail. + # + # @overload get_processor(request, options = nil) + # Pass arguments to `get_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_processor(name: nil) + # Pass arguments to `get_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # + def get_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.get_processor request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Trains a new processor version. + # Operation metadata is returned as + # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata TrainProcessorVersionMetadata}. + # + # @overload train_processor_version(request, options = nil) + # Pass arguments to `train_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload train_processor_version(custom_document_extraction_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil) + # Pass arguments to `train_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] + # Options to control Custom Document Extraction (CDE) Processor. + # @param parent [::String] + # Required. The parent (project, location and processor) to create the new + # version for. Format: + # `projects/{project}/locations/{location}/processors/{processor}`. + # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash] + # Required. The processor version to be created. + # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] + # Optional. The schema the processor version will be trained with. + # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash] + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # @param base_processor_version [::String] + # Optional. The processor version to use as a base for training. This + # processor version must be a child of `parent`. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + # + # # Call the train_processor_version method. + # result = client.train_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def train_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.train_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.train_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.train_processor_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor version detail. + # + # @overload get_processor_version(request, options = nil) + # Pass arguments to `get_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_processor_version(name: nil) + # Pass arguments to `get_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new + # + # # Call the get_processor_version method. + # result = client.get_processor_version request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p result + # + def get_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.get_processor_version request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all versions of a processor. + # + # @overload list_processor_versions(request, options = nil) + # Pass arguments to `list_processor_versions` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_processor_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processor_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project, location and processor) to list all + # versions. Format: + # `projects/{project}/locations/{location}/processors/{processor}` + # @param page_size [::Integer] + # The maximum number of processor versions to return. + # If unspecified, at most `10` processor versions will be returned. + # The maximum value is `20`. Values above `20` will be coerced to `20`. + # @param page_token [::String] + # We will return the processor versions sorted by creation time. The page + # token will point to the next processor version. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new + # + # # Call the list_processor_versions method. + # result = client.list_processor_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p item + # end + # + def list_processor_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_processor_versions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_processor_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_processor_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.list_processor_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, "processor_versions", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the processor version, all artifacts under the processor version + # will be deleted. + # + # @overload delete_processor_version(request, options = nil) + # Pass arguments to `delete_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_processor_version(name: nil) + # Pass arguments to `delete_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new + # + # # Call the delete_processor_version method. + # result = client.delete_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.delete_processor_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deploys the processor version. + # + # @overload deploy_processor_version(request, options = nil) + # Pass arguments to `deploy_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload deploy_processor_version(name: nil) + # Pass arguments to `deploy_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be deployed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new + # + # # Call the deploy_processor_version method. + # result = client.deploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def deploy_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.deploy_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.deploy_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deploy_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.deploy_processor_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeploys the processor version. + # + # @overload undeploy_processor_version(request, options = nil) + # Pass arguments to `undeploy_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undeploy_processor_version(name: nil) + # Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be undeployed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new + # + # # Call the undeploy_processor_version method. + # result = client.undeploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undeploy_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.undeploy_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.undeploy_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undeploy_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.undeploy_processor_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a processor from the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorType ProcessorType} provided. + # The processor will be at `ENABLED` state by default after its creation. + # + # @overload create_processor(request, options = nil) + # Pass arguments to `create_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_processor(parent: nil, processor: nil) + # Pass arguments to `create_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` + # @param processor [::Google::Cloud::DocumentAI::V1beta3::Processor, ::Hash] + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1beta3::Processor#type Processor.type} and + # [Processor.display_name]][] to be set. Also, the + # {::Google::Cloud::DocumentAI::V1beta3::Processor#kms_key_name Processor.kms_key_name} + # field must be set if the processor is under CMEK. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # + def create_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.create_processor request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the processor, unloads all deployed model artifacts if it was + # enabled and then deletes all artifacts associated with this processor. + # + # @overload delete_processor(request, options = nil) + # Pass arguments to `delete_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_processor(name: nil) + # Pass arguments to `delete_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new + # + # # Call the delete_processor method. + # result = client.delete_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.delete_processor request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a processor + # + # @overload enable_processor(request, options = nil) + # Pass arguments to `enable_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_processor(name: nil) + # Pass arguments to `enable_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be enabled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new + # + # # Call the enable_processor method. + # result = client.enable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def enable_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.enable_processor request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a processor + # + # @overload disable_processor(request, options = nil) + # Pass arguments to `disable_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_processor(name: nil) + # Pass arguments to `disable_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be disabled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new + # + # # Call the disable_processor method. + # result = client.disable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def disable_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.disable_processor request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Set the default (active) version of a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} that will be used in + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#process_document ProcessDocument} + # and + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments}. + # + # @overload set_default_processor_version(request, options = nil) + # Pass arguments to `set_default_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_default_processor_version(processor: nil, default_processor_version: nil) + # Pass arguments to `set_default_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default + # version. + # @param default_processor_version [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use + # as default. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new + # + # # Call the set_default_processor_version method. + # result = client.set_default_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def set_default_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_default_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_default_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_default_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.set_default_processor_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Send a document for Human Review. The input document should be processed by + # the specified processor. + # + # @overload review_document(request, options = nil) + # Pass arguments to `review_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload review_document(inline_document: nil, human_review_config: nil, document: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) + # Pass arguments to `review_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # An inline document proto. + # @param human_review_config [::String] + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1beta3.HumanReviewConfig] that + # the document will be reviewed with. + # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # The document that needs human review. + # @param enable_schema_validation [::Boolean] + # Whether the validation should be performed on the ad-hoc review request. + # @param priority [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] + # The document schema of the human review task. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new + # + # # Call the review_document method. + # result = client.review_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def review_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.review_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.review_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.review_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.review_document request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + # + # @overload evaluate_processor_version(request, options = nil) + # Pass arguments to `evaluate_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil) + # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor_version [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] + # Optional. The documents used in the evaluation. If unspecified, use the + # processor's dataset as evaluation input. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + # + # # Call the evaluate_processor_version method. + # result = client.evaluate_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def evaluate_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.evaluate_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.evaluate_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.evaluate_processor_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a specific evaluation. + # + # @overload get_evaluation(request, options = nil) + # Pass arguments to `get_evaluation` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_evaluation(name: nil) + # Pass arguments to `get_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p result + # + def get_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_evaluation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.get_evaluation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a set of evaluations for a given processor version. + # + # @overload list_evaluations(request, options = nil) + # Pass arguments to `list_evaluations` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_evaluations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # list evaluations for. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param page_size [::Integer] + # The standard list page size. + # If unspecified, at most `5` evaluations are returned. + # The maximum value is `100`. Values above `100` are coerced to `100`. + # @param page_token [::String] + # A page token, received from a previous `ListEvaluations` call. + # Provide this to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + # + # # Call the list_evaluations method. + # result = client.list_evaluations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p item + # end + # + def list_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_evaluations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.list_evaluations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, "evaluations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports a processor version from source processor version. + # + # @overload import_processor_version(request, options = nil) + # Pass arguments to `import_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_processor_version(processor_version_source: nil, external_processor_version_source: nil, parent: nil) + # Pass arguments to `import_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor_version_source [::String] + # The source processor version to import from. The source processor version + # and destination processor need to be in the same environment and region. + # @param external_processor_version_source [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource, ::Hash] + # The source processor version to import from, and can be from different + # environment and region than the destination processor. + # @param parent [::String] + # Required. The destination processor name to create the processor version + # in. Format: + # `projects/{project}/locations/{location}/processors/{processor}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new + # + # # Call the import_processor_version method. + # result = client.import_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_processor_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.import_processor_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DocumentProcessorService REST API. + # + # This class represents the configuration for DocumentProcessorService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # process_document to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DocumentProcessorService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `process_document` + # @return [::Gapic::Config::Method] + # + attr_reader :process_document + ## + # RPC-specific configuration for `batch_process_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_process_documents + ## + # RPC-specific configuration for `fetch_processor_types` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_processor_types + ## + # RPC-specific configuration for `list_processor_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processor_types + ## + # RPC-specific configuration for `get_processor_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor_type + ## + # RPC-specific configuration for `list_processors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processors + ## + # RPC-specific configuration for `get_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor + ## + # RPC-specific configuration for `train_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :train_processor_version + ## + # RPC-specific configuration for `get_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor_version + ## + # RPC-specific configuration for `list_processor_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processor_versions + ## + # RPC-specific configuration for `delete_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_processor_version + ## + # RPC-specific configuration for `deploy_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_processor_version + ## + # RPC-specific configuration for `undeploy_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_processor_version + ## + # RPC-specific configuration for `create_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :create_processor + ## + # RPC-specific configuration for `delete_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_processor + ## + # RPC-specific configuration for `enable_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_processor + ## + # RPC-specific configuration for `disable_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_processor + ## + # RPC-specific configuration for `set_default_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :set_default_processor_version + ## + # RPC-specific configuration for `review_document` + # @return [::Gapic::Config::Method] + # + attr_reader :review_document + ## + # RPC-specific configuration for `evaluate_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :evaluate_processor_version + ## + # RPC-specific configuration for `get_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_evaluation + ## + # RPC-specific configuration for `list_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_evaluations + ## + # RPC-specific configuration for `import_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :import_processor_version + + # @private + def initialize parent_rpcs = nil + process_document_config = parent_rpcs.process_document if parent_rpcs.respond_to? :process_document + @process_document = ::Gapic::Config::Method.new process_document_config + batch_process_documents_config = parent_rpcs.batch_process_documents if parent_rpcs.respond_to? :batch_process_documents + @batch_process_documents = ::Gapic::Config::Method.new batch_process_documents_config + fetch_processor_types_config = parent_rpcs.fetch_processor_types if parent_rpcs.respond_to? :fetch_processor_types + @fetch_processor_types = ::Gapic::Config::Method.new fetch_processor_types_config + list_processor_types_config = parent_rpcs.list_processor_types if parent_rpcs.respond_to? :list_processor_types + @list_processor_types = ::Gapic::Config::Method.new list_processor_types_config + get_processor_type_config = parent_rpcs.get_processor_type if parent_rpcs.respond_to? :get_processor_type + @get_processor_type = ::Gapic::Config::Method.new get_processor_type_config + list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors + @list_processors = ::Gapic::Config::Method.new list_processors_config + get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor + @get_processor = ::Gapic::Config::Method.new get_processor_config + train_processor_version_config = parent_rpcs.train_processor_version if parent_rpcs.respond_to? :train_processor_version + @train_processor_version = ::Gapic::Config::Method.new train_processor_version_config + get_processor_version_config = parent_rpcs.get_processor_version if parent_rpcs.respond_to? :get_processor_version + @get_processor_version = ::Gapic::Config::Method.new get_processor_version_config + list_processor_versions_config = parent_rpcs.list_processor_versions if parent_rpcs.respond_to? :list_processor_versions + @list_processor_versions = ::Gapic::Config::Method.new list_processor_versions_config + delete_processor_version_config = parent_rpcs.delete_processor_version if parent_rpcs.respond_to? :delete_processor_version + @delete_processor_version = ::Gapic::Config::Method.new delete_processor_version_config + deploy_processor_version_config = parent_rpcs.deploy_processor_version if parent_rpcs.respond_to? :deploy_processor_version + @deploy_processor_version = ::Gapic::Config::Method.new deploy_processor_version_config + undeploy_processor_version_config = parent_rpcs.undeploy_processor_version if parent_rpcs.respond_to? :undeploy_processor_version + @undeploy_processor_version = ::Gapic::Config::Method.new undeploy_processor_version_config + create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor + @create_processor = ::Gapic::Config::Method.new create_processor_config + delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor + @delete_processor = ::Gapic::Config::Method.new delete_processor_config + enable_processor_config = parent_rpcs.enable_processor if parent_rpcs.respond_to? :enable_processor + @enable_processor = ::Gapic::Config::Method.new enable_processor_config + disable_processor_config = parent_rpcs.disable_processor if parent_rpcs.respond_to? :disable_processor + @disable_processor = ::Gapic::Config::Method.new disable_processor_config + set_default_processor_version_config = parent_rpcs.set_default_processor_version if parent_rpcs.respond_to? :set_default_processor_version + @set_default_processor_version = ::Gapic::Config::Method.new set_default_processor_version_config + review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document + @review_document = ::Gapic::Config::Method.new review_document_config + evaluate_processor_version_config = parent_rpcs.evaluate_processor_version if parent_rpcs.respond_to? :evaluate_processor_version + @evaluate_processor_version = ::Gapic::Config::Method.new evaluate_processor_version_config + get_evaluation_config = parent_rpcs.get_evaluation if parent_rpcs.respond_to? :get_evaluation + @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config + list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations + @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config + import_processor_version_config = parent_rpcs.import_processor_version if parent_rpcs.respond_to? :import_processor_version + @import_processor_version = ::Gapic::Config::Method.new import_processor_version_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb new file mode 100644 index 000000000000..03738013040f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb @@ -0,0 +1,890 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the DocumentProcessorService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentProcessorService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 + # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/uiv1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/uiv1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/uiv1beta3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb new file mode 100644 index 000000000000..3d8987bc9f97 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb @@ -0,0 +1,1433 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/documentai/v1beta3/document_processor_service_pb" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + module Rest + ## + # REST service stub for the DocumentProcessorService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # Baseline implementation for the process_document REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # A result object deserialized from the server's reply + def process_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_process_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the batch_process_documents REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_process_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_process_documents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the fetch_processor_types REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # A result object deserialized from the server's reply + def fetch_processor_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_processor_types_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_processor_types REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse] + # A result object deserialized from the server's reply + def list_processor_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_processor_types_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_processor_type REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # A result object deserialized from the server's reply + def get_processor_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_processors REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse] + # A result object deserialized from the server's reply + def list_processors request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_processors_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # A result object deserialized from the server's reply + def get_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::Processor.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the train_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def train_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_train_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # A result object deserialized from the server's reply + def get_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_processor_versions REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse] + # A result object deserialized from the server's reply + def list_processor_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_processor_versions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the deploy_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def deploy_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deploy_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the undeploy_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def undeploy_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the create_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # A result object deserialized from the server's reply + def create_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_processor_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::Processor.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the enable_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def enable_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_processor_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the disable_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def disable_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_processor_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the set_default_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def set_default_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_default_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the review_document REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def review_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_review_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the evaluate_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def evaluate_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_evaluate_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_evaluation REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # A result object deserialized from the server's reply + def get_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_evaluation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_evaluations REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse] + # A result object deserialized from the server's reply + def list_evaluations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_evaluations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the import_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_processor_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_processor_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the process_document REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_process_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:process", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:process", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_process_documents REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_process_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:batchProcess", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:batchProcess", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_processor_types REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_processor_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{parent}:fetchProcessorTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_processor_types REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_processor_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{parent}/processorTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_processor_type REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_processor_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_processors REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_processors_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{parent}/processors", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the train_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_train_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{parent}/processorVersions:train", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_processor_versions REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_processor_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{parent}/processorVersions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deploy_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_deploy_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:deploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undeploy_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undeploy_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:undeploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{parent}/processors", + body: "processor", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_processor REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_default_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_default_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{processor}:setDefaultProcessorVersion", + body: "*", + matches: [ + ["processor", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the review_document REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_review_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{human_review_config}:reviewDocument", + body: "*", + matches: [ + ["human_review_config", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/humanReviewConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the evaluate_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_evaluate_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{processor_version}:evaluateProcessorVersion", + body: "*", + matches: [ + ["processor_version", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_evaluation REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_evaluations REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_evaluations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{parent}/evaluations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_processor_version REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_processor_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{parent}/processorVersions:importProcessorVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb new file mode 100644 index 000000000000..69eb7bc63b3a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/document_ai/v1beta3/version" + +require "google/cloud/document_ai/v1beta3/document_service/credentials" +require "google/cloud/document_ai/v1beta3/document_service/paths" +require "google/cloud/document_ai/v1beta3/document_service/operations" +require "google/cloud/document_ai/v1beta3/document_service/client" +require "google/cloud/document_ai/v1beta3/document_service/rest" + +module Google + module Cloud + module DocumentAI + module V1beta3 + ## + # Service to call Cloud DocumentAI to manage document collection (dataset). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/document_ai/v1beta3/document_service" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/document_ai/v1beta3/document_service/rest" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + module DocumentService + end + end + end + end +end + +helper_path = ::File.join __dir__, "document_service", "helpers.rb" +require "google/cloud/document_ai/v1beta3/document_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb new file mode 100644 index 000000000000..a0a9f6d1221c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb @@ -0,0 +1,941 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/documentai/v1beta3/document_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + ## + # Client for the DocumentService service. + # + # Service to call Cloud DocumentAI to manage document collection (dataset). + # + class Client + include Paths + + # @private + attr_reader :document_service_stub + + ## + # Configure the DocumentService Client class. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentService clients + # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new DocumentService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DocumentService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/documentai/v1beta3/document_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @document_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Updates metadata associated with a dataset. + # + # @overload update_dataset(request, options = nil) + # Pass arguments to `update_dataset` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_dataset(dataset: nil, update_mask: nil) + # Pass arguments to `update_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::Google::Cloud::DocumentAI::V1beta3::Dataset, ::Hash] + # Required. The `name` field of the `Dataset` is used to identify the + # resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The update mask applies to the resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new + # + # # Call the update_dataset method. + # result = client.update_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_dataset.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.dataset&.name + header_params["dataset.name"] = request.dataset.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :update_dataset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Import documents into a dataset. + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_documents(dataset: nil, batch_documents_import_configs: nil) + # Pass arguments to `import_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. The dataset resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @param batch_documents_import_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig, ::Hash>] + # Required. The Cloud Storage uri containing raw documents that must be + # imported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.dataset + header_params["dataset"] = request.dataset + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :import_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns relevant fields present in the requested document. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_document(dataset: nil, document_id: nil, read_mask: nil, page_range: nil) + # Pass arguments to `get_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. The resource name of the dataset that the document belongs to . + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @param document_id [::Google::Cloud::DocumentAI::V1beta3::DocumentId, ::Hash] + # Required. Document identifier. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # If set, only fields listed here will be returned. Otherwise, all fields + # will be returned by default. + # @param page_range [::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange, ::Hash] + # List of pages for which the fields specified in the `read_mask` must + # be served. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse. + # p result + # + def get_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.dataset + header_params["dataset"] = request.dataset + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :get_document, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a set of documents. + # + # @overload batch_delete_documents(request, options = nil) + # Pass arguments to `batch_delete_documents` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_delete_documents(dataset: nil, dataset_documents: nil) + # Pass arguments to `batch_delete_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. The dataset resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @param dataset_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments, ::Hash] + # Required. Dataset documents input. If given `filter`, all documents + # satisfying the filter will be deleted. If given documentIds, a maximum of + # 50 documents can be deleted in a batch. The request will be rejected if + # more than 50 document_ids are provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new + # + # # Call the batch_delete_documents method. + # result = client.batch_delete_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_delete_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_delete_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.dataset + header_params["dataset"] = request.dataset + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_delete_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :batch_delete_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the `DatasetSchema` of a `Dataset`. + # + # @overload get_dataset_schema(request, options = nil) + # Pass arguments to `get_dataset_schema` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_dataset_schema(name: nil, visible_fields_only: nil) + # Pass arguments to `get_dataset_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dataset schema resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset/datasetSchema + # @param visible_fields_only [::Boolean] + # If set, only returns the visible fields of the schema. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new + # + # # Call the get_dataset_schema method. + # result = client.get_dataset_schema request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + # p result + # + def get_dataset_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_dataset_schema.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_dataset_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dataset_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :get_dataset_schema, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a `DatasetSchema`. + # + # @overload update_dataset_schema(request, options = nil) + # Pass arguments to `update_dataset_schema` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_dataset_schema(dataset_schema: nil, update_mask: nil) + # Pass arguments to `update_dataset_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset_schema [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema, ::Hash] + # Required. The name field of the `DatasetSchema` is used to identify the + # resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The update mask applies to the resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new + # + # # Call the update_dataset_schema method. + # result = client.update_dataset_schema request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + # p result + # + def update_dataset_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_dataset_schema.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.dataset_schema&.name + header_params["dataset_schema.name"] = request.dataset_schema.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_dataset_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_dataset_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :update_dataset_schema, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DocumentService API. + # + # This class represents the configuration for DocumentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_dataset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_dataset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_dataset.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DocumentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `batch_delete_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_documents + ## + # RPC-specific configuration for `get_dataset_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset_schema + ## + # RPC-specific configuration for `update_dataset_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset_schema + + # @private + def initialize parent_rpcs = nil + update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset + @update_dataset = ::Gapic::Config::Method.new update_dataset_config + import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents + @import_documents = ::Gapic::Config::Method.new import_documents_config + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + batch_delete_documents_config = parent_rpcs.batch_delete_documents if parent_rpcs.respond_to? :batch_delete_documents + @batch_delete_documents = ::Gapic::Config::Method.new batch_delete_documents_config + get_dataset_schema_config = parent_rpcs.get_dataset_schema if parent_rpcs.respond_to? :get_dataset_schema + @get_dataset_schema = ::Gapic::Config::Method.new get_dataset_schema_config + update_dataset_schema_config = parent_rpcs.update_dataset_schema if parent_rpcs.respond_to? :update_dataset_schema + @update_dataset_schema = ::Gapic::Config::Method.new update_dataset_schema_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb new file mode 100644 index 000000000000..c035ea57158b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + # Credentials for the DocumentService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DOCUMENT_AI_CREDENTIALS", + "DOCUMENT_AI_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DOCUMENT_AI_CREDENTIALS_JSON", + "DOCUMENT_AI_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb new file mode 100644 index 000000000000..1ba5041bfcef --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb @@ -0,0 +1,779 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the DocumentService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 + # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb new file mode 100644 index 000000000000..6d22632859f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + # Path helper methods for the DocumentService API. + module Paths + ## + # Create a fully-qualified Dataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/dataset` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # + # @return [::String] + def dataset_path project:, location:, processor: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/dataset" + end + + ## + # Create a fully-qualified DatasetSchema resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # + # @return [::String] + def dataset_schema_path project:, location:, processor: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/dataset/datasetSchema" + end + + ## + # Create a fully-qualified Schema resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/schemas/{schema}` + # + # @param project [String] + # @param location [String] + # @param schema [String] + # + # @return [::String] + def schema_path project:, location:, schema: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/schemas/#{schema}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb new file mode 100644 index 000000000000..286f54e74e9d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/document_ai/v1beta3/version" +require "google/cloud/document_ai/v1beta3/bindings_override" + +require "google/cloud/document_ai/v1beta3/document_service/credentials" +require "google/cloud/document_ai/v1beta3/document_service/paths" +require "google/cloud/document_ai/v1beta3/document_service/rest/operations" +require "google/cloud/document_ai/v1beta3/document_service/rest/client" + +module Google + module Cloud + module DocumentAI + module V1beta3 + ## + # Service to call Cloud DocumentAI to manage document collection (dataset). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/document_ai/v1beta3/document_service/rest" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + module DocumentService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/document_ai/v1beta3/document_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb new file mode 100644 index 000000000000..efc1bf3c1911 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb @@ -0,0 +1,878 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/documentai/v1beta3/document_service_pb" +require "google/cloud/document_ai/v1beta3/document_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + module Rest + ## + # REST client for the DocumentService service. + # + # Service to call Cloud DocumentAI to manage document collection (dataset). + # + class Client + include Paths + + # @private + attr_reader :document_service_stub + + ## + # Configure the DocumentService Client class. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentService clients + # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new DocumentService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DocumentService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.bindings_override = @config.bindings_override + end + + @document_service_stub = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Updates metadata associated with a dataset. + # + # @overload update_dataset(request, options = nil) + # Pass arguments to `update_dataset` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_dataset(dataset: nil, update_mask: nil) + # Pass arguments to `update_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::Google::Cloud::DocumentAI::V1beta3::Dataset, ::Hash] + # Required. The `name` field of the `Dataset` is used to identify the + # resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The update mask applies to the resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new + # + # # Call the update_dataset method. + # result = client.update_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_dataset.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.update_dataset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Import documents into a dataset. + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_documents(dataset: nil, batch_documents_import_configs: nil) + # Pass arguments to `import_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. The dataset resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @param batch_documents_import_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig, ::Hash>] + # Required. The Cloud Storage uri containing raw documents that must be + # imported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.import_documents request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns relevant fields present in the requested document. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_document(dataset: nil, document_id: nil, read_mask: nil, page_range: nil) + # Pass arguments to `get_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. The resource name of the dataset that the document belongs to . + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @param document_id [::Google::Cloud::DocumentAI::V1beta3::DocumentId, ::Hash] + # Required. Document identifier. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # If set, only fields listed here will be returned. Otherwise, all fields + # will be returned by default. + # @param page_range [::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange, ::Hash] + # List of pages for which the fields specified in the `read_mask` must + # be served. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse. + # p result + # + def get_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.get_document request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a set of documents. + # + # @overload batch_delete_documents(request, options = nil) + # Pass arguments to `batch_delete_documents` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_delete_documents(dataset: nil, dataset_documents: nil) + # Pass arguments to `batch_delete_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. The dataset resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @param dataset_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments, ::Hash] + # Required. Dataset documents input. If given `filter`, all documents + # satisfying the filter will be deleted. If given documentIds, a maximum of + # 50 documents can be deleted in a batch. The request will be rejected if + # more than 50 document_ids are provided. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new + # + # # Call the batch_delete_documents method. + # result = client.batch_delete_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_delete_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_delete_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_delete_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.batch_delete_documents request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the `DatasetSchema` of a `Dataset`. + # + # @overload get_dataset_schema(request, options = nil) + # Pass arguments to `get_dataset_schema` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_dataset_schema(name: nil, visible_fields_only: nil) + # Pass arguments to `get_dataset_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dataset schema resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset/datasetSchema + # @param visible_fields_only [::Boolean] + # If set, only returns the visible fields of the schema. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new + # + # # Call the get_dataset_schema method. + # result = client.get_dataset_schema request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + # p result + # + def get_dataset_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_dataset_schema.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_dataset_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dataset_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.get_dataset_schema request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a `DatasetSchema`. + # + # @overload update_dataset_schema(request, options = nil) + # Pass arguments to `update_dataset_schema` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_dataset_schema(dataset_schema: nil, update_mask: nil) + # Pass arguments to `update_dataset_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset_schema [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema, ::Hash] + # Required. The name field of the `DatasetSchema` is used to identify the + # resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The update mask applies to the resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new + # + # # Call the update_dataset_schema method. + # result = client.update_dataset_schema request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + # p result + # + def update_dataset_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_dataset_schema.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_dataset_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_dataset_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.update_dataset_schema request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DocumentService REST API. + # + # This class represents the configuration for DocumentService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_dataset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_dataset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_dataset.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DocumentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `batch_delete_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_documents + ## + # RPC-specific configuration for `get_dataset_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset_schema + ## + # RPC-specific configuration for `update_dataset_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset_schema + + # @private + def initialize parent_rpcs = nil + update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset + @update_dataset = ::Gapic::Config::Method.new update_dataset_config + import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents + @import_documents = ::Gapic::Config::Method.new import_documents_config + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + batch_delete_documents_config = parent_rpcs.batch_delete_documents if parent_rpcs.respond_to? :batch_delete_documents + @batch_delete_documents = ::Gapic::Config::Method.new batch_delete_documents_config + get_dataset_schema_config = parent_rpcs.get_dataset_schema if parent_rpcs.respond_to? :get_dataset_schema + @get_dataset_schema = ::Gapic::Config::Method.new get_dataset_schema_config + update_dataset_schema_config = parent_rpcs.update_dataset_schema if parent_rpcs.respond_to? :update_dataset_schema + @update_dataset_schema = ::Gapic::Config::Method.new update_dataset_schema_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb new file mode 100644 index 000000000000..0c7e1e4b6223 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb @@ -0,0 +1,890 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the DocumentService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 + # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/uiv1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/uiv1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/uiv1beta3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb new file mode 100644 index 000000000000..fe5650433d5a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb @@ -0,0 +1,406 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/documentai/v1beta3/document_service_pb" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + module Rest + ## + # REST service stub for the DocumentService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # Baseline implementation for the update_dataset REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the import_documents REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_documents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_document REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] + # A result object deserialized from the server's reply + def get_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the batch_delete_documents REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_delete_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_documents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_dataset_schema REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # A result object deserialized from the server's reply + def get_dataset_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_schema_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_dataset_schema REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # A result object deserialized from the server's reply + def update_dataset_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_schema_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the update_dataset REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta3/{dataset.name}", + body: "dataset", + matches: [ + ["dataset.name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_documents REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{dataset}:importDocuments", + body: "*", + matches: [ + ["dataset", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_document REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{dataset}:getDocument", + matches: [ + ["dataset", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_documents REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_delete_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta3/{dataset}:batchDeleteDocuments", + body: "*", + matches: [ + ["dataset", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dataset_schema REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_dataset_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/datasetSchema/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_dataset_schema REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_dataset_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta3/{dataset_schema.name}", + body: "dataset_schema", + matches: [ + ["dataset_schema.name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/datasetSchema/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb new file mode 100644 index 000000000000..ee74e6b6996f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/document_ai/v1beta3/document_processor_service/rest" +require "google/cloud/document_ai/v1beta3/document_service/rest" +require "google/cloud/document_ai/v1beta3/bindings_override" +require "google/cloud/document_ai/v1beta3/version" + +module Google + module Cloud + module DocumentAI + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/document_ai/v1beta3/rest" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + module V1beta3 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb new file mode 100644 index 000000000000..9b6a7dd5f7d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb new file mode 100644 index 000000000000..8e86a0f1540c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/barcode.proto + +require 'google/protobuf' + + +descriptor_data = "\n-google/cloud/documentai/v1beta3/barcode.proto\x12\x1fgoogle.cloud.documentai.v1beta3\"B\n\x07\x42\x61rcode\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\x12\x14\n\x0cvalue_format\x18\x02 \x01(\t\x12\x11\n\traw_value\x18\x03 \x01(\tB\xe3\x01\n#com.google.cloud.documentai.v1beta3B\x0c\x42\x61rcodeProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Barcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Barcode").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb new file mode 100644 index 000000000000..3813c4ba899f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/dataset.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/documentai/v1beta3/document_pb' +require 'google/cloud/documentai/v1beta3/document_io_pb' +require 'google/cloud/documentai/v1beta3/document_schema_pb' + + +descriptor_data = "\n-google/cloud/documentai/v1beta3/dataset.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\"\xe2\x07\n\x07\x44\x61taset\x12\\\n\x12gcs_managed_config\x18\x03 \x01(\x0b\x32\x39.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfigB\x03\xe0\x41\x01H\x00\x12j\n\x19\x64ocument_warehouse_config\x18\x05 \x01(\x0b\x32@.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfigB\x03\xe0\x41\x01H\x00\x12h\n\x18unmanaged_dataset_config\x18\x06 \x01(\x0b\x32?.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfigB\x03\xe0\x41\x01H\x00\x12\x66\n\x17spanner_indexing_config\x18\x04 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfigB\x03\xe0\x41\x01H\x01\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32..google.cloud.documentai.v1beta3.Dataset.StateB\x03\xe0\x41\x02\x1aW\n\x10GCSManagedConfig\x12\x43\n\ngcs_prefix\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.GcsPrefixB\x03\xe0\x41\x02\x1ar\n\x17\x44ocumentWarehouseConfig\x12\x17\n\ncollection\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12>\n\x06schema\x18\x02 \x01(\tB.\xe0\x41\x03\xfa\x41(\n&contentwarehouse.googleapis.com/Schema\x1a\x18\n\x16UnmanagedDatasetConfig\x1a\x17\n\x15SpannerIndexingConfig\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rUNINITIALIZED\x10\x01\x12\x10\n\x0cINITIALIZING\x10\x02\x12\x0f\n\x0bINITIALIZED\x10\x03:n\xea\x41k\n!documentai.googleapis.com/Dataset\x12\x46projects/{project}/locations/{location}/processors/{processor}/datasetB\x10\n\x0estorage_sourceB\x11\n\x0findexing_source\"\x86\x03\n\nDocumentId\x12^\n\x12gcs_managed_doc_id\x18\x01 \x01(\x0b\x32@.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentIdH\x00\x12[\n\x10unmanaged_doc_id\x18\x04 \x01(\x0b\x32?.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentIdH\x00\x12\x42\n\x0crevision_ref\x18\x03 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.RevisionRef\x1a\x43\n\x14GCSManagedDocumentId\x12\x14\n\x07gcs_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\tcw_doc_id\x18\x02 \x01(\tB\x02\x18\x01\x1a*\n\x13UnmanagedDocumentId\x12\x13\n\x06\x64oc_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x06\n\x04type\"\xf1\x01\n\rDatasetSchema\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x0f\x64ocument_schema\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchemaB\x03\xe0\x41\x01:\x82\x01\xea\x41\x7f\n\'documentai.googleapis.com/DatasetSchema\x12Tprojects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema\"\x87\x02\n\x15\x42\x61tchDatasetDocuments\x12o\n\x17individual_document_ids\x18\x01 \x01(\x0b\x32L.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIdsH\x00\x12\x10\n\x06\x66ilter\x18\x02 \x01(\tH\x00\x1a_\n\x15IndividualDocumentIds\x12\x46\n\x0c\x64ocument_ids\x18\x01 \x03(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentIdB\x03\xe0\x41\x02\x42\n\n\x08\x63riteriaB\xc8\x02\n#com.google.cloud.documentai.v1beta3B\x0c\x44\x61tasetProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3\xea\x41\x62\n&contentwarehouse.googleapis.com/Schema\x12\x38projects/{project}/locations/{location}/schemas/{schema}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.documentai.v1beta3.GcsPrefix", "google/cloud/documentai/v1beta3/document_io.proto"], + ["google.cloud.documentai.v1beta3.RevisionRef", "google/cloud/documentai/v1beta3/document.proto"], + ["google.cloud.documentai.v1beta3.DocumentSchema", "google/cloud/documentai/v1beta3/document_schema.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset").msgclass + Dataset::GCSManagedConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig").msgclass + Dataset::DocumentWarehouseConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig").msgclass + Dataset::UnmanagedDatasetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig").msgclass + Dataset::SpannerIndexingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig").msgclass + Dataset::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.State").enummodule + DocumentId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentId").msgclass + DocumentId::GCSManagedDocumentId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId").msgclass + DocumentId::UnmanagedDocumentId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId").msgclass + DatasetSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DatasetSchema").msgclass + BatchDatasetDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDatasetDocuments").msgclass + BatchDatasetDocuments::IndividualDocumentIds = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb new file mode 100644 index 000000000000..ca1ad4e5ff7a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document_io.proto + +require 'google/protobuf' + +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n1google/cloud/documentai/v1beta3/document_io.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a google/protobuf/field_mask.proto\"1\n\x0bRawDocument\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\"1\n\x0bGcsDocument\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"O\n\x0cGcsDocuments\x12?\n\tdocuments\x18\x01 \x03(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocument\"#\n\tGcsPrefix\x12\x16\n\x0egcs_uri_prefix\x18\x01 \x01(\t\"\xaf\x01\n\x19\x42\x61tchDocumentsInputConfig\x12@\n\ngcs_prefix\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.GcsPrefixH\x00\x12\x46\n\rgcs_documents\x18\x02 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.GcsDocumentsH\x00\x42\x08\n\x06source\"\x8f\x03\n\x14\x44ocumentOutputConfig\x12\x62\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\x45.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfigH\x00\x1a\x83\x02\n\x0fGcsOutputConfig\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12m\n\x0fsharding_config\x18\x03 \x01(\x0b\x32T.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig\x1a@\n\x0eShardingConfig\x12\x17\n\x0fpages_per_shard\x18\x01 \x01(\x05\x12\x15\n\rpages_overlap\x18\x02 \x01(\x05\x42\r\n\x0b\x64\x65stination\"\xfc\x03\n\tOcrConfig\x12?\n\x05hints\x18\x02 \x01(\x0b\x32\x30.google.cloud.documentai.v1beta3.OcrConfig.Hints\x12!\n\x19\x65nable_native_pdf_parsing\x18\x03 \x01(\x08\x12#\n\x1b\x65nable_image_quality_scores\x18\x04 \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x05 \x03(\t\x12\x15\n\renable_symbol\x18\x06 \x01(\x08\x12\x1e\n\x12\x63ompute_style_info\x18\x08 \x01(\x08\x42\x02\x18\x01\x12)\n!disable_character_boxes_detection\x18\n \x01(\x08\x12T\n\x10premium_features\x18\x0b \x01(\x0b\x32:.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures\x1a\x1f\n\x05Hints\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\t\x1ao\n\x0fPremiumFeatures\x12\'\n\x1f\x65nable_selection_mark_detection\x18\x03 \x01(\x08\x12\x1a\n\x12\x63ompute_style_info\x18\x04 \x01(\x08\x12\x17\n\x0f\x65nable_math_ocr\x18\x05 \x01(\x08\x42\xe6\x01\n#com.google.cloud.documentai.v1beta3B\x0f\x44ocumentIoProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + RawDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RawDocument").msgclass + GcsDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocument").msgclass + GcsDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocuments").msgclass + GcsPrefix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsPrefix").msgclass + BatchDocumentsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDocumentsInputConfig").msgclass + DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig").msgclass + DocumentOutputConfig::GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig").msgclass + DocumentOutputConfig::GcsOutputConfig::ShardingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig").msgclass + OcrConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig").msgclass + OcrConfig::Hints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig.Hints").msgclass + OcrConfig::PremiumFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb new file mode 100644 index 000000000000..3ff62752bf2d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/documentai/v1beta3/barcode_pb' +require 'google/cloud/documentai/v1beta3/geometry_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/color_pb' +require 'google/type/date_pb' +require 'google/type/datetime_pb' +require 'google/type/money_pb' +require 'google/type/postal_address_pb' + + +descriptor_data = "\n.google/cloud/documentai/v1beta3/document.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a-google/cloud/documentai/v1beta3/barcode.proto\x1a.google/cloud/documentai/v1beta3/geometry.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x16google/type/date.proto\x1a\x1agoogle/type/datetime.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"\x88H\n\x08\x44ocument\x12\x12\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x16\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01H\x00\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x11\n\x04text\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12H\n\x0btext_styles\x18\x05 \x03(\x0b\x32/.google.cloud.documentai.v1beta3.Document.StyleB\x02\x18\x01\x12=\n\x05pages\x18\x06 \x03(\x0b\x32..google.cloud.documentai.v1beta3.Document.Page\x12\x42\n\x08\x65ntities\x18\x07 \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.Entity\x12R\n\x10\x65ntity_relations\x18\x08 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.EntityRelation\x12J\n\x0ctext_changes\x18\x0e \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextChange\x12G\n\nshard_info\x18\t \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.ShardInfo\x12!\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\trevisions\x18\r \x03(\x0b\x32\x32.google.cloud.documentai.v1beta3.Document.Revision\x1aJ\n\tShardInfo\x12\x13\n\x0bshard_index\x18\x01 \x01(\x03\x12\x13\n\x0bshard_count\x18\x02 \x01(\x03\x12\x13\n\x0btext_offset\x18\x03 \x01(\x03\x1a\xef\x02\n\x05Style\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12!\n\x05\x63olor\x18\x02 \x01(\x0b\x32\x12.google.type.Color\x12,\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\x0b\x32\x12.google.type.Color\x12\x13\n\x0b\x66ont_weight\x18\x04 \x01(\t\x12\x12\n\ntext_style\x18\x05 \x01(\t\x12\x17\n\x0ftext_decoration\x18\x06 \x01(\t\x12K\n\tfont_size\x18\x07 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Style.FontSize\x12\x13\n\x0b\x66ont_family\x18\x08 \x01(\t\x1a&\n\x08\x46ontSize\x12\x0c\n\x04size\x18\x01 \x01(\x02\x12\x0c\n\x04unit\x18\x02 \x01(\t\x1a\xd0+\n\x04Page\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12\x43\n\x05image\x18\r \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Image\x12I\n\ntransforms\x18\x0e \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Matrix\x12K\n\tdimension\x18\x02 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Dimension\x12\x45\n\x06layout\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x44\n\x06\x62locks\x18\x05 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Block\x12L\n\nparagraphs\x18\x06 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Paragraph\x12\x42\n\x05lines\x18\x07 \x03(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.Page.Line\x12\x44\n\x06tokens\x18\x08 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Token\x12U\n\x0fvisual_elements\x18\t \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.Page.VisualElement\x12\x44\n\x06tables\x18\n \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Table\x12M\n\x0b\x66orm_fields\x18\x0b \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.FormField\x12\x46\n\x07symbols\x18\x0c \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Symbol\x12Y\n\x11\x64\x65tected_barcodes\x18\x0f \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode\x12_\n\x14image_quality_scores\x18\x11 \x01(\x0b\x32\x41.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores\x12L\n\nprovenance\x18\x10 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\x38\n\tDimension\x12\r\n\x05width\x18\x01 \x01(\x02\x12\x0e\n\x06height\x18\x02 \x01(\x02\x12\x0c\n\x04unit\x18\x03 \x01(\t\x1aJ\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\r\n\x05width\x18\x03 \x01(\x05\x12\x0e\n\x06height\x18\x04 \x01(\x05\x1a@\n\x06Matrix\x12\x0c\n\x04rows\x18\x01 \x01(\x05\x12\x0c\n\x04\x63ols\x18\x02 \x01(\x05\x12\x0c\n\x04type\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x1a\xec\x02\n\x06Layout\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x44\n\rbounding_poly\x18\x03 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPoly\x12V\n\x0borientation\x18\x04 \x01(\x0e\x32\x41.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation\"e\n\x0bOrientation\x12\x1b\n\x17ORIENTATION_UNSPECIFIED\x10\x00\x12\x0b\n\x07PAGE_UP\x10\x01\x12\x0e\n\nPAGE_RIGHT\x10\x02\x12\r\n\tPAGE_DOWN\x10\x03\x12\r\n\tPAGE_LEFT\x10\x04\x1a\xf9\x01\n\x05\x42lock\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\xfd\x01\n\tParagraph\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\xf8\x01\n\x04Line\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\xbc\x07\n\x05Token\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12Z\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x04 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x12R\n\nstyle_info\x18\x05 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo\x1a\xab\x01\n\rDetectedBreak\x12U\n\x04type\x18\x01 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type\"C\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nWIDE_SPACE\x10\x02\x12\n\n\x06HYPHEN\x10\x03\x1a\xe2\x02\n\tStyleInfo\x12\x11\n\tfont_size\x18\x01 \x01(\x05\x12\x17\n\x0fpixel_font_size\x18\x02 \x01(\x01\x12\x16\n\x0eletter_spacing\x18\x03 \x01(\x01\x12\x11\n\tfont_type\x18\x04 \x01(\t\x12\x0c\n\x04\x62old\x18\x05 \x01(\x08\x12\x0e\n\x06italic\x18\x06 \x01(\x08\x12\x12\n\nunderlined\x18\x07 \x01(\x08\x12\x11\n\tstrikeout\x18\x08 \x01(\x08\x12\x11\n\tsubscript\x18\t \x01(\x08\x12\x13\n\x0bsuperscript\x18\n \x01(\x08\x12\x11\n\tsmallcaps\x18\x0b \x01(\x08\x12\x13\n\x0b\x66ont_weight\x18\x0c \x01(\x05\x12\x13\n\x0bhandwritten\x18\r \x01(\x08\x12&\n\ntext_color\x18\x0e \x01(\x0b\x32\x12.google.type.Color\x12,\n\x10\x62\x61\x63kground_color\x18\x0f \x01(\x0b\x32\x12.google.type.Color\x1a\xac\x01\n\x06Symbol\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xc1\x01\n\rVisualElement\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x0c\n\x04type\x18\x02 \x01(\t\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xd0\x05\n\x05Table\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12R\n\x0bheader_rows\x18\x02 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12P\n\tbody_rows\x18\x03 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x05 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1aY\n\x08TableRow\x12M\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell\x1a\xd3\x01\n\tTableCell\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x10\n\x08row_span\x18\x02 \x01(\x05\x12\x10\n\x08\x63ol_span\x18\x03 \x01(\x05\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xff\x03\n\tFormField\x12I\n\nfield_name\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12J\n\x0b\x66ield_value\x18\x02 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12`\n\x17name_detected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x61\n\x18value_detected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x12\n\nvalue_type\x18\x05 \x01(\t\x12\x1a\n\x12\x63orrected_key_text\x18\x06 \x01(\t\x12\x1c\n\x14\x63orrected_value_text\x18\x07 \x01(\t\x12H\n\nprovenance\x18\x08 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\x93\x01\n\x0f\x44\x65tectedBarcode\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x39\n\x07\x62\x61rcode\x18\x02 \x01(\x0b\x32(.google.cloud.documentai.v1beta3.Barcode\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xcb\x01\n\x12ImageQualityScores\x12\x15\n\rquality_score\x18\x01 \x01(\x02\x12j\n\x10\x64\x65tected_defects\x18\x02 \x03(\x0b\x32P.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect\x1a\x32\n\x0e\x44\x65tectedDefect\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xe9\x06\n\x06\x45ntity\x12N\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchorB\x03\xe0\x41\x01\x12\x11\n\x04type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cmention_text\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nmention_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nconfidence\x18\x05 \x01(\x02\x42\x03\xe0\x41\x01\x12N\n\x0bpage_anchor\x18\x06 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.PageAnchorB\x03\xe0\x41\x01\x12\x0f\n\x02id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12_\n\x10normalized_value\x18\t \x01(\x0b\x32@.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValueB\x03\xe0\x41\x01\x12I\n\nproperties\x18\n \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.EntityB\x03\xe0\x41\x01\x12M\n\nprovenance\x18\x0b \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x03\xe0\x41\x01\x12\x15\n\x08redacted\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a\xbb\x02\n\x0fNormalizedValue\x12)\n\x0bmoney_value\x18\x02 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12\'\n\ndate_value\x18\x03 \x01(\x0b\x32\x11.google.type.DateH\x00\x12/\n\x0e\x64\x61tetime_value\x18\x04 \x01(\x0b\x32\x15.google.type.DateTimeH\x00\x12\x33\n\raddress_value\x18\x05 \x01(\x0b\x32\x1a.google.type.PostalAddressH\x00\x12\x17\n\rboolean_value\x18\x06 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x07 \x01(\x05H\x00\x12\x15\n\x0b\x66loat_value\x18\x08 \x01(\x02H\x00\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01\x42\x12\n\x10structured_value\x1aI\n\x0e\x45ntityRelation\x12\x12\n\nsubject_id\x18\x01 \x01(\t\x12\x11\n\tobject_id\x18\x02 \x01(\t\x12\x10\n\x08relation\x18\x03 \x01(\t\x1a\xad\x01\n\nTextAnchor\x12W\n\rtext_segments\x18\x01 \x03(\x0b\x32@.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a\x35\n\x0bTextSegment\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x1a\xe7\x03\n\nPageAnchor\x12O\n\tpage_refs\x18\x01 \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef\x1a\x87\x03\n\x07PageRef\x12\x11\n\x04page\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x61\n\x0blayout_type\x18\x02 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutTypeB\x03\xe0\x41\x01\x12\x18\n\tlayout_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12I\n\rbounding_poly\x18\x04 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPolyB\x03\xe0\x41\x01\x12\x17\n\nconfidence\x18\x05 \x01(\x02\x42\x03\xe0\x41\x01\"\x87\x01\n\nLayoutType\x12\x1b\n\x17LAYOUT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x42LOCK\x10\x01\x12\r\n\tPARAGRAPH\x10\x02\x12\x08\n\x04LINE\x10\x03\x12\t\n\x05TOKEN\x10\x04\x12\x12\n\x0eVISUAL_ELEMENT\x10\x05\x12\t\n\x05TABLE\x10\x06\x12\x0e\n\nFORM_FIELD\x10\x07\x1a\xb2\x03\n\nProvenance\x12\x14\n\x08revision\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x0e\n\x02id\x18\x02 \x01(\x05\x42\x02\x18\x01\x12L\n\x07parents\x18\x03 \x03(\x0b\x32;.google.cloud.documentai.v1beta3.Document.Provenance.Parent\x12P\n\x04type\x18\x04 \x01(\x0e\x32\x42.google.cloud.documentai.v1beta3.Document.Provenance.OperationType\x1a\x39\n\x06Parent\x12\x10\n\x08revision\x18\x01 \x01(\x05\x12\r\n\x05index\x18\x03 \x01(\x05\x12\x0e\n\x02id\x18\x02 \x01(\x05\x42\x02\x18\x01\"\xa2\x01\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\n\n\x06UPDATE\x10\x07\x12\x0b\n\x07REPLACE\x10\x03\x12\x16\n\x0e\x45VAL_REQUESTED\x10\x04\x1a\x02\x08\x01\x12\x15\n\rEVAL_APPROVED\x10\x05\x1a\x02\x08\x01\x12\x14\n\x0c\x45VAL_SKIPPED\x10\x06\x1a\x02\x08\x01\x1a\xaa\x02\n\x08Revision\x12\x0f\n\x05\x61gent\x18\x04 \x01(\tH\x00\x12\x13\n\tprocessor\x18\x05 \x01(\tH\x00\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\x06parent\x18\x02 \x03(\x05\x42\x02\x18\x01\x12\x12\n\nparent_ids\x18\x07 \x03(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12T\n\x0chuman_review\x18\x06 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Revision.HumanReview\x1a\x33\n\x0bHumanReview\x12\r\n\x05state\x18\x01 \x01(\t\x12\x15\n\rstate_message\x18\x02 \x01(\tB\x08\n\x06source\x1a\xbb\x01\n\nTextChange\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x14\n\x0c\x63hanged_text\x18\x02 \x01(\t\x12L\n\nprovenance\x18\x03 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x42\x08\n\x06source\"\x9b\x02\n\x0bRevisionRef\x12R\n\rrevision_case\x18\x01 \x01(\x0e\x32\x39.google.cloud.documentai.v1beta3.RevisionRef.RevisionCaseH\x00\x12\x15\n\x0brevision_id\x18\x02 \x01(\tH\x00\x12\"\n\x18latest_processor_version\x18\x03 \x01(\tH\x00\"s\n\x0cRevisionCase\x12\x1d\n\x19REVISION_CASE_UNSPECIFIED\x10\x00\x12\x17\n\x13LATEST_HUMAN_REVIEW\x10\x01\x12\x14\n\x10LATEST_TIMESTAMP\x10\x02\x12\x15\n\x11\x42\x41SE_OCR_REVISION\x10\x03\x42\x08\n\x06sourceB\xe4\x01\n#com.google.cloud.documentai.v1beta3B\rDocumentProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.type.Color", "google/type/color.proto"], + ["google.cloud.documentai.v1beta3.BoundingPoly", "google/cloud/documentai/v1beta3/geometry.proto"], + ["google.cloud.documentai.v1beta3.Barcode", "google/cloud/documentai/v1beta3/barcode.proto"], + ["google.type.Money", "google/type/money.proto"], + ["google.type.Date", "google/type/date.proto"], + ["google.type.DateTime", "google/type/datetime.proto"], + ["google.type.PostalAddress", "google/type/postal_address.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document").msgclass + Document::ShardInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.ShardInfo").msgclass + Document::Style = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style").msgclass + Document::Style::FontSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style.FontSize").msgclass + Document::Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page").msgclass + Document::Page::Dimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Dimension").msgclass + Document::Page::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Image").msgclass + Document::Page::Matrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Matrix").msgclass + Document::Page::Layout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout").msgclass + Document::Page::Layout::Orientation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation").enummodule + Document::Page::Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Block").msgclass + Document::Page::Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Paragraph").msgclass + Document::Page::Line = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Line").msgclass + Document::Page::Token = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token").msgclass + Document::Page::Token::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak").msgclass + Document::Page::Token::DetectedBreak::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type").enummodule + Document::Page::Token::StyleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo").msgclass + Document::Page::Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Symbol").msgclass + Document::Page::VisualElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.VisualElement").msgclass + Document::Page::Table = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table").msgclass + Document::Page::Table::TableRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableRow").msgclass + Document::Page::Table::TableCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableCell").msgclass + Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.FormField").msgclass + Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode").msgclass + Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage").msgclass + Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores").msgclass + Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect").msgclass + Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity").msgclass + Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue").msgclass + Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.EntityRelation").msgclass + Document::TextAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor").msgclass + Document::TextAnchor::TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment").msgclass + Document::PageAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor").msgclass + Document::PageAnchor::PageRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef").msgclass + Document::PageAnchor::PageRef::LayoutType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType").enummodule + Document::Provenance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance").msgclass + Document::Provenance::Parent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.Parent").msgclass + Document::Provenance::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.OperationType").enummodule + Document::Revision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision").msgclass + Document::Revision::HumanReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision.HumanReview").msgclass + Document::TextChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextChange").msgclass + RevisionRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RevisionRef").msgclass + RevisionRef::RevisionCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RevisionRef.RevisionCase").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb new file mode 100644 index 000000000000..aa0602fed2ee --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document_processor_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/documentai/v1beta3/document_pb' +require 'google/cloud/documentai/v1beta3/document_io_pb' +require 'google/cloud/documentai/v1beta3/document_schema_pb' +require 'google/cloud/documentai/v1beta3/evaluation_pb' +require 'google/cloud/documentai/v1beta3/operation_metadata_pb' +require 'google/cloud/documentai/v1beta3/processor_pb' +require 'google/cloud/documentai/v1beta3/processor_type_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n@google/cloud/documentai/v1beta3/document_processor_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\x1a\x30google/cloud/documentai/v1beta3/evaluation.proto\x1a\x38google/cloud/documentai/v1beta3/operation_metadata.proto\x1a/google/cloud/documentai/v1beta3/processor.proto\x1a\x34google/cloud/documentai/v1beta3/processor_type.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa2\x02\n\x0eProcessOptions\x12j\n\x18individual_page_selector\x18\x05 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelectorH\x00\x12\x14\n\nfrom_start\x18\x06 \x01(\x05H\x00\x12\x12\n\x08\x66rom_end\x18\x07 \x01(\x05H\x00\x12>\n\nocr_config\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.OcrConfig\x1a,\n\x16IndividualPageSelector\x12\x12\n\x05pages\x18\x01 \x03(\x05\x42\x03\xe0\x41\x01\x42\x0c\n\npage_range\"\xdb\x03\n\x0eProcessRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12\x44\n\x0craw_document\x18\x05 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.RawDocumentH\x00\x12\x44\n\x0cgcs_document\x18\x08 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocumentH\x00\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08\x12.\n\nfield_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptionsB\x08\n\x06source\"\xf3\x01\n\x11HumanReviewStatus\x12G\n\x05state\x18\x01 \x01(\x0e\x32\x38.google.cloud.documentai.v1beta3.HumanReviewStatus.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12\x1e\n\x16human_review_operation\x18\x03 \x01(\t\"^\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SKIPPED\x10\x01\x12\x15\n\x11VALIDATION_PASSED\x10\x02\x12\x0f\n\x0bIN_PROGRESS\x10\x03\x12\t\n\x05\x45RROR\x10\x04\"\xc3\x01\n\x0fProcessResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\"\n\x16human_review_operation\x18\x02 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x03 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"\xf5\x04\n\x13\x42\x61tchProcessRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12`\n\rinput_configs\x18\x02 \x03(\x0b\x32\x45.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfigB\x02\x18\x01\x12\x61\n\routput_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfigB\x02\x18\x01\x12S\n\x0finput_documents\x18\x05 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12U\n\x16\x64ocument_output_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.DocumentOutputConfig\x12\x19\n\x11skip_human_review\x18\x04 \x01(\x08\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptions\x1a=\n\x10\x42\x61tchInputConfig\x12\x12\n\ngcs_source\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t:\x02\x18\x01\x1a\x30\n\x11\x42\x61tchOutputConfig\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t:\x02\x18\x01\"\x16\n\x14\x42\x61tchProcessResponse\"\xb2\x05\n\x14\x42\x61tchProcessMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.documentai.v1beta3.BatchProcessMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32M.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus\x1a\xec\x01\n\x17IndividualProcessStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16output_gcs_destination\x18\x03 \x01(\t\x12\"\n\x16human_review_operation\x18\x04 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x05 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07WAITING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\"]\n\x1a\x46\x65tchProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\"f\n\x1b\x46\x65tchProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\"\x83\x01\n\x19ListProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"~\n\x1aListProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x15ListProcessorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x16ListProcessorsResponse\x12>\n\nprocessors\x18\x01 \x03(\x0b\x32*.google.cloud.documentai.v1beta3.Processor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x17GetProcessorTypeRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'documentai.googleapis.com/ProcessorType\"P\n\x13GetProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"^\n\x1aGetProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x89\x01\n\x1cListProcessorVersionsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x87\x01\n\x1dListProcessorVersionsResponse\x12M\n\x12processor_versions\x18\x01 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1d\x44\x65leteProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1e\x44\x65leteProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"a\n\x1d\x44\x65ployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\" \n\x1e\x44\x65ployProcessorVersionResponse\"s\n\x1e\x44\x65ployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"c\n\x1fUndeployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\"\n UndeployProcessorVersionResponse\"u\n UndeployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\x99\x01\n\x16\x43reateProcessorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x42\n\tprocessor\x18\x02 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.ProcessorB\x03\xe0\x41\x02\"S\n\x16\x44\x65leteProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"l\n\x17\x44\x65leteProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"S\n\x16\x45nableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x19\n\x17\x45nableProcessorResponse\"l\n\x17\x45nableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"T\n\x17\x44isableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x1a\n\x18\x44isableProcessorResponse\"m\n\x18\x44isableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xba\x01\n!SetDefaultProcessorVersionRequest\x12>\n\tprocessor\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12U\n\x19\x64\x65\x66\x61ult_processor_version\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"$\n\"SetDefaultProcessorVersionResponse\"w\n\"SetDefaultProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xe3\x07\n\x1cTrainProcessorVersionRequest\x12\x8b\x01\n\"custom_document_extraction_options\x18\x05 \x01(\x0b\x32].google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptionsH\x00\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12Q\n\x11processor_version\x18\x02 \x01(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersionB\x03\xe0\x41\x02\x12M\n\x0f\x64ocument_schema\x18\n \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchemaB\x03\xe0\x41\x01\x12`\n\ninput_data\x18\x04 \x01(\x0b\x32G.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputDataB\x03\xe0\x41\x01\x12#\n\x16\x62\x61se_processor_version\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1a\xb7\x01\n\tInputData\x12V\n\x12training_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12R\n\x0etest_documents\x18\x04 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x1a\x81\x02\n\x1f\x43ustomDocumentExtractionOptions\x12\x85\x01\n\x0ftraining_method\x18\x03 \x01(\x0e\x32l.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod\"V\n\x0eTrainingMethod\x12\x1f\n\x1bTRAINING_METHOD_UNSPECIFIED\x10\x00\x12\x0f\n\x0bMODEL_BASED\x10\x01\x12\x12\n\x0eTEMPLATE_BASED\x10\x02\x42\x11\n\x0fprocessor_flags\":\n\x1dTrainProcessorVersionResponse\x12\x19\n\x11processor_version\x18\x01 \x01(\t\"\x86\x04\n\x1dTrainProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12u\n\x1btraining_dataset_validation\x18\x02 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x12q\n\x17test_dataset_validation\x18\x03 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x1a\xa7\x01\n\x11\x44\x61tasetValidation\x12\x1c\n\x14\x64ocument_error_count\x18\x03 \x01(\x05\x12\x1b\n\x13\x64\x61taset_error_count\x18\x04 \x01(\x05\x12+\n\x0f\x64ocument_errors\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12*\n\x0e\x64\x61taset_errors\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\xde\x03\n\x15ReviewDocumentRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12 \n\x18\x65nable_schema_validation\x18\x03 \x01(\x08\x12Q\n\x08priority\x18\x05 \x01(\x0e\x32?.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority\x12H\n\x0f\x64ocument_schema\x18\x06 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchema\"#\n\x08Priority\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\n\n\x06URGENT\x10\x01\x42\x08\n\x06source\"\xd6\x01\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t\x12L\n\x05state\x18\x02 \x01(\x0e\x32=.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State\x12\x18\n\x10rejection_reason\x18\x03 \x01(\t\";\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REJECTED\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\"\xc0\x03\n\x1fReviewDocumentOperationMetadata\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12\x13\n\x0bquestion_id\x18\x06 \x01(\t\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xcf\x01\n\x1f\x45valuateProcessorVersionRequest\x12M\n\x11processor_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12]\n\x14\x65valuation_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfigB\x03\xe0\x41\x01\"u\n EvaluateProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"6\n EvaluateProcessorVersionResponse\x12\x12\n\nevaluation\x18\x02 \x01(\t\"R\n\x14GetEvaluationRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$documentai.googleapis.com/Evaluation\"\x83\x01\n\x16ListEvaluationsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListEvaluationsResponse\x12@\n\x0b\x65valuations\x18\x01 \x03(\x0b\x32+.google.cloud.documentai.v1beta3.Evaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x03\n\x1dImportProcessorVersionRequest\x12S\n\x18processor_version_source\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersionH\x00\x12\x8a\x01\n!external_processor_version_source\x18\x03 \x01(\x0b\x32].google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSourceH\x00\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x1a_\n\x1e\x45xternalProcessorVersionSource\x12\x1e\n\x11processor_version\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1d\n\x10service_endpoint\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06source\"l\n\x1eImportProcessorVersionResponse\x12J\n\x11processor_version\x18\x01 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1eImportProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata2\xeb.\n\x18\x44ocumentProcessorService\x12\x9b\x02\n\x0fProcessDocument\x12/.google.cloud.documentai.v1beta3.ProcessRequest\x1a\x30.google.cloud.documentai.v1beta3.ProcessResponse\"\xa4\x01\x82\xd3\xe4\x93\x02\x96\x01\";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\x01*ZT\"O/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process:\x01*\xda\x41\x04name\x12\xcc\x02\n\x15\x42\x61tchProcessDocuments\x12\x34.google.cloud.documentai.v1beta3.BatchProcessRequest\x1a\x1d.google.longrunning.Operation\"\xdd\x01\x82\xd3\xe4\x93\x02\xa0\x01\"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*ZY\"T/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess:\x01*\xda\x41\x04name\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\x12\xdf\x01\n\x13\x46\x65tchProcessorTypes\x12;.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest\x1a<.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse\"M\x82\xd3\xe4\x93\x02>\x12\n\x1dTrainProcessorVersionResponse\x12\x1dTrainProcessorVersionMetadata\x12\xdd\x01\n\x13GetProcessorVersion\x12;.google.cloud.documentai.v1beta3.GetProcessorVersionRequest\x1a\x31.google.cloud.documentai.v1beta3.ProcessorVersion\"V\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\x12\xf0\x01\n\x15ListProcessorVersions\x12=.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest\x1a>.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse\"X\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions\xda\x41\x06parent\x12\x8a\x02\n\x16\x44\x65leteProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\x82\xd3\xe4\x93\x02I*G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteProcessorVersionMetadata\x12\x9d\x02\n\x16\x44\x65ployProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\x82\xd3\xe4\x93\x02S\"N/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy:\x01*\xda\x41\x04name\xca\x41@\n\x1e\x44\x65ployProcessorVersionResponse\x12\x1e\x44\x65ployProcessorVersionMetadata\x12\xa7\x02\n\x18UndeployProcessorVersion\x12@.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02U\"P/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy:\x01*\xda\x41\x04name\xca\x41\x44\n UndeployProcessorVersionResponse\x12 UndeployProcessorVersionMetadata\x12\xd1\x01\n\x0f\x43reateProcessor\x12\x37.google.cloud.documentai.v1beta3.CreateProcessorRequest\x1a*.google.cloud.documentai.v1beta3.Processor\"Y\x82\xd3\xe4\x93\x02@\"3/v1beta3/{parent=projects/*/locations/*}/processors:\tprocessor\xda\x41\x10parent,processor\x12\xe0\x01\n\x0f\x44\x65leteProcessor\x12\x37.google.cloud.documentai.v1beta3.DeleteProcessorRequest\x1a\x1d.google.longrunning.Operation\"u\x82\xd3\xe4\x93\x02\x35*3/v1beta3/{name=projects/*/locations/*/processors/*}\xda\x41\x04name\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteProcessorMetadata\x12\xe5\x01\n\x0f\x45nableProcessor\x12\x37.google.cloud.documentai.v1beta3.EnableProcessorRequest\x1a\x1d.google.longrunning.Operation\"z\x82\xd3\xe4\x93\x02?\":/v1beta3/{name=projects/*/locations/*/processors/*}:enable:\x01*\xca\x41\x32\n\x17\x45nableProcessorResponse\x12\x17\x45nableProcessorMetadata\x12\xea\x01\n\x10\x44isableProcessor\x12\x38.google.cloud.documentai.v1beta3.DisableProcessorRequest\x1a\x1d.google.longrunning.Operation\"}\x82\xd3\xe4\x93\x02@\";/v1beta3/{name=projects/*/locations/*/processors/*}:disable:\x01*\xca\x41\x34\n\x18\x44isableProcessorResponse\x12\x18\x44isableProcessorMetadata\x12\xab\x02\n\x1aSetDefaultProcessorVersion\x12\x42.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02X\"S/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion:\x01*\xca\x41H\n\"SetDefaultProcessorVersionResponse\x12\"SetDefaultProcessorVersionMetadata\x12\xaa\x02\n\x0eReviewDocument\x12\x36.google.cloud.documentai.v1beta3.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xc0\x01\x82\xd3\xe4\x93\x02h\"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\xda\x41\x13human_review_config\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\x12\xd1\x02\n\x18\x45valuateProcessorVersion\x12@.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\x82\xd3\xe4\x93\x02r\"m/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion:\x01*\xda\x41\x11processor_version\xca\x41\x44\n EvaluateProcessorVersionResponse\x12 EvaluateProcessorVersionMetadata\x12\xd9\x01\n\rGetEvaluation\x12\x35.google.cloud.documentai.v1beta3.GetEvaluationRequest\x1a+.google.cloud.documentai.v1beta3.Evaluation\"d\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}\xda\x41\x04name\x12\xec\x01\n\x0fListEvaluations\x12\x37.google.cloud.documentai.v1beta3.ListEvaluationsRequest\x1a\x38.google.cloud.documentai.v1beta3.ListEvaluationsResponse\"f\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations\xda\x41\x06parent\x12\xaf\x02\n\x16ImportProcessorVersion\x12>.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\x82\xd3\xe4\x93\x02\x63\"^/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion:\x01*\xda\x41\x06parent\xca\x41@\n\x1eImportProcessorVersionResponse\x12\x1eImportProcessorVersionMetadata\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc3\x03\n#com.google.cloud.documentai.v1beta3B\x1a\x44ocumentAiProcessorServiceP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3\xea\x41\x7f\n+documentai.googleapis.com/HumanReviewConfig\x12Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfig\xea\x41M\n\"documentai.googleapis.com/Location\x12\'projects/{project}/locations/{location}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.documentai.v1beta3.OcrConfig", "google/cloud/documentai/v1beta3/document_io.proto"], + ["google.cloud.documentai.v1beta3.Document", "google/cloud/documentai/v1beta3/document.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.documentai.v1beta3.ProcessorType", "google/cloud/documentai/v1beta3/processor_type.proto"], + ["google.cloud.documentai.v1beta3.Processor", "google/cloud/documentai/v1beta3/processor.proto"], + ["google.cloud.documentai.v1beta3.CommonOperationMetadata", "google/cloud/documentai/v1beta3/operation_metadata.proto"], + ["google.cloud.documentai.v1beta3.DocumentSchema", "google/cloud/documentai/v1beta3/document_schema.proto"], + ["google.cloud.documentai.v1beta3.Evaluation", "google/cloud/documentai/v1beta3/evaluation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + ProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions").msgclass + ProcessOptions::IndividualPageSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector").msgclass + ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessRequest").msgclass + HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus").msgclass + HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus.State").enummodule + ProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessResponse").msgclass + BatchProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest").msgclass + BatchProcessRequest::BatchInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig").msgclass + BatchProcessRequest::BatchOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig").msgclass + BatchProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessResponse").msgclass + BatchProcessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata").msgclass + BatchProcessMetadata::IndividualProcessStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus").msgclass + BatchProcessMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.State").enummodule + FetchProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesRequest").msgclass + FetchProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesResponse").msgclass + ListProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesRequest").msgclass + ListProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesResponse").msgclass + ListProcessorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsRequest").msgclass + ListProcessorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsResponse").msgclass + GetProcessorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorTypeRequest").msgclass + GetProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorRequest").msgclass + GetProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorVersionRequest").msgclass + ListProcessorVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsRequest").msgclass + ListProcessorVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsResponse").msgclass + DeleteProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest").msgclass + DeleteProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata").msgclass + DeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionRequest").msgclass + DeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionResponse").msgclass + DeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata").msgclass + UndeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest").msgclass + UndeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse").msgclass + UndeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata").msgclass + CreateProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CreateProcessorRequest").msgclass + DeleteProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorRequest").msgclass + DeleteProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorMetadata").msgclass + EnableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorRequest").msgclass + EnableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorResponse").msgclass + EnableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorMetadata").msgclass + DisableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorRequest").msgclass + DisableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorResponse").msgclass + DisableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorMetadata").msgclass + SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest").msgclass + SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse").msgclass + SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata").msgclass + TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest").msgclass + TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData").msgclass + TrainProcessorVersionRequest::CustomDocumentExtractionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions").msgclass + TrainProcessorVersionRequest::CustomDocumentExtractionOptions::TrainingMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod").enummodule + TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionResponse").msgclass + TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata").msgclass + TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation").msgclass + ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest").msgclass + ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority").enummodule + ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse").msgclass + ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse.State").enummodule + ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata").msgclass + ReviewDocumentOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State").enummodule + EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest").msgclass + EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata").msgclass + EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse").msgclass + GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetEvaluationRequest").msgclass + ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsRequest").msgclass + ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsResponse").msgclass + ImportProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionRequest").msgclass + ImportProcessorVersionRequest::ExternalProcessorVersionSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource").msgclass + ImportProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionResponse").msgclass + ImportProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb new file mode 100644 index 000000000000..5f62ae9281f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb @@ -0,0 +1,107 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/documentai/v1beta3/document_processor_service.proto for package 'Google.Cloud.DocumentAI.V1beta3' +# Original file comments: +# 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. +# + +require 'grpc' +require 'google/cloud/documentai/v1beta3/document_processor_service_pb' + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Service to call Document AI to process documents according to the + # processor's definition. Processors are built using state-of-the-art Google + # AI such as natural language, computer vision, and translation to extract + # structured information from unstructured or semi-structured documents. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.documentai.v1beta3.DocumentProcessorService' + + # Processes a single document. + rpc :ProcessDocument, ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse + # LRO endpoint to batch process many documents. The output is written + # to Cloud Storage as JSON in the [Document] format. + rpc :BatchProcessDocuments, ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Google::Longrunning::Operation + # Fetches processor types. Note that we don't use + # [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes] + # here, because it isn't paginated. + rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse + # Lists the processor types that exist. + rpc :ListProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse + # Gets a processor type detail. + rpc :GetProcessorType, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorType + # Lists all processors which belong to this project. + rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse + # Gets a processor detail. + rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor + # Trains a new processor version. + # Operation metadata is returned as + # [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata]. + rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Google::Longrunning::Operation + # Gets a processor version detail. + rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion + # Lists all versions of a processor. + rpc :ListProcessorVersions, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse + # Deletes the processor version, all artifacts under the processor version + # will be deleted. + rpc :DeleteProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Google::Longrunning::Operation + # Deploys the processor version. + rpc :DeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Google::Longrunning::Operation + # Undeploys the processor version. + rpc :UndeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Google::Longrunning::Operation + # 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, ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor + # Deletes the processor, unloads all deployed model artifacts if it was + # enabled and then deletes all artifacts associated with this processor. + rpc :DeleteProcessor, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Google::Longrunning::Operation + # Enables a processor + rpc :EnableProcessor, ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Google::Longrunning::Operation + # Disables a processor + rpc :DisableProcessor, ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Google::Longrunning::Operation + # Set the default (active) version of a + # [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in + # [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] + # and + # [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. + rpc :SetDefaultProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Google::Longrunning::Operation + # Send a document for Human Review. The input document should be processed by + # the specified processor. + rpc :ReviewDocument, ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Google::Longrunning::Operation + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation + # Retrieves a specific evaluation. + rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1beta3::Evaluation + # Retrieves a set of evaluations for a given processor version. + rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse + # Imports a processor version from source processor version. + rpc :ImportProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb new file mode 100644 index 000000000000..3d9ca5e0b5d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document_schema.proto + +require 'google/protobuf' + + +descriptor_data = "\n5google/cloud/documentai/v1beta3/document_schema.proto\x12\x1fgoogle.cloud.documentai.v1beta3\"$\n\x10PropertyMetadata\x12\x10\n\x08inactive\x18\x03 \x01(\x08\"&\n\x12\x45ntityTypeMetadata\x12\x10\n\x08inactive\x18\x05 \x01(\x08\"\xe1\x08\n\x0e\x44ocumentSchema\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12P\n\x0c\x65ntity_types\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1beta3.DocumentSchema.EntityType\x12J\n\x08metadata\x18\x04 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.DocumentSchema.Metadata\x1a\xee\x05\n\nEntityType\x12\\\n\x0b\x65num_values\x18\x0e \x01(\x0b\x32\x45.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesH\x00\x12\x14\n\x0c\x64isplay_name\x18\r \x01(\t\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nbase_types\x18\x02 \x03(\t\x12W\n\nproperties\x18\x06 \x03(\x0b\x32\x43.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property\x12Q\n\x14\x65ntity_type_metadata\x18\x0b \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.EntityTypeMetadata\x1a\x1c\n\nEnumValues\x12\x0e\n\x06values\x18\x01 \x03(\t\x1a\xef\x02\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nvalue_type\x18\x02 \x01(\t\x12k\n\x0foccurrence_type\x18\x03 \x01(\x0e\x32R.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType\x12L\n\x11property_metadata\x18\x05 \x01(\x0b\x32\x31.google.cloud.documentai.v1beta3.PropertyMetadata\"\x85\x01\n\x0eOccurrenceType\x12\x1f\n\x1bOCCURRENCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rOPTIONAL_ONCE\x10\x01\x12\x15\n\x11OPTIONAL_MULTIPLE\x10\x02\x12\x11\n\rREQUIRED_ONCE\x10\x03\x12\x15\n\x11REQUIRED_MULTIPLE\x10\x04\x42\x0e\n\x0cvalue_source\x1a\x94\x01\n\x08Metadata\x12\x19\n\x11\x64ocument_splitter\x18\x01 \x01(\x08\x12&\n\x1e\x64ocument_allow_multiple_labels\x18\x02 \x01(\x08\x12%\n\x1dprefixed_naming_on_properties\x18\x06 \x01(\x08\x12\x1e\n\x16skip_naming_validation\x18\x07 \x01(\x08\x42\xef\x01\n#com.google.cloud.documentai.v1beta3B\x18\x44ocumentAiDocumentSchemaP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + PropertyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.PropertyMetadata").msgclass + EntityTypeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EntityTypeMetadata").msgclass + DocumentSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema").msgclass + DocumentSchema::EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType").msgclass + DocumentSchema::EntityType::EnumValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues").msgclass + DocumentSchema::EntityType::Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property").msgclass + DocumentSchema::EntityType::Property::OccurrenceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType").enummodule + DocumentSchema::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.Metadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb new file mode 100644 index 000000000000..49054b583c7c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/documentai/v1beta3/dataset_pb' +require 'google/cloud/documentai/v1beta3/document_pb' +require 'google/cloud/documentai/v1beta3/document_io_pb' +require 'google/cloud/documentai/v1beta3/operation_metadata_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n6google/cloud/documentai/v1beta3/document_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/documentai/v1beta3/dataset.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x38google/cloud/documentai/v1beta3/operation_metadata.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x87\x01\n\x14UpdateDatasetRequest\x12>\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32(.google.cloud.documentai.v1beta3.DatasetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"s\n\x1eUpdateDatasetOperationMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xdf\x04\n\x16ImportDocumentsRequest\x12:\n\x07\x64\x61taset\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!documentai.googleapis.com/Dataset\x12\x7f\n\x1e\x62\x61tch_documents_import_configs\x18\x04 \x03(\x0b\x32R.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfigB\x03\xe0\x41\x02\x1a\x87\x03\n\x1a\x42\x61tchDocumentsImportConfig\x12J\n\rdataset_split\x18\x02 \x01(\x0e\x32\x31.google.cloud.documentai.v1beta3.DatasetSplitTypeH\x00\x12\x7f\n\x11\x61uto_split_config\x18\x03 \x01(\x0b\x32\x62.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfigH\x00\x12V\n\x12\x62\x61tch_input_config\x18\x01 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x1a/\n\x0f\x41utoSplitConfig\x12\x1c\n\x14training_split_ratio\x18\x01 \x01(\x02\x42\x13\n\x11split_type_config\"\x19\n\x17ImportDocumentsResponse\"\x80\x05\n\x17ImportDocumentsMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12s\n\x1aindividual_import_statuses\x18\x02 \x03(\x0b\x32O.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus\x12\x7f\n import_config_validation_results\x18\x04 \x03(\x0b\x32U.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult\x12\x1c\n\x14total_document_count\x18\x03 \x01(\x05\x1a\x9f\x01\n\x16IndividualImportStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12G\n\x12output_document_id\x18\x04 \x01(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentId\x1a\\\n\x1cImportConfigValidationResult\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\x8e\x02\n\x12GetDocumentRequest\x12:\n\x07\x64\x61taset\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!documentai.googleapis.com/Dataset\x12\x45\n\x0b\x64ocument_id\x18\x02 \x01(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentIdB\x03\xe0\x41\x02\x12-\n\tread_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x46\n\npage_range\x18\x04 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.DocumentPageRange\"R\n\x13GetDocumentResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\"\x8b\x01\n\x1b\x42\x61tchDeleteDocumentsRequest\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12V\n\x11\x64\x61taset_documents\x18\x03 \x01(\x0b\x32\x36.google.cloud.documentai.v1beta3.BatchDatasetDocumentsB\x03\xe0\x41\x02\"\x1e\n\x1c\x42\x61tchDeleteDocumentsResponse\"\xb9\x03\n\x1c\x42\x61tchDeleteDocumentsMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12\x83\x01\n individual_batch_delete_statuses\x18\x02 \x03(\x0b\x32Y.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus\x12\x1c\n\x14total_document_count\x18\x03 \x01(\x05\x12\x1c\n\x14\x65rror_document_count\x18\x04 \x01(\x05\x1a\x83\x01\n\x1bIndividualBatchDeleteStatus\x12@\n\x0b\x64ocument_id\x18\x01 \x01(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentId\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"u\n\x17GetDatasetSchemaRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'documentai.googleapis.com/DatasetSchema\x12\x1b\n\x13visible_fields_only\x18\x02 \x01(\x08\"\x9a\x01\n\x1aUpdateDatasetSchemaRequest\x12K\n\x0e\x64\x61taset_schema\x18\x01 \x01(\x0b\x32..google.cloud.documentai.v1beta3.DatasetSchemaB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"/\n\x11\x44ocumentPageRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05*\x85\x01\n\x10\x44\x61tasetSplitType\x12\"\n\x1e\x44\x41TASET_SPLIT_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44\x41TASET_SPLIT_TRAIN\x10\x01\x12\x16\n\x12\x44\x41TASET_SPLIT_TEST\x10\x02\x12\x1c\n\x18\x44\x41TASET_SPLIT_UNASSIGNED\x10\x03\x32\xcf\x0c\n\x0f\x44ocumentService\x12\xfe\x01\n\rUpdateDataset\x12\x35.google.cloud.documentai.v1beta3.UpdateDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\x82\xd3\xe4\x93\x02N2C/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}:\x07\x64\x61taset\xda\x41\x13\x64\x61taset,update_mask\xca\x41)\n\x07\x44\x61taset\x12\x1eUpdateDatasetOperationMetadata\x12\x84\x02\n\x0fImportDocuments\x12\x37.google.cloud.documentai.v1beta3.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\x82\xd3\xe4\x93\x02S\"N/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments:\x01*\xda\x41\x07\x64\x61taset\xca\x41\x32\n\x17ImportDocumentsResponse\x12\x17ImportDocumentsMetadata\x12\xd6\x01\n\x0bGetDocument\x12\x33.google.cloud.documentai.v1beta3.GetDocumentRequest\x1a\x34.google.cloud.documentai.v1beta3.GetDocumentResponse\"\\\x82\xd3\xe4\x93\x02L\x12J/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument\xda\x41\x07\x64\x61taset\x12\x9d\x02\n\x14\x42\x61tchDeleteDocuments\x12<.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xa7\x01\x82\xd3\xe4\x93\x02X\"S/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments:\x01*\xda\x41\x07\x64\x61taset\xca\x41<\n\x1c\x42\x61tchDeleteDocumentsResponse\x12\x1c\x42\x61tchDeleteDocumentsMetadata\x12\xd6\x01\n\x10GetDatasetSchema\x12\x38.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest\x1a..google.cloud.documentai.v1beta3.DatasetSchema\"X\x82\xd3\xe4\x93\x02K\x12I/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}\xda\x41\x04name\x12\x92\x02\n\x13UpdateDatasetSchema\x12;.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest\x1a..google.cloud.documentai.v1beta3.DatasetSchema\"\x8d\x01\x82\xd3\xe4\x93\x02j2X/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}:\x0e\x64\x61taset_schema\xda\x41\x1a\x64\x61taset_schema,update_mask\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf0\x01\n#com.google.cloud.documentai.v1beta3B\x19\x44ocumentAiDocumentServiceP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.documentai.v1beta3.Dataset", "google/cloud/documentai/v1beta3/dataset.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.documentai.v1beta3.CommonOperationMetadata", "google/cloud/documentai/v1beta3/operation_metadata.proto"], + ["google.cloud.documentai.v1beta3.BatchDocumentsInputConfig", "google/cloud/documentai/v1beta3/document_io.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.documentai.v1beta3.Document", "google/cloud/documentai/v1beta3/document.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + UpdateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UpdateDatasetRequest").msgclass + UpdateDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata").msgclass + ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsRequest").msgclass + ImportDocumentsRequest::BatchDocumentsImportConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig").msgclass + ImportDocumentsRequest::BatchDocumentsImportConfig::AutoSplitConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig").msgclass + ImportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsResponse").msgclass + ImportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsMetadata").msgclass + ImportDocumentsMetadata::IndividualImportStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus").msgclass + ImportDocumentsMetadata::ImportConfigValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult").msgclass + GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetDocumentRequest").msgclass + GetDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetDocumentResponse").msgclass + BatchDeleteDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest").msgclass + BatchDeleteDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse").msgclass + BatchDeleteDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata").msgclass + BatchDeleteDocumentsMetadata::IndividualBatchDeleteStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus").msgclass + GetDatasetSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetDatasetSchemaRequest").msgclass + UpdateDatasetSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest").msgclass + DocumentPageRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentPageRange").msgclass + DatasetSplitType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DatasetSplitType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb new file mode 100644 index 000000000000..d508fce05f18 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/documentai/v1beta3/document_service.proto for package 'Google.Cloud.DocumentAI.V1beta3' +# Original file comments: +# 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. +# + +require 'grpc' +require 'google/cloud/documentai/v1beta3/document_service_pb' + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentService + # Service to call Cloud DocumentAI to manage document collection (dataset). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.documentai.v1beta3.DocumentService' + + # Updates metadata associated with a dataset. + rpc :UpdateDataset, ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, ::Google::Longrunning::Operation + # Import documents into a dataset. + rpc :ImportDocuments, ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, ::Google::Longrunning::Operation + # Returns relevant fields present in the requested document. + rpc :GetDocument, ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse + # Deletes a set of documents. + rpc :BatchDeleteDocuments, ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, ::Google::Longrunning::Operation + # Gets the `DatasetSchema` of a `Dataset`. + rpc :GetDatasetSchema, ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema + # Updates a `DatasetSchema`. + rpc :UpdateDatasetSchema, ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb new file mode 100644 index 000000000000..cb06ac86b892 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/evaluation.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/documentai/v1beta3/evaluation.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8d\x02\n\x13\x45valuationReference\x12\x11\n\toperation\x18\x01 \x01(\t\x12=\n\nevaluation\x18\x02 \x01(\tB)\xfa\x41&\n$documentai.googleapis.com/Evaluation\x12N\n\x11\x61ggregate_metrics\x18\x04 \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Evaluation.Metrics\x12T\n\x17\x61ggregate_metrics_exact\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Evaluation.Metrics\"\x8d\x0e\n\nEvaluation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12O\n\x11\x64ocument_counters\x18\x05 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Evaluation.Counters\x12`\n\x14\x61ll_entities_metrics\x18\x03 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics\x12V\n\x0e\x65ntity_metrics\x18\x04 \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Evaluation.EntityMetricsEntry\x12\x14\n\x0ckms_key_name\x18\x06 \x01(\t\x12\x1c\n\x14kms_key_version_name\x18\x07 \x01(\t\x1a\x8d\x01\n\x08\x43ounters\x12\x1d\n\x15input_documents_count\x18\x01 \x01(\x05\x12\x1f\n\x17invalid_documents_count\x18\x02 \x01(\x05\x12\x1e\n\x16\x66\x61iled_documents_count\x18\x03 \x01(\x05\x12!\n\x19\x65valuated_documents_count\x18\x04 \x01(\x05\x1a\xcd\x02\n\x07Metrics\x12\x11\n\tprecision\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x03 \x01(\x02\x12#\n\x1bpredicted_occurrences_count\x18\x04 \x01(\x05\x12&\n\x1eground_truth_occurrences_count\x18\x05 \x01(\x05\x12 \n\x18predicted_document_count\x18\n \x01(\x05\x12#\n\x1bground_truth_document_count\x18\x0b \x01(\x05\x12\x1c\n\x14true_positives_count\x18\x06 \x01(\x05\x12\x1d\n\x15\x66\x61lse_positives_count\x18\x07 \x01(\x05\x12\x1d\n\x15\x66\x61lse_negatives_count\x18\x08 \x01(\x05\x12\x1d\n\x15total_documents_count\x18\t \x01(\x05\x1ax\n\x16\x43onfidenceLevelMetrics\x12\x18\n\x10\x63onfidence_level\x18\x01 \x01(\x02\x12\x44\n\x07metrics\x18\x02 \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Evaluation.Metrics\x1a\x80\x04\n\x16MultiConfidenceMetrics\x12\x64\n\x18\x63onfidence_level_metrics\x18\x01 \x03(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics\x12j\n\x1e\x63onfidence_level_metrics_exact\x18\x04 \x03(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics\x12\r\n\x05\x61uprc\x18\x02 \x01(\x02\x12#\n\x1b\x65stimated_calibration_error\x18\x03 \x01(\x02\x12\x13\n\x0b\x61uprc_exact\x18\x05 \x01(\x02\x12)\n!estimated_calibration_error_exact\x18\x06 \x01(\x02\x12\x64\n\x0cmetrics_type\x18\x07 \x01(\x0e\x32N.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType\":\n\x0bMetricsType\x12\x1c\n\x18METRICS_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tAGGREGATE\x10\x01\x1ax\n\x12\x45ntityMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12Q\n\x05value\x18\x02 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics:\x02\x38\x01:\xa9\x01\xea\x41\xa5\x01\n$documentai.googleapis.com/Evaluation\x12}projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}B\xeb\x01\n#com.google.cloud.documentai.v1beta3B\x14\x44ocumentAiEvaluationP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + EvaluationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluationReference").msgclass + Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation").msgclass + Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Counters").msgclass + Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Metrics").msgclass + Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics").msgclass + Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics").msgclass + Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb new file mode 100644 index 000000000000..a220e24f987e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/geometry.proto + +require 'google/protobuf' + + +descriptor_data = "\n.google/cloud/documentai/v1beta3/geometry.proto\x12\x1fgoogle.cloud.documentai.v1beta3\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x99\x01\n\x0c\x42oundingPoly\x12\x39\n\x08vertices\x18\x01 \x03(\x0b\x32\'.google.cloud.documentai.v1beta3.Vertex\x12N\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.NormalizedVertexB\xe4\x01\n#com.google.cloud.documentai.v1beta3B\rGeometryProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Vertex").msgclass + NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.NormalizedVertex").msgclass + BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BoundingPoly").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb new file mode 100644 index 000000000000..3f89fcba9e65 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/operation_metadata.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n8google/cloud/documentai/v1beta3/operation_metadata.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/protobuf/timestamp.proto\"\xda\x02\n\x17\x43ommonOperationMetadata\x12M\n\x05state\x18\x01 \x01(\x0e\x32>.google.cloud.documentai.v1beta3.CommonOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12\x10\n\x08resource\x18\x05 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x42\xed\x01\n#com.google.cloud.documentai.v1beta3B\x16OperationMetadataProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + CommonOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata").msgclass + CommonOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb new file mode 100644 index 000000000000..06bb50b707ec --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/processor.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/documentai/v1beta3/document_schema_pb' +require 'google/cloud/documentai/v1beta3/evaluation_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/documentai/v1beta3/processor.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\x1a\x30google/cloud/documentai/v1beta3/evaluation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc9\x07\n\x10ProcessorVersion\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12H\n\x0f\x64ocument_schema\x18\x0c \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchema\x12\x46\n\x05state\x18\x06 \x01(\x0e\x32\x37.google.cloud.documentai.v1beta3.ProcessorVersion.State\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12O\n\x11latest_evaluation\x18\x08 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.EvaluationReference\x12\x14\n\x0ckms_key_name\x18\t \x01(\t\x12\x1c\n\x14kms_key_version_name\x18\n \x01(\t\x12\x1b\n\x0egoogle_managed\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x12[\n\x10\x64\x65precation_info\x18\r \x01(\x0b\x32\x41.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo\x1a\x9f\x01\n\x0f\x44\x65precationInfo\x12\x34\n\x10\x64\x65precation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12V\n\x1dreplacement_processor_version\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x93\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x45PLOYED\x10\x01\x12\r\n\tDEPLOYING\x10\x02\x12\x0e\n\nUNDEPLOYED\x10\x03\x12\x0f\n\x0bUNDEPLOYING\x10\x04\x12\x0c\n\x08\x43REATING\x10\x05\x12\x0c\n\x08\x44\x45LETING\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07\x12\r\n\tIMPORTING\x10\x08:\x96\x01\xea\x41\x92\x01\n*documentai.googleapis.com/ProcessorVersion\x12\x64projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}\"\xb2\x04\n\tProcessor\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x44\n\x05state\x18\x04 \x01(\x0e\x32\x30.google.cloud.documentai.v1beta3.Processor.StateB\x03\xe0\x41\x03\x12R\n\x19\x64\x65\x66\x61ult_processor_version\x18\t \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12 \n\x10process_endpoint\x18\x06 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x05\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0ckms_key_name\x18\x08 \x01(\t\"~\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08\x45NABLING\x10\x03\x12\r\n\tDISABLING\x10\x04\x12\x0c\n\x08\x43REATING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x0c\n\x08\x44\x45LETING\x10\x07:h\xea\x41\x65\n#documentai.googleapis.com/Processor\x12>projects/{project}/locations/{location}/processors/{processor}B\xea\x01\n#com.google.cloud.documentai.v1beta3B\x13\x44ocumentAiProcessorP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.documentai.v1beta3.DocumentSchema", "google/cloud/documentai/v1beta3/document_schema.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.documentai.v1beta3.EvaluationReference", "google/cloud/documentai/v1beta3/evaluation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + ProcessorVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion").msgclass + ProcessorVersion::DeprecationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo").msgclass + ProcessorVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.State").enummodule + Processor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor").msgclass + Processor::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb new file mode 100644 index 000000000000..10180e3ecd4a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/processor_type.proto + +require 'google/protobuf' + +require 'google/api/launch_stage_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n4google/cloud/documentai/v1beta3/processor_type.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1dgoogle/api/launch_stage.proto\x1a\x19google/api/resource.proto\"\x98\x03\n\rProcessorType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x03 \x01(\t\x12X\n\x13\x61vailable_locations\x18\x04 \x03(\x0b\x32;.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo\x12\x16\n\x0e\x61llow_creation\x18\x06 \x01(\x08\x12-\n\x0claunch_stage\x18\x08 \x01(\x0e\x32\x17.google.api.LaunchStage\x12\x1c\n\x14sample_document_uris\x18\t \x03(\t\x1a#\n\x0cLocationInfo\x12\x13\n\x0blocation_id\x18\x01 \x01(\t:u\xea\x41r\n\'documentai.googleapis.com/ProcessorType\x12Gprojects/{project}/locations/{location}/processorTypes/{processor_type}B\xee\x01\n#com.google.cloud.documentai.v1beta3B\x17\x44ocumentAiProcessorTypeP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + ProcessorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType").msgclass + ProcessorType::LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType.LocationInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md new file mode 100644 index 000000000000..9445d5bb62be --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md @@ -0,0 +1,4 @@ +# Document AI V1beta3 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..77056d6d22a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb @@ -0,0 +1,381 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..843c8e9deea2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..173c5c85f5dc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..522e181c4702 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same + # concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb new file mode 100644 index 000000000000..1d305e47d2b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Encodes the detailed information of a barcode. + # @!attribute [rw] format + # @return [::String] + # Format of a barcode. + # The supported formats are: + # + # - `CODE_128`: Code 128 type. + # - `CODE_39`: Code 39 type. + # - `CODE_93`: Code 93 type. + # - `CODABAR`: Codabar type. + # - `DATA_MATRIX`: 2D Data Matrix type. + # - `ITF`: ITF type. + # - `EAN_13`: EAN-13 type. + # - `EAN_8`: EAN-8 type. + # - `QR_CODE`: 2D QR code type. + # - `UPC_A`: UPC-A type. + # - `UPC_E`: UPC-E type. + # - `PDF417`: PDF417 type. + # - `AZTEC`: 2D Aztec code type. + # - `DATABAR`: GS1 DataBar code type. + # @!attribute [rw] value_format + # @return [::String] + # Value format describes the format of the value that a barcode + # encodes. + # The supported formats are: + # + # - `CONTACT_INFO`: Contact information. + # - `EMAIL`: Email address. + # - `ISBN`: ISBN identifier. + # - `PHONE`: Phone number. + # - `PRODUCT`: Product. + # - `SMS`: SMS message. + # - `TEXT`: Text string. + # - `URL`: URL address. + # - `WIFI`: Wifi information. + # - `GEO`: Geo-localization. + # - `CALENDAR_EVENT`: Calendar event. + # - `DRIVER_LICENSE`: Driver's license. + # @!attribute [rw] raw_value + # @return [::String] + # Raw value encoded in the barcode. + # For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + class Barcode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb new file mode 100644 index 000000000000..502d16f4ed3f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb @@ -0,0 +1,187 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # A singleton resource under a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} which configures a + # collection of documents. + # @!attribute [rw] gcs_managed_config + # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::GCSManagedConfig] + # Optional. User-managed Cloud Storage dataset configuration. Use this + # configuration if the dataset documents are stored under a user-managed + # Cloud Storage location. + # @!attribute [rw] document_warehouse_config + # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::DocumentWarehouseConfig] + # Optional. Document AI Warehouse-based dataset configuration. + # @!attribute [rw] unmanaged_dataset_config + # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::UnmanagedDatasetConfig] + # Optional. Unmanaged dataset configuration. Use this configuration if the + # dataset documents are managed by the document service internally (not + # user-managed). + # @!attribute [rw] spanner_indexing_config + # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::SpannerIndexingConfig] + # Optional. A lightweight indexing source with low latency and high + # reliability, but lacking advanced features like CMEK and content-based + # search. + # @!attribute [rw] name + # @return [::String] + # Dataset resource name. + # Format: + # `projects/{project}/locations/{location}/processors/{processor}/dataset` + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::State] + # Required. State of the dataset. Ignored when updating dataset. + class Dataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration specific to the Cloud Storage-based implementation. + # @!attribute [rw] gcs_prefix + # @return [::Google::Cloud::DocumentAI::V1beta3::GcsPrefix] + # Required. The Cloud Storage URI (a directory) where the documents + # belonging to the dataset must be stored. + class GCSManagedConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration specific to the Document AI Warehouse-based implementation. + # @!attribute [r] collection + # @return [::String] + # Output only. The collection in Document AI Warehouse associated with the + # dataset. + # @!attribute [r] schema + # @return [::String] + # Output only. The schema in Document AI Warehouse associated with the + # dataset. + class DocumentWarehouseConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration specific to an unmanaged dataset. + class UnmanagedDatasetConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration specific to spanner-based indexing. + class SpannerIndexingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Different states of a dataset. + module 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 + end + end + + # Document Identifier. + # @!attribute [rw] gcs_managed_doc_id + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId::GCSManagedDocumentId] + # A document id within user-managed Cloud Storage. + # @!attribute [rw] unmanaged_doc_id + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId::UnmanagedDocumentId] + # A document id within unmanaged dataset. + # @!attribute [rw] revision_ref + # @return [::Google::Cloud::DocumentAI::V1beta3::RevisionRef] + # Points to a specific revision of the document if set. + class DocumentId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Identifies a document uniquely within the scope of a dataset in the + # user-managed Cloud Storage option. + # @!attribute [rw] gcs_uri + # @return [::String] + # Required. The Cloud Storage URI where the actual document is stored. + # @!attribute [rw] cw_doc_id + # @return [::String] + # Id of the document (indexed) managed by Content Warehouse. + class GCSManagedDocumentId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identifies a document uniquely within the scope of a dataset in unmanaged + # option. + # @!attribute [rw] doc_id + # @return [::String] + # Required. The id of the document. + class UnmanagedDocumentId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Dataset Schema. + # @!attribute [rw] name + # @return [::String] + # Dataset schema resource name. + # Format: + # `projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema` + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # Optional. Schema of the dataset. + class DatasetSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Dataset documents that the batch operation will be applied to. + # @!attribute [rw] individual_document_ids + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments::IndividualDocumentIds] + # Document identifiers. + # @!attribute [rw] filter + # @return [::String] + # A filter matching the documents. + # Follows the same format and restriction as + # [google.cloud.documentai.master.ListDocumentsRequest.filter]. + class BatchDatasetDocuments + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # List of individual DocumentIds. + # @!attribute [rw] document_ids + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentId>] + # Required. List of Document IDs indicating where the actual documents are + # stored. + class IndividualDocumentIds + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb new file mode 100644 index 000000000000..a32d8be140ad --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb @@ -0,0 +1,1071 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Document represents the canonical document resource in Document AI. It is an + # interchange format that provides insights into documents and allows for + # collaboration between users and Document AI to iterate and optimize for + # quality. + # @!attribute [rw] uri + # @return [::String] + # Optional. Currently supports Google Cloud Storage URI of the form + # `gs://bucket_name/object_name`. Object versioning is not supported. + # For more information, refer to [Google Cloud Storage Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # @!attribute [rw] content + # @return [::String] + # Optional. Inline document content, represented as a stream of bytes. + # Note: As with all `bytes` fields, protobuffers use a pure binary + # representation, whereas JSON representations use base64. + # @!attribute [rw] mime_type + # @return [::String] + # An IANA published [media type (MIME + # type)](https://www.iana.org/assignments/media-types/media-types.xhtml). + # @!attribute [rw] text + # @return [::String] + # Optional. UTF-8 encoded text in reading order from the document. + # @!attribute [rw] text_styles + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Style>] + # Styles for the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] pages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page>] + # Visual page layout for the + # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] + # A list of entities detected on + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. For + # document shards, entities in this list may cross shard boundaries. + # @!attribute [rw] entity_relations + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::EntityRelation>] + # Placeholder. Relationship among + # {::Google::Cloud::DocumentAI::V1beta3::Document#entities Document.entities}. + # @!attribute [rw] text_changes + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextChange>] + # Placeholder. A list of text corrections made to + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. This is + # usually used for annotating corrections to OCR mistakes. Text changes for + # a given revision may not overlap with each other. + # @!attribute [rw] shard_info + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo] + # Information about the sharding if this document is sharded part of a larger + # document. If the document is not sharded, this message is not specified. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Any error that occurred while processing this document. + # @!attribute [rw] revisions + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Revision>] + # Placeholder. Revision history of this document. + class Document + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # For a large document, sharding may be performed to produce several + # document shards. Each document shard contains this field to detail which + # shard it is. + # @!attribute [rw] shard_index + # @return [::Integer] + # The 0-based index of this shard. + # @!attribute [rw] shard_count + # @return [::Integer] + # Total number of shards. + # @!attribute [rw] text_offset + # @return [::Integer] + # The index of the first character in + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text} in the + # overall document global text. + class ShardInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Annotation for common text style attributes. This adheres to CSS + # conventions as much as possible. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] color + # @return [::Google::Type::Color] + # Text color. + # @!attribute [rw] background_color + # @return [::Google::Type::Color] + # Text background color. + # @!attribute [rw] font_weight + # @return [::String] + # [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). + # Possible values are `normal`, `bold`, `bolder`, and `lighter`. + # @!attribute [rw] text_style + # @return [::String] + # [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). + # Possible values are `normal`, `italic`, and `oblique`. + # @!attribute [rw] text_decoration + # @return [::String] + # [Text + # decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + # Follows CSS standard. + # + # @!attribute [rw] font_size + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Style::FontSize] + # Font size. + # @!attribute [rw] font_family + # @return [::String] + # Font family such as `Arial`, `Times New Roman`. + # https://www.w3schools.com/cssref/pr_font_font-family.asp + class Style + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Font size with unit. + # @!attribute [rw] size + # @return [::Float] + # Font size for the text. + # @!attribute [rw] unit + # @return [::String] + # Unit for the font size. Follows CSS naming (such as `in`, `px`, and + # `pt`). + class FontSize + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A page in a {::Google::Cloud::DocumentAI::V1beta3::Document Document}. + # @!attribute [rw] page_number + # @return [::Integer] + # 1-based index for current + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page Page} in a parent + # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. Useful when a page + # is taken out of a {::Google::Cloud::DocumentAI::V1beta3::Document Document} + # for individual processing. + # @!attribute [rw] image + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Image] + # Rendered image for this page. This image is preprocessed to remove any + # skew, rotation, and distortions such that the annotation bounding boxes + # can be upright and axis-aligned. + # @!attribute [rw] transforms + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Matrix>] + # Transformation matrices that were applied to the original document image + # to produce + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#image Page.image}. + # @!attribute [rw] dimension + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Dimension] + # Physical dimension of the page. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the + # page. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] blocks + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block>] + # A list of visually detected text blocks on the page. + # A block has a set of lines (collected into paragraphs) that have a common + # line-spacing and orientation. + # @!attribute [rw] paragraphs + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph>] + # A list of visually detected text paragraphs on the page. + # A collection of lines that a human would perceive as a paragraph. + # @!attribute [rw] lines + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line>] + # A list of visually detected text lines on the page. + # A collection of tokens that a human would perceive as a line. + # @!attribute [rw] tokens + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token>] + # A list of visually detected tokens on the page. + # @!attribute [rw] visual_elements + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement>] + # A list of detected non-text visual elements e.g. checkbox, + # signature etc. on the page. + # @!attribute [rw] tables + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table>] + # A list of visually detected tables on the page. + # @!attribute [rw] form_fields + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField>] + # A list of visually detected form fields on the page. + # @!attribute [rw] symbols + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol>] + # A list of visually detected symbols on the page. + # @!attribute [rw] detected_barcodes + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode>] + # A list of detected barcodes. + # @!attribute [rw] image_quality_scores + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores] + # Image quality scores. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this page. + class Page + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Dimension for the page. + # @!attribute [rw] width + # @return [::Float] + # Page width. + # @!attribute [rw] height + # @return [::Float] + # Page height. + # @!attribute [rw] unit + # @return [::String] + # Dimension unit. + class Dimension + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Rendered image contents for this page. + # @!attribute [rw] content + # @return [::String] + # Raw byte content of the image. + # @!attribute [rw] mime_type + # @return [::String] + # Encoding [media type (MIME + # type)](https://www.iana.org/assignments/media-types/media-types.xhtml) + # for the image. + # @!attribute [rw] width + # @return [::Integer] + # Width of the image in pixels. + # @!attribute [rw] height + # @return [::Integer] + # Height of the image in pixels. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Representation for transformation matrix, intended to be compatible and + # used with OpenCV format for image manipulation. + # @!attribute [rw] rows + # @return [::Integer] + # Number of rows in the matrix. + # @!attribute [rw] cols + # @return [::Integer] + # Number of columns in the matrix. + # @!attribute [rw] type + # @return [::Integer] + # This encodes information about what data type the matrix uses. + # For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + # of OpenCV primitive data types, please refer to + # https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + # @!attribute [rw] data + # @return [::String] + # The matrix data. + class Matrix + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Visual element describing a layout unit on a page. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the current + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} within + # context of the object this layout is for. e.g. confidence can be for a + # single token, a table, a visual element, etc. depending on context. + # Range `[0, 1]`. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] + # The bounding polygon for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. + # @!attribute [rw] orientation + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout::Orientation] + # Detected orientation for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. + class Layout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Detected human reading orientation. + module Orientation + # Unspecified orientation. + ORIENTATION_UNSPECIFIED = 0 + + # Orientation is aligned with page up. + PAGE_UP = 1 + + # Orientation is aligned with page right. + # Turn the head 90 degrees clockwise from upright to read. + PAGE_RIGHT = 2 + + # Orientation is aligned with page down. + # Turn the head 180 degrees from upright to read. + PAGE_DOWN = 3 + + # Orientation is aligned with page left. + # Turn the head 90 degrees counterclockwise from upright to read. + PAGE_LEFT = 4 + end + end + + # A block has a set of lines (collected into paragraphs) that have a + # common line-spacing and orientation. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block Block}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class Block + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of lines that a human would perceive as a paragraph. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph Paragraph}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class Paragraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of tokens that a human would perceive as a line. + # Does not cross column boundaries, can be horizontal, vertical, etc. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line Line}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class Line + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A detected token. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. + # @!attribute [rw] detected_break + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak] + # Detected break at the end of a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + # @!attribute [rw] style_info + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::StyleInfo] + # Text style attributes. + class Token + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Detected break at the end of a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. + # @!attribute [rw] type + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak::Type] + # Detected break type. + class DetectedBreak + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to denote the type of break found. + module Type + # Unspecified break type. + TYPE_UNSPECIFIED = 0 + + # A single whitespace. + SPACE = 1 + + # A wider whitespace. + WIDE_SPACE = 2 + + # A hyphen that indicates that a token has been split across lines. + HYPHEN = 3 + end + end + + # Font and other text style attributes. + # @!attribute [rw] font_size + # @return [::Integer] + # Font size in points (`1` point is `¹⁄₇₂` inches). + # @!attribute [rw] pixel_font_size + # @return [::Float] + # Font size in pixels, equal to _unrounded + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::StyleInfo#font_size font_size}_ + # * _resolution_ ÷ `72.0`. + # @!attribute [rw] letter_spacing + # @return [::Float] + # Letter spacing in points. + # @!attribute [rw] font_type + # @return [::String] + # Name or style of the font. + # @!attribute [rw] bold + # @return [::Boolean] + # Whether the text is bold (equivalent to + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::StyleInfo#font_weight font_weight} + # is at least `700`). + # @!attribute [rw] italic + # @return [::Boolean] + # Whether the text is italic. + # @!attribute [rw] underlined + # @return [::Boolean] + # Whether the text is underlined. + # @!attribute [rw] strikeout + # @return [::Boolean] + # Whether the text is strikethrough. + # @!attribute [rw] subscript + # @return [::Boolean] + # Whether the text is a subscript. + # @!attribute [rw] superscript + # @return [::Boolean] + # Whether the text is a superscript. + # @!attribute [rw] smallcaps + # @return [::Boolean] + # Whether the text is in small caps. + # @!attribute [rw] font_weight + # @return [::Integer] + # TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). + # Normal is `400`, bold is `700`. + # @!attribute [rw] handwritten + # @return [::Boolean] + # Whether the text is handwritten. + # @!attribute [rw] text_color + # @return [::Google::Type::Color] + # Color of the text. + # @!attribute [rw] background_color + # @return [::Google::Type::Color] + # Color of the background. + class StyleInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A detected symbol. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol Symbol}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + class Symbol + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detected non-text visual elements e.g. checkbox, signature etc. on the + # page. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. + # @!attribute [rw] type + # @return [::String] + # Type of the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + class VisualElement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A table representation similar to HTML table structure. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table Table}. + # @!attribute [rw] header_rows + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] + # Header rows of the table. + # @!attribute [rw] body_rows + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] + # Body rows of the table. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this table. + class Table + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A row of table cells. + # @!attribute [rw] cells + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell>] + # Cells that make up this row. + class TableRow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A cell representation inside the table. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell TableCell}. + # @!attribute [rw] row_span + # @return [::Integer] + # How many rows this cell spans. + # @!attribute [rw] col_span + # @return [::Integer] + # How many columns this cell spans. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + class TableCell + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A form field detected on the page. + # @!attribute [rw] field_name + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} + # name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + # @!attribute [rw] field_value + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} + # value. + # @!attribute [rw] name_detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages for name together with confidence. + # @!attribute [rw] value_detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages for value together with confidence. + # @!attribute [rw] value_type + # @return [::String] + # If the value is non-textual, this field represents the type. Current + # valid values are: + # + # - blank (this indicates the `field_value` is normal text) + # - `unfilled_checkbox` + # - `filled_checkbox` + # @!attribute [rw] corrected_key_text + # @return [::String] + # Created for Labeling UI to export key text. + # If corrections were made to the text identified by the + # `field_name.text_anchor`, this field will contain the correction. + # @!attribute [rw] corrected_value_text + # @return [::String] + # Created for Labeling UI to export value text. + # If corrections were made to the text identified by the + # `field_value.text_anchor`, this field will contain the correction. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class FormField + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A detected barcode. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. + # @!attribute [rw] barcode + # @return [::Google::Cloud::DocumentAI::V1beta3::Barcode] + # Detailed barcode information of the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. + class DetectedBarcode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detected language for a structural component. + # @!attribute [rw] language_code + # @return [::String] + # The [BCP-47 language + # code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), + # such as `en-US` or `sr-Latn`. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected language. Range `[0, 1]`. + class DetectedLanguage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Image quality scores for the page image. + # @!attribute [rw] quality_score + # @return [::Float] + # The overall quality score. Range `[0, 1]` where `1` is perfect quality. + # @!attribute [rw] detected_defects + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores::DetectedDefect>] + # A list of detected defects. + class ImageQualityScores + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Image Quality Defects + # @!attribute [rw] type + # @return [::String] + # Name of the defect type. Supported values are: + # + # - `quality/defect_blurry` + # - `quality/defect_noisy` + # - `quality/defect_dark` + # - `quality/defect_faint` + # - `quality/defect_text_too_small` + # - `quality/defect_document_cutoff` + # - `quality/defect_text_cutoff` + # - `quality/defect_glare` + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected defect. Range `[0, 1]` where `1` indicates + # strong confidence that the defect exists. + class DetectedDefect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # An entity that could be a phrase in the text or a property that belongs to + # the document. It is a known entity type, such as a person, an organization, + # or location. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Optional. Provenance of the entity. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] type + # @return [::String] + # Required. Entity type from a schema e.g. `Address`. + # @!attribute [rw] mention_text + # @return [::String] + # Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. + # @!attribute [rw] mention_id + # @return [::String] + # Optional. Deprecated. Use `id` field instead. + # @!attribute [rw] confidence + # @return [::Float] + # Optional. Confidence of detected Schema entity. Range `[0, 1]`. + # @!attribute [rw] page_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor] + # Optional. Represents the provenance of this entity wrt. the location on + # the page where it was found. + # @!attribute [rw] id + # @return [::String] + # Optional. Canonical id. This will be a unique value in the entity list + # for this document. + # @!attribute [rw] normalized_value + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Entity::NormalizedValue] + # Optional. Normalized entity value. Absent if the extracted value could + # not be converted or the type (e.g. address) is not supported for certain + # parsers. This field is also only populated for certain supported document + # types. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] + # Optional. Entities can be nested to form a hierarchical data structure + # representing the content in the document. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # Optional. The history of this annotation. + # @!attribute [rw] redacted + # @return [::Boolean] + # Optional. Whether the entity will be redacted for de-identification + # purposes. + class Entity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parsed and normalized entity value. + # @!attribute [rw] money_value + # @return [::Google::Type::Money] + # Money value. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + # @!attribute [rw] date_value + # @return [::Google::Type::Date] + # Date value. Includes year, month, day. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + # @!attribute [rw] datetime_value + # @return [::Google::Type::DateTime] + # DateTime value. Includes date, time, and timezone. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + # @!attribute [rw] address_value + # @return [::Google::Type::PostalAddress] + # Postal address. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + # @!attribute [rw] boolean_value + # @return [::Boolean] + # Boolean value. Can be used for entities with binary values, or for + # checkboxes. + # @!attribute [rw] integer_value + # @return [::Integer] + # Integer value. + # @!attribute [rw] float_value + # @return [::Float] + # Float value. + # @!attribute [rw] text + # @return [::String] + # Optional. An optional field to store a normalized string. + # For some entity types, one of respective `structured_value` fields may + # also be populated. Also not all the types of `structured_value` will be + # normalized. For example, some processors may not generate `float` + # or `integer` normalized text by default. + # + # Below are sample formats mapped to structured values. + # + # - Money/Currency type (`money_value`) is in the ISO 4217 text format. + # - Date type (`date_value`) is in the ISO 8601 text format. + # - Datetime type (`datetime_value`) is in the ISO 8601 text format. + class NormalizedValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Relationship between + # {::Google::Cloud::DocumentAI::V1beta3::Document::Entity Entities}. + # @!attribute [rw] subject_id + # @return [::String] + # Subject entity id. + # @!attribute [rw] object_id + # @return [::String] + # Object entity id. + # @!attribute [rw] relation + # @return [::String] + # Relationship description. + class EntityRelation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Text reference indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] text_segments + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment>] + # The text segments from the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] content + # @return [::String] + # Contains the content of the text span so that users do + # not have to look it up in the text_segments. It is always + # populated for formFields. + class TextAnchor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A text segment in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. The + # indices may be out of bounds which indicate that the text extends into + # another document shard for large sharded documents. See + # {::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo#text_offset ShardInfo.text_offset} + # @!attribute [rw] start_index + # @return [::Integer] + # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} + # start UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] end_index + # @return [::Integer] + # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} + # half open end UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + class TextSegment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Referencing the visual context of the entity in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages}. Page + # anchors can be cross-page, consist of multiple bounding polygons and + # optionally reference specific layout element types. + # @!attribute [rw] page_refs + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef>] + # One or more references to visual page elements + class PageAnchor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a weak reference to a page element within a document. + # @!attribute [rw] page + # @return [::Integer] + # Required. Index into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages} + # element, for example using + # `[Document.pages][page_refs.page]` to locate the related page element. + # This field is skipped when its value is the default `0`. See + # https://developers.google.com/protocol-buffers/docs/proto3#json. + # @!attribute [rw] layout_type + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef::LayoutType] + # Optional. The type of the layout element that is being referenced if + # any. + # @!attribute [rw] layout_id + # @return [::String] + # Optional. Deprecated. Use + # {::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} + # instead. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] + # Optional. Identifies the bounding polygon of a layout element on the + # page. + # @!attribute [rw] confidence + # @return [::Float] + # Optional. Confidence of detected page element, if applicable. Range + # `[0, 1]`. + class PageRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of layout that is being referenced. + module LayoutType + # Layout Unspecified. + LAYOUT_TYPE_UNSPECIFIED = 0 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#blocks Page.blocks} + # element. + BLOCK = 1 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#paragraphs Page.paragraphs} + # element. + PARAGRAPH = 2 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#lines Page.lines} + # element. + LINE = 3 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tokens Page.tokens} + # element. + TOKEN = 4 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#visual_elements Page.visual_elements} + # element. + VISUAL_ELEMENT = 5 + + # Refrrences a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tables Page.tables} + # element. + TABLE = 6 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#form_fields Page.form_fields} + # element. + FORM_FIELD = 7 + end + end + end + + # Structure to identify provenance relationships between annotations in + # different revisions. + # @!attribute [rw] revision + # @return [::Integer] + # The index of the revision that produced this element. + # @!attribute [rw] id + # @return [::Integer] + # The Id of this operation. Needs to be unique within the scope of the + # revision. + # @!attribute [rw] parents + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::Parent>] + # References to the original elements that are replaced. + # @!attribute [rw] type + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::OperationType] + # The type of provenance operation. + class Provenance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The parent element the current element is based on. Used for + # referencing/aligning, removal and replacement operations. + # @!attribute [rw] revision + # @return [::Integer] + # The index of the index into current revision's parent_ids list. + # @!attribute [rw] index + # @return [::Integer] + # The index of the parent item in the corresponding item list (eg. list + # of entities, properties within entities, etc.) in the parent revision. + # @!attribute [rw] id + # @return [::Integer] + # The id of the parent provenance. + class Parent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # If a processor or agent does an explicit operation on existing elements. + module OperationType + # Operation type unspecified. If no operation is specified a provenance + # entry is simply used to match against a `parent`. + OPERATION_TYPE_UNSPECIFIED = 0 + + # Add an element. + ADD = 1 + + # Remove an element identified by `parent`. + REMOVE = 2 + + # Updates any fields within the given provenance scope of the message. It + # overwrites the fields rather than replacing them. Use this when you + # want to update a field value of an entity without also updating all the + # child properties. + UPDATE = 7 + + # Currently unused. Replace an element identified by `parent`. + REPLACE = 3 + + # Deprecated. Request human review for the element identified by + # `parent`. + EVAL_REQUESTED = 4 + + # Deprecated. Element is reviewed and approved at human review, + # confidence will be set to 1.0. + EVAL_APPROVED = 5 + + # Deprecated. Element is skipped in the validation process. + EVAL_SKIPPED = 6 + end + end + + # Contains past or forward revisions of this document. + # @!attribute [rw] agent + # @return [::String] + # If the change was made by a person specify the name or id of that + # person. + # @!attribute [rw] processor + # @return [::String] + # If the annotation was made by processor identify the processor by its + # resource name. + # @!attribute [rw] id + # @return [::String] + # Id of the revision, internally generated by doc proto storage. + # Unique within the context of the document. + # @!attribute [rw] parent + # @return [::Array<::Integer>] + # The revisions that this revision is based on. This can include one or + # more parent (when documents are merged.) This field represents the + # index into the `revisions` field. + # @!attribute [rw] parent_ids + # @return [::Array<::String>] + # The revisions that this revision is based on. Must include all the ids + # that have anything to do with this revision - eg. there are + # `provenance.parent.revision` fields that index into this field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time that the revision was created, internally generated by + # doc proto storage at the time of create. + # @!attribute [rw] human_review + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Revision::HumanReview] + # Human Review information of this revision. + class Revision + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Human Review information of the document. + # @!attribute [rw] state + # @return [::String] + # Human review state. e.g. `requested`, `succeeded`, `rejected`. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # For example, the rejection reason when the state is `rejected`. + class HumanReview + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used for text changes aka. OCR corrections. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Provenance of the correction. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. There + # can only be a single `TextAnchor.text_segments` element. If the start + # and end index of the text segment are the same, the text change is + # inserted before that index. + # @!attribute [rw] changed_text + # @return [::String] + # The text that replaces the text identified in the `text_anchor`. + # @!attribute [rw] provenance + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>] + # The history of this annotation. + class TextChange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The revision reference specifies which revision on the document to read. + # @!attribute [rw] revision_case + # @return [::Google::Cloud::DocumentAI::V1beta3::RevisionRef::RevisionCase] + # Reads the revision by the predefined case. + # @!attribute [rw] revision_id + # @return [::String] + # Reads the revision given by the id. + # @!attribute [rw] latest_processor_version + # @return [::String] + # Reads the revision generated by the processor version. + # The format takes the full resource name of processor version. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + class RevisionRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Some predefined revision cases. + module RevisionCase + # Unspecified case, fallback to read the LATEST_HUMAN_REVIEW. + REVISION_CASE_UNSPECIFIED = 0 + + # The latest revision made by a human. + LATEST_HUMAN_REVIEW = 1 + + # The latest revision based on timestamp. + LATEST_TIMESTAMP = 2 + + # The first (OCR) revision. + BASE_OCR_REVISION = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb new file mode 100644 index 000000000000..0ba8e20d4dc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb @@ -0,0 +1,193 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Payload message of raw document content (bytes). + # @!attribute [rw] content + # @return [::String] + # Inline document content. + # @!attribute [rw] mime_type + # @return [::String] + # An IANA MIME type (RFC6838) indicating the nature and format of the + # {::Google::Cloud::DocumentAI::V1beta3::RawDocument#content content}. + class RawDocument + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a document stored on Cloud Storage. + # @!attribute [rw] gcs_uri + # @return [::String] + # The Cloud Storage object uri. + # @!attribute [rw] mime_type + # @return [::String] + # An IANA MIME type (RFC6838) of the content. + class GcsDocument + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a set of documents on Cloud Storage. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::GcsDocument>] + # The list of documents. + class GcsDocuments + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies all documents on Cloud Storage with a common prefix. + # @!attribute [rw] gcs_uri_prefix + # @return [::String] + # The URI prefix. + class GcsPrefix + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The common config to specify a set of documents used as input. + # @!attribute [rw] gcs_prefix + # @return [::Google::Cloud::DocumentAI::V1beta3::GcsPrefix] + # The set of documents that match the specified Cloud Storage `gcs_prefix`. + # @!attribute [rw] gcs_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::GcsDocuments] + # The set of documents individually specified on Cloud Storage. + class BatchDocumentsInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config that controls the output of documents. All documents will be written + # as a JSON file. + # @!attribute [rw] gcs_output_config + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig] + # Output config to write the results to Cloud Storage. + class DocumentOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The configuration used when outputting documents. + # @!attribute [rw] gcs_uri + # @return [::String] + # The Cloud Storage uri (a directory) of the output. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies which fields to include in the output documents. + # Only supports top level document and pages field so it must be in the + # form of `{document_field_name}` or `pages.{page_field_name}`. + # @!attribute [rw] sharding_config + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig::ShardingConfig] + # Specifies the sharding config for the output document. + class GcsOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The sharding config for the output document. + # @!attribute [rw] pages_per_shard + # @return [::Integer] + # The number of pages per shard. + # @!attribute [rw] pages_overlap + # @return [::Integer] + # The number of overlapping pages between consecutive shards. + class ShardingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Config for Document OCR. + # @!attribute [rw] hints + # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig::Hints] + # Hints for the OCR model. + # @!attribute [rw] enable_native_pdf_parsing + # @return [::Boolean] + # Enables special handling for PDFs with existing text information. Results + # in better text extraction quality in such PDF inputs. + # @!attribute [rw] enable_image_quality_scores + # @return [::Boolean] + # Enables intelligent document quality scores after OCR. Can help with + # diagnosing why OCR responses are of poor quality for a given input. + # Adds additional latency comparable to regular OCR to the process call. + # @!attribute [rw] advanced_ocr_options + # @return [::Array<::String>] + # 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. + # @!attribute [rw] enable_symbol + # @return [::Boolean] + # Includes symbol level OCR information if set to true. + # @!attribute [rw] compute_style_info + # @return [::Boolean] + # Turn on font identification model and return font style information. + # Deprecated, use + # {::Google::Cloud::DocumentAI::V1beta3::OcrConfig::PremiumFeatures#compute_style_info PremiumFeatures.compute_style_info} + # instead. + # @!attribute [rw] disable_character_boxes_detection + # @return [::Boolean] + # Turn off character box detector in OCR engine. Character box detection is + # enabled by default in OCR 2.0+ processors. + # @!attribute [rw] premium_features + # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig::PremiumFeatures] + # Configurations for premium OCR features. + class OcrConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Hints for OCR Engine + # @!attribute [rw] language_hints + # @return [::Array<::String>] + # List of BCP-47 language codes to use for OCR. In most cases, not + # specifying it yields the best results since it enables automatic language + # detection. For languages based on the Latin alphabet, setting hints is + # not needed. In rare cases, when the language of the text in the + # image is known, setting a hint will help get better results (although it + # will be a significant hindrance if the hint is wrong). + class Hints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configurations for premium OCR features. + # @!attribute [rw] enable_selection_mark_detection + # @return [::Boolean] + # Turn on selection mark detector in OCR engine. Only available in OCR 2.0+ + # processors. + # @!attribute [rw] compute_style_info + # @return [::Boolean] + # Turn on font identification model and return font style information. + # @!attribute [rw] enable_math_ocr + # @return [::Boolean] + # Turn on the model that can extract LaTeX math formulas. + class PremiumFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb new file mode 100644 index 000000000000..27a1bdb4aa13 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb @@ -0,0 +1,1082 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Options for Process API + # @!attribute [rw] individual_page_selector + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions::IndividualPageSelector] + # Which pages to process (1-indexed). + # @!attribute [rw] from_start + # @return [::Integer] + # Only process certain pages from the start, process all if the document + # has less pages. + # @!attribute [rw] from_end + # @return [::Integer] + # Only process certain pages from the end, same as above. + # @!attribute [rw] ocr_config + # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig] + # Only applicable to `OCR_PROCESSOR`. Returns error if set on other + # processor types. + class ProcessOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A list of individual page numbers. + # @!attribute [rw] pages + # @return [::Array<::Integer>] + # Optional. Indices of the pages (starting from 1). + class IndividualPageSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} + # method. + # @!attribute [rw] inline_document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # An inline document proto. + # @!attribute [rw] raw_document + # @return [::Google::Cloud::DocumentAI::V1beta3::RawDocument] + # A raw document content (bytes). + # @!attribute [rw] gcs_document + # @return [::Google::Cloud::DocumentAI::V1beta3::GcsDocument] + # A raw document on Google Cloud Storage. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the + # server will use its [default + # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # The document payload, the + # {::Google::Cloud::DocumentAI::V1beta3::Document#content content} and + # {::Google::Cloud::DocumentAI::V1beta3::Document#mime_type mime_type} fields must + # be set. + # @!attribute [rw] skip_human_review + # @return [::Boolean] + # Whether human review should be skipped for this request. Default to + # `false`. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies which fields to include in the + # {::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}`. + # @!attribute [rw] process_options + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] + # Inference-time options for the process API + class ProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The status of human review on a processed document. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus::State] + # The state of human review on the processing request. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the human review state. + # @!attribute [rw] human_review_operation + # @return [::String] + # The name of the operation triggered by the processed document. This field + # is populated only when the + # {::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus#state state} is + # `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + # the long-running operation returned by + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument}. + class HumanReviewStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The final state of human review on a processed document. + module State + # Human review state is unspecified. Most likely due to an internal error. + STATE_UNSPECIFIED = 0 + + # Human review is skipped for the document. This can happen because human + # review isn't enabled on the processor or the processing request has + # been set to skip this document. + SKIPPED = 1 + + # Human review validation is triggered and passed, so no review is needed. + VALIDATION_PASSED = 2 + + # Human review validation is triggered and the document is under review. + IN_PROGRESS = 3 + + # Some error happened during triggering human review, see the + # {::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus#state_message state_message} + # for details. + ERROR = 4 + end + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} + # method. + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # The document payload, will populate fields based on the processor's + # behavior. + # @!attribute [rw] human_review_operation + # @return [::String] + # The name of the operation triggered by the processed document. If the human + # review process isn't triggered, this field is empty. It has the same + # response type and metadata as the long-running operation returned by + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument}. + # @!attribute [rw] human_review_status + # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] + # The status of human review on the processed document. + class ProcessResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] input_configs + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig>] + # The input config for each single document in the batch process. + # @!attribute [rw] output_config + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig] + # The overall output config for batch process. + # @!attribute [rw] input_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The input documents for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} + # method. + # @!attribute [rw] document_output_config + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig] + # The output configuration for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} + # method. + # @!attribute [rw] skip_human_review + # @return [::Boolean] + # Whether human review should be skipped for this request. Default to + # `false`. + # @!attribute [rw] process_options + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] + # Inference-time options for the process API + class BatchProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The message for input config in batch process. + # @!attribute [rw] gcs_source + # @return [::String] + # The Cloud Storage location as the source of the document. + # @!attribute [rw] mime_type + # @return [::String] + # 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 + # {::Google::Cloud::DocumentAI::V1beta3::Document Document}, the type should be + # `application/json`. + class BatchInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The output configuration in the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} + # method. + # @!attribute [rw] gcs_destination + # @return [::String] + # The output Cloud Storage directory to put the processed documents. + class BatchOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. + class BatchProcessResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::State] + # The state of the current batch processing. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # For example, the error message if the operation is failed. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] individual_process_statuses + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::IndividualProcessStatus>] + # The list of response details of each document. + class BatchProcessMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of a each individual document in the batch process. + # @!attribute [rw] input_gcs_source + # @return [::String] + # The source of the document, same as the + # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::IndividualProcessStatus#input_gcs_source input_gcs_source} + # field in the request when the batch process started. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status processing the document. + # @!attribute [rw] output_gcs_destination + # @return [::String] + # The Cloud Storage output destination (in the request as + # {::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig#gcs_uri DocumentOutputConfig.GcsOutputConfig.gcs_uri}) + # of the processed document if it was successful, otherwise empty. + # @!attribute [rw] human_review_operation + # @return [::String] + # The name of the operation triggered by the processed document. If the + # human review process isn't triggered, this field will be empty. It has + # the same response type and metadata as the long-running operation + # returned by the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} + # method. + # @!attribute [rw] human_review_status + # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] + # The status of human review on the processed document. + class IndividualProcessStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible states of the batch processing operation. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # Request operation is waiting for scheduling. + WAITING = 1 + + # Request is being processed. + RUNNING = 2 + + # The batch processing completed successfully. + SUCCEEDED = 3 + + # The batch processing was being cancelled. + CANCELLING = 4 + + # The batch processing was cancelled. + CANCELLED = 5 + + # The batch processing has failed. + FAILED = 6 + end + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} + # method. Some processor types may require the project be added to an + # allowlist. + # @!attribute [rw] parent + # @return [::String] + # Required. The location of processor types to list. + # Format: `projects/{project}/locations/{location}`. + class FetchProcessorTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} + # method. + # @!attribute [rw] processor_types + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # The list of processor types. + class FetchProcessorTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} + # method. Some processor types may require the project be added to an + # allowlist. + # @!attribute [rw] parent + # @return [::String] + # Required. The location of processor types to list. + # Format: `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # 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`. + # @!attribute [rw] page_token + # @return [::String] + # Used to retrieve the next page of results, empty if at the end of the list. + class ListProcessorTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} + # method. + # @!attribute [rw] processor_types + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # The processor types. + # @!attribute [rw] next_page_token + # @return [::String] + # Points to the next page, otherwise empty. + class ListProcessorTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for list all processors belongs to a project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) which owns this collection of + # Processors. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # 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`. + # @!attribute [rw] page_token + # @return [::String] + # We will return the processors sorted by creation time. The page token + # will point to the next processor. + class ListProcessorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors ListProcessors} + # method. + # @!attribute [rw] processors + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # The list of processors. + # @!attribute [rw] next_page_token + # @return [::String] + # Points to the next processor, otherwise empty. + class ListProcessorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type GetProcessorType} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor type resource name. + class GetProcessorTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor GetProcessor} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor resource name. + class GetProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version GetProcessorVersion} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor resource name. + class GetProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for list all processor versions belongs to a processor. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project, location and processor) to list all + # versions. Format: + # `projects/{project}/locations/{location}/processors/{processor}` + # @!attribute [rw] page_size + # @return [::Integer] + # 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`. + # @!attribute [rw] page_token + # @return [::String] + # We will return the processor versions sorted by creation time. The page + # token will point to the next processor version. + class ListProcessorVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions ListProcessorVersions} + # method. + # @!attribute [rw] processor_versions + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # The list of processors. + # @!attribute [rw] next_page_token + # @return [::String] + # Points to the next processor, otherwise empty. + class ListProcessorVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version DeleteProcessorVersion} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor version resource name to be deleted. + class DeleteProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version DeleteProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class DeleteProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor version resource name to be deployed. + class DeployProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} + # method. + class DeployProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class DeployProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor version resource name to be undeployed. + class UndeployProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} + # method. + class UndeployProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class UndeployProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor CreateProcessor} + # method. Notice this request is sent to a regionalized backend service. If the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorType ProcessorType} isn't + # available in that region, the creation fails. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] processor + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1beta3::Processor#type Processor.type} and + # [Processor.display_name]][] to be set. Also, the + # {::Google::Cloud::DocumentAI::V1beta3::Processor#kms_key_name Processor.kms_key_name} + # field must be set if the processor is under CMEK. + class CreateProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor DeleteProcessor} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor resource name to be deleted. + class DeleteProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor DeleteProcessor} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class DeleteProcessorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor EnableProcessor} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor resource name to be enabled. + class EnableProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor EnableProcessor} + # method. Intentionally empty proto for adding fields in future. + class EnableProcessorResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor EnableProcessor} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class EnableProcessorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor DisableProcessor} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The processor resource name to be disabled. + class DisableProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor DisableProcessor} + # method. Intentionally empty proto for adding fields in future. + class DisableProcessorResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor DisableProcessor} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class DisableProcessorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} + # method. + # @!attribute [rw] processor + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default + # version. + # @!attribute [rw] default_processor_version + # @return [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use + # as default. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + class SetDefaultProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} + # method. + class SetDefaultProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class SetDefaultProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version TrainProcessorVersion} + # method. + # @!attribute [rw] custom_document_extraction_options + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions] + # Options to control Custom Document Extraction (CDE) Processor. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project, location and processor) to create the new + # version for. Format: + # `projects/{project}/locations/{location}/processors/{processor}`. + # @!attribute [rw] processor_version + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # Required. The processor version to be created. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # Optional. The schema the processor version will be trained with. + # @!attribute [rw] input_data + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData] + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # @!attribute [rw] base_processor_version + # @return [::String] + # Optional. The processor version to use as a base for training. This + # processor version must be a child of `parent`. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + class TrainProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The input data used to train a new + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # @!attribute [rw] training_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The documents used for training the new version. + # @!attribute [rw] test_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The documents used for testing the trained version. + class InputData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options to control the training of the Custom Document Extraction (CDE) + # Processor. + # @!attribute [rw] training_method + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions::TrainingMethod] + # Training method to use for CDE training. + class CustomDocumentExtractionOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Training Method for CDE. TRAINING_METHOD_UNSPECIFIED will fallback to + # MODEL_BASED. + module TrainingMethod + TRAINING_METHOD_UNSPECIFIED = 0 + + MODEL_BASED = 1 + + TEMPLATE_BASED = 2 + end + end + end + + # The response for + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version TrainProcessorVersion}. + # @!attribute [rw] processor_version + # @return [::String] + # The resource name of the processor version produced by training. + class TrainProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata that represents a processor version being created. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + # @!attribute [rw] training_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] + # The training dataset validation information. + # @!attribute [rw] test_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] + # The test dataset validation information. + class TrainProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The dataset validation information. + # This includes any and all errors with documents and the dataset. + # @!attribute [rw] document_error_count + # @return [::Integer] + # The total number of document errors. + # @!attribute [rw] dataset_error_count + # @return [::Integer] + # The total number of dataset errors. + # @!attribute [rw] document_errors + # @return [::Array<::Google::Rpc::Status>] + # Error information pertaining to specific documents. A maximum of 10 + # document errors will be returned. + # Any document with errors will not be used throughout training. + # @!attribute [rw] dataset_errors + # @return [::Array<::Google::Rpc::Status>] + # Error information for the dataset as a whole. A maximum of 10 dataset + # errors will be returned. + # A single dataset error is terminal for training. + class DatasetValidation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} + # method. + # @!attribute [rw] inline_document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # An inline document proto. + # @!attribute [rw] human_review_config + # @return [::String] + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1beta3.HumanReviewConfig] that + # the document will be reviewed with. + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # The document that needs human review. + # @!attribute [rw] enable_schema_validation + # @return [::Boolean] + # Whether the validation should be performed on the ad-hoc review request. + # @!attribute [rw] priority + # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # The document schema of the human review task. + class ReviewDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The priority level of the human review task. + module Priority + # The default priority level. + DEFAULT = 0 + + # The urgent priority level. The labeling manager should allocate labeler + # resource to the urgent task queue to respect this priority level. + URGENT = 1 + end + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} + # method. + # @!attribute [rw] gcs_destination + # @return [::String] + # The Cloud Storage uri for the human reviewed document if the review is + # succeeded. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentResponse::State] + # The state of the review operation. + # @!attribute [rw] rejection_reason + # @return [::String] + # The reason why the review is rejected by reviewer. + class ReviewDocumentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of the review operation. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # The review operation is rejected by the reviewer. + REJECTED = 1 + + # The review operation is succeeded. + SUCCEEDED = 2 + end + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} + # method. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentOperationMetadata::State] + # Used only when Operation.done is false. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # For example, the error message if the operation is failed. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + # @!attribute [rw] question_id + # @return [::String] + # The Crowd Compute question ID. + class ReviewDocumentOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the long-running operation. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # Operation is still running. + RUNNING = 1 + + # Operation is being cancelled. + CANCELLING = 2 + + # Operation succeeded. + SUCCEEDED = 3 + + # Operation failed. + FAILED = 4 + + # Operation is cancelled. + CANCELLED = 5 + end + end + + # Evaluates the given + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} against + # the supplied documents. + # @!attribute [rw] processor_version + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] evaluation_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # Optional. The documents used in the evaluation. If unspecified, use the + # processor's dataset as evaluation input. + class EvaluateProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version EvaluateProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long-running operation. + class EvaluateProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version EvaluateProcessorVersion} + # method. + # @!attribute [rw] evaluation + # @return [::String] + # The resource name of the created evaluation. + class EvaluateProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retrieves a specific Evaluation. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + class GetEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retrieves a list of evaluations for a given + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # list evaluations for. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # If unspecified, at most `5` evaluations are returned. + # The maximum value is `100`. Values above `100` are coerced to `100`. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListEvaluations` call. + # Provide this to retrieve the subsequent page. + class ListEvaluationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response from `ListEvaluations`. + # @!attribute [rw] evaluations + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # The evaluations requested. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListEvaluationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version ImportProcessorVersion} + # method. Requirements: + # + # - The Document AI [Service + # Agent](https://cloud.google.com/iam/docs/service-agents) of the destination + # project must have [Document AI Editor + # role](https://cloud.google.com/document-ai/docs/access-control/iam-roles) on + # the source project. + # + # The destination project is specified as part of the + # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest#parent parent} + # field. The source project is specified as part of the + # [source][ImportProcessorVersionRequest.processor_version_source or + # ImportProcessorVersionRequest.external_processor_version_source] field. + # @!attribute [rw] processor_version_source + # @return [::String] + # The source processor version to import from. The source processor version + # and destination processor need to be in the same environment and region. + # @!attribute [rw] external_processor_version_source + # @return [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource] + # The source processor version to import from, and can be from different + # environment and region than the destination processor. + # @!attribute [rw] parent + # @return [::String] + # Required. The destination processor name to create the processor version + # in. Format: + # `projects/{project}/locations/{location}/processors/{processor}` + class ImportProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The external source processor version. + # @!attribute [rw] processor_version + # @return [::String] + # Required. The processor version name. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] service_endpoint + # @return [::String] + # Optional. The Document AI service endpoint. For example, + # 'https://us-documentai.googleapis.com' + class ExternalProcessorVersionSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response message for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version ImportProcessorVersion} + # method. + # @!attribute [rw] processor_version + # @return [::String] + # The destination processor version name. + class ImportProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long-running operation metadata for the + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version ImportProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata for the long-running operation. + class ImportProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb new file mode 100644 index 000000000000..c16c2916787f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb @@ -0,0 +1,186 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Metadata about a property. + # @!attribute [rw] inactive + # @return [::Boolean] + # Whether the property should be considered as "inactive". + class PropertyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about an entity type. + # @!attribute [rw] inactive + # @return [::Boolean] + # Whether the entity type should be considered inactive. + class EntityTypeMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The schema defines the output of the processed document by a processor. + # @!attribute [rw] display_name + # @return [::String] + # Display name to show to users. + # @!attribute [rw] description + # @return [::String] + # Description of the schema. + # @!attribute [rw] entity_types + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType>] + # Entity types of the schema. + # @!attribute [rw] metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::Metadata] + # Metadata of the schema. + class DocumentSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # EntityType is the wrapper of a label of the corresponding model with + # detailed attributes and limitations for entity-based processors. Multiple + # types can also compose a dependency tree to represent nested types. + # @!attribute [rw] enum_values + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::EnumValues] + # If specified, lists all the possible values for this entity. This + # should not be more than a handful of values. If the number of values + # is >10 or could change frequently use the `EntityType.value_ontology` + # field and specify a list of all possible values in a value ontology + # file. + # @!attribute [rw] display_name + # @return [::String] + # User defined name for the type. + # @!attribute [rw] name + # @return [::String] + # Name of the type. It must be unique within the schema file and + # cannot be a "Common Type". The following naming conventions are used: + # + # - Use `snake_casing`. + # - Name matching is case-sensitive. + # - Maximum 64 characters. + # - Must start with a letter. + # - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + # compatibility internal infrastructure and tooling can handle any ascii + # character.) + # - The `/` is sometimes used to denote a property of a type. For example + # `line_item/amount`. This convention is deprecated, but will still be + # honored for backward compatibility. + # @!attribute [rw] base_types + # @return [::Array<::String>] + # The entity type that this type is derived from. For now, one and only + # one should be set. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property>] + # Description the nested structure, or composition of an entity. + # @!attribute [rw] entity_type_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::EntityTypeMetadata] + # Metadata for the entity type. + class EntityType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines the a list of enum values. + # @!attribute [rw] values + # @return [::Array<::String>] + # The individual values that this enum values type can include. + class EnumValues + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines properties that can be part of the entity type. + # @!attribute [rw] name + # @return [::String] + # The name of the property. Follows the same guidelines as the + # EntityType name. + # @!attribute [rw] value_type + # @return [::String] + # A reference to the value type of the property. This type is subject + # to the same conventions as the `Entity.base_types` field. + # @!attribute [rw] occurrence_type + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType] + # Occurrence type limits the number of instances an entity type appears + # in the document. + # @!attribute [rw] property_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata] + # Any additional metadata about the property can be added here. + class Property + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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`. + module OccurrenceType + # Unspecified occurrence type. + OCCURRENCE_TYPE_UNSPECIFIED = 0 + + # There will be zero or one instance of this entity type. The same + # entity instance may be mentioned multiple times. + OPTIONAL_ONCE = 1 + + # The entity type will appear zero or multiple times. + OPTIONAL_MULTIPLE = 2 + + # The entity type will only appear exactly once. The same + # entity instance may be mentioned multiple times. + REQUIRED_ONCE = 3 + + # The entity type will appear once or more times. + REQUIRED_MULTIPLE = 4 + end + end + end + + # Metadata for global schema behavior. + # @!attribute [rw] document_splitter + # @return [::Boolean] + # If true, a `document` entity type can be applied to subdocument + # (splitting). Otherwise, it can only be applied to the entire document + # (classification). + # @!attribute [rw] document_allow_multiple_labels + # @return [::Boolean] + # If true, on a given page, there can be multiple `document` annotations + # covering it. + # @!attribute [rw] prefixed_naming_on_properties + # @return [::Boolean] + # If set, all the nested entities must be prefixed with the parents. + # @!attribute [rw] skip_naming_validation + # @return [::Boolean] + # If set, we will skip the naming format validation in the schema. So the + # string values in `DocumentSchema.EntityType.name` and + # `DocumentSchema.EntityType.Property.name` will not be checked. + class Metadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb new file mode 100644 index 000000000000..d1750d2b9e5a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb @@ -0,0 +1,275 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # @!attribute [rw] dataset + # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset] + # Required. The `name` field of the `Dataset` is used to identify the + # resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The update mask applies to the resource. + class UpdateDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class UpdateDatasetOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] dataset + # @return [::String] + # Required. The dataset resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @!attribute [rw] batch_documents_import_configs + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig>] + # Required. The Cloud Storage uri containing raw documents that must be + # imported. + class ImportDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Config for importing documents. + # Each batch can have its own dataset split type. + # @!attribute [rw] dataset_split + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSplitType] + # Target dataset split where the documents must be stored. + # @!attribute [rw] auto_split_config + # @return [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig::AutoSplitConfig] + # If set, documents will be automatically split into training and test + # split category with the specified ratio. + # @!attribute [rw] batch_input_config + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The common config to specify a set of documents used as input. + class BatchDocumentsImportConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The config for auto-split. + # @!attribute [rw] training_split_ratio + # @return [::Float] + # Ratio of training dataset split. + class AutoSplitConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Response of the import document operation. + class ImportDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the import document operation. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + # @!attribute [rw] individual_import_statuses + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsMetadata::IndividualImportStatus>] + # The list of response details of each document. + # @!attribute [rw] import_config_validation_results + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsMetadata::ImportConfigValidationResult>] + # Validation statuses of the batch documents import config. + # @!attribute [rw] total_document_count + # @return [::Integer] + # Total number of the documents that are qualified for importing. + class ImportDocumentsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of each individual document in the import process. + # @!attribute [rw] input_gcs_source + # @return [::String] + # The source Cloud Storage URI of the document. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status of the importing of the document. + # @!attribute [rw] output_document_id + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId] + # The document id of imported document if it was successful, otherwise + # empty. + class IndividualImportStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The validation status of each import config. Status is set to errors if + # there is no documents to import in the import_config, or OK if the + # operation will try to proceed at least one document. + # @!attribute [rw] input_gcs_source + # @return [::String] + # The source Cloud Storage URI specified in the import config. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The validation status of import config. + class ImportConfigValidationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] dataset + # @return [::String] + # Required. The resource name of the dataset that the document belongs to . + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @!attribute [rw] document_id + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId] + # Required. Document identifier. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # If set, only fields listed here will be returned. Otherwise, all fields + # will be returned by default. + # @!attribute [rw] page_range + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange] + # List of pages for which the fields specified in the `read_mask` must + # be served. + class GetDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + class GetDocumentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] dataset + # @return [::String] + # Required. The dataset resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset + # @!attribute [rw] dataset_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments] + # Required. Dataset documents input. If given `filter`, all documents + # satisfying the filter will be deleted. If given documentIds, a maximum of + # 50 documents can be deleted in a batch. The request will be rejected if + # more than 50 document_ids are provided. + class BatchDeleteDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the delete documents operation. + class BatchDeleteDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + # @!attribute [rw] individual_batch_delete_statuses + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsMetadata::IndividualBatchDeleteStatus>] + # The list of response details of each document. + # @!attribute [rw] total_document_count + # @return [::Integer] + # Total number of documents deleting from dataset. + # @!attribute [rw] error_document_count + # @return [::Integer] + # Total number of documents that failed to be deleted in storage. + class BatchDeleteDocumentsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of each individual document in the batch delete process. + # @!attribute [rw] document_id + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId] + # The document id of the document. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status of deleting the document in storage. + class IndividualBatchDeleteStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for `GetDatasetSchema`. + # @!attribute [rw] name + # @return [::String] + # Required. The dataset schema resource name. + # Format: + # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset/datasetSchema + # @!attribute [rw] visible_fields_only + # @return [::Boolean] + # If set, only returns the visible fields of the schema. + class GetDatasetSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `UpdateDatasetSchema`. + # @!attribute [rw] dataset_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] + # Required. The name field of the `DatasetSchema` is used to identify the + # resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The update mask applies to the resource. + class UpdateDatasetSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Range of pages present in a document. + # @!attribute [rw] start + # @return [::Integer] + # First page number (one-based index) to be returned. + # @!attribute [rw] end + # @return [::Integer] + # Last page number (one-based index) to be returned. + class DocumentPageRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Documents belonging to a dataset will be split into different groups + # referred to as splits: train, test. + module DatasetSplitType + # Default value if the enum is not set. + # go/protodosdonts#do-include-an-unspecified-value-in-an-enum + DATASET_SPLIT_TYPE_UNSPECIFIED = 0 + + # Identifies the train documents. + DATASET_SPLIT_TRAIN = 1 + + # Identifies the test documents. + DATASET_SPLIT_TEST = 2 + + # Identifies the unassigned documents. + DATASET_SPLIT_UNASSIGNED = 3 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb new file mode 100644 index 000000000000..95fe6e3ce601 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Gives a short summary of an evaluation, and links to the evaluation itself. + # @!attribute [rw] operation + # @return [::String] + # The resource name of the Long Running Operation for the evaluation. + # @!attribute [rw] evaluation + # @return [::String] + # The resource name of the evaluation. + # @!attribute [rw] aggregate_metrics + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] + # An aggregate of the statistics for the evaluation with fuzzy matching on. + # @!attribute [rw] aggregate_metrics_exact + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] + # An aggregate of the statistics for the evaluation with fuzzy matching off. + class EvaluationReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An evaluation of a ProcessorVersion's performance. + # @!attribute [rw] name + # @return [::String] + # The resource name of the evaluation. + # Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time that the evaluation was created. + # @!attribute [rw] document_counters + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Counters] + # Counters for the documents used in the evaluation. + # @!attribute [rw] all_entities_metrics + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] + # Metrics for all the entities in aggregate. + # @!attribute [rw] entity_metrics + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics}] + # Metrics across confidence levels, for different entities. + # @!attribute [rw] kms_key_name + # @return [::String] + # The KMS key name used for encryption. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # The KMS key version with which data is encrypted. + class Evaluation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Evaluation counters for the documents that were used. + # @!attribute [rw] input_documents_count + # @return [::Integer] + # How many documents were sent for evaluation. + # @!attribute [rw] invalid_documents_count + # @return [::Integer] + # How many documents were not included in the evaluation as they didn't + # pass validation. + # @!attribute [rw] failed_documents_count + # @return [::Integer] + # How many documents were not included in the evaluation as Document AI + # failed to process them. + # @!attribute [rw] evaluated_documents_count + # @return [::Integer] + # How many documents were used in the evaluation. + class Counters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluation metrics, either in aggregate or about a specific entity. + # @!attribute [rw] precision + # @return [::Float] + # The calculated precision. + # @!attribute [rw] recall + # @return [::Float] + # The calculated recall. + # @!attribute [rw] f1_score + # @return [::Float] + # The calculated f1 score. + # @!attribute [rw] predicted_occurrences_count + # @return [::Integer] + # The amount of occurrences in predicted documents. + # @!attribute [rw] ground_truth_occurrences_count + # @return [::Integer] + # The amount of occurrences in ground truth documents. + # @!attribute [rw] predicted_document_count + # @return [::Integer] + # The amount of documents with a predicted occurrence. + # @!attribute [rw] ground_truth_document_count + # @return [::Integer] + # The amount of documents with a ground truth occurrence. + # @!attribute [rw] true_positives_count + # @return [::Integer] + # The amount of true positives. + # @!attribute [rw] false_positives_count + # @return [::Integer] + # The amount of false positives. + # @!attribute [rw] false_negatives_count + # @return [::Integer] + # The amount of false negatives. + # @!attribute [rw] total_documents_count + # @return [::Integer] + # The amount of documents that had an occurrence of this label. + class Metrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluations metrics, at a specific confidence level. + # @!attribute [rw] confidence_level + # @return [::Float] + # The confidence level. + # @!attribute [rw] metrics + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] + # The metrics at the specific confidence level. + class ConfidenceLevelMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metrics across multiple confidence levels. + # @!attribute [rw] confidence_level_metrics + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] + # Metrics across confidence levels with fuzzy matching enabled. + # @!attribute [rw] confidence_level_metrics_exact + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] + # Metrics across confidence levels with only exact matching. + # @!attribute [rw] auprc + # @return [::Float] + # The calculated area under the precision recall curve (AUPRC), computed by + # integrating over all confidence thresholds. + # @!attribute [rw] estimated_calibration_error + # @return [::Float] + # The Estimated Calibration Error (ECE) of the confidence of the predicted + # entities. + # @!attribute [rw] auprc_exact + # @return [::Float] + # The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + # only. + # @!attribute [rw] estimated_calibration_error_exact + # @return [::Float] + # The ECE for the predicted entities with fuzzy matching disabled, i.e., + # exact matching only. + # @!attribute [rw] metrics_type + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics::MetricsType] + # The metrics type for the label. + class MultiConfidenceMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A type that determines how metrics should be interpreted. + module MetricsType + # The metrics type is unspecified. By default, metrics without a + # particular specification are for leaf entity types (i.e., top-level + # entity types without child types, or child types which are not + # parent types themselves). + METRICS_TYPE_UNSPECIFIED = 0 + + # Indicates whether metrics for this particular label type represent an + # aggregate of metrics for other types instead of being based on actual + # TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) + # entity types are an aggregate of metrics for their children. + AGGREGATE = 1 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] + class EntityMetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb new file mode 100644 index 000000000000..6beba3a11eb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # A vertex represents a 2D point in the image. + # NOTE: the vertex coordinates are in the same scale as the original image. + # @!attribute [rw] x + # @return [::Integer] + # X coordinate. + # @!attribute [rw] y + # @return [::Integer] + # Y coordinate (starts from the top of the image). + class Vertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A vertex represents a 2D point in the image. + # NOTE: the normalized vertex coordinates are relative to the original image + # and range from 0 to 1. + # @!attribute [rw] x + # @return [::Float] + # X coordinate. + # @!attribute [rw] y + # @return [::Float] + # Y coordinate (starts from the top of the image). + class NormalizedVertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A bounding polygon for the detected image annotation. + # @!attribute [rw] vertices + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Vertex>] + # The bounding polygon vertices. + # @!attribute [rw] normalized_vertices + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::NormalizedVertex>] + # The bounding polygon normalized vertices. + class BoundingPoly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb new file mode 100644 index 000000000000..663e5b3fa6b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # The common metadata for long running operations. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State] + # The state of the operation. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # @!attribute [rw] resource + # @return [::String] + # A related resource to this operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + class CommonOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the longrunning operation. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # Operation is still running. + RUNNING = 1 + + # Operation is being cancelled. + CANCELLING = 2 + + # Operation succeeded. + SUCCEEDED = 3 + + # Operation failed. + FAILED = 4 + + # Operation is cancelled. + CANCELLED = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb new file mode 100644 index 000000000000..f3e2e0c5ee49 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # A processor version is an implementation of a processor. Each processor + # can have multiple versions, pretrained by Google internally or uptrained + # by the customer. A processor can only have one default version at a time. + # Its document-processing behavior is defined by that version. + # @!attribute [rw] name + # @return [::String] + # The resource name of the processor version. + # Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + # @!attribute [rw] display_name + # @return [::String] + # The display name of the processor version. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # The schema of the processor version. Describes the output. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::State] + # The state of the processor version. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the processor version was created. + # @!attribute [rw] latest_evaluation + # @return [::Google::Cloud::DocumentAI::V1beta3::EvaluationReference] + # The most recently invoked evaluation for the processor version. + # @!attribute [rw] kms_key_name + # @return [::String] + # The KMS key name used for encryption. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # The KMS key version with which data is encrypted. + # @!attribute [r] google_managed + # @return [::Boolean] + # Output only. Denotes that this `ProcessorVersion` is managed by Google. + # @!attribute [rw] deprecation_info + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::DeprecationInfo] + # If set, information about the eventual deprecation of this version. + class ProcessorVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about the upcoming deprecation of this processor version. + # @!attribute [rw] deprecation_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this processor version will be deprecated. + # @!attribute [rw] replacement_processor_version + # @return [::String] + # If set, the processor version that will be used as a replacement. + class DeprecationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The possible states of the processor version. + module State + # The processor version is in an unspecified state. + STATE_UNSPECIFIED = 0 + + # The processor version is deployed and can be used for processing. + DEPLOYED = 1 + + # The processor version is being deployed. + DEPLOYING = 2 + + # The processor version is not deployed and cannot be used for processing. + UNDEPLOYED = 3 + + # The processor version is being undeployed. + UNDEPLOYING = 4 + + # The processor version is being created. + CREATING = 5 + + # The processor version is being deleted. + DELETING = 6 + + # The processor version failed and is in an indeterminate state. + FAILED = 7 + + # The processor version is being imported. + IMPORTING = 8 + end + end + + # The first-class citizen for Document AI. Each processor defines how to + # extract structural information from a document. + # @!attribute [r] name + # @return [::String] + # Output only. Immutable. The resource name of the processor. + # Format: `projects/{project}/locations/{location}/processors/{processor}` + # @!attribute [rw] type + # @return [::String] + # The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + # To get a list of processor types, see + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes}. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the processor. + # @!attribute [r] state + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor::State] + # Output only. The state of the processor. + # @!attribute [rw] default_processor_version + # @return [::String] + # The default processor version. + # @!attribute [r] process_endpoint + # @return [::String] + # Output only. Immutable. The http endpoint that can be called to invoke + # processing. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the processor was created. + # @!attribute [rw] kms_key_name + # @return [::String] + # The [KMS key](https://cloud.google.com/security-key-management) used for + # encryption and decryption in CMEK scenarios. + class Processor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible states of the processor. + module State + # The processor is in an unspecified state. + STATE_UNSPECIFIED = 0 + + # The processor is enabled, i.e., has an enabled version which can + # currently serve processing requests and all the feature dependencies have + # been successfully initialized. + ENABLED = 1 + + # The processor is disabled. + DISABLED = 2 + + # The processor is being enabled, will become `ENABLED` if successful. + ENABLING = 3 + + # The processor is being disabled, will become `DISABLED` if successful. + DISABLING = 4 + + # The processor is being created, will become either `ENABLED` (for + # successful creation) or `FAILED` (for failed ones). + # Once a processor is in this state, it can then be used for document + # processing, but the feature dependencies of the processor might not be + # fully created yet. + CREATING = 5 + + # The processor failed during creation or initialization of feature + # dependencies. The user should delete the processor and recreate one as + # all the functionalities of the processor are disabled. + FAILED = 6 + + # The processor is being deleted, will be removed if successful. + DELETING = 7 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb new file mode 100644 index 000000000000..d0ea070d91fa --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # A processor type is responsible for performing a certain document + # understanding task on a certain type of document. + # @!attribute [rw] name + # @return [::String] + # The resource name of the processor type. + # Format: `projects/{project}/processorTypes/{processor_type}` + # @!attribute [rw] type + # @return [::String] + # The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + # @!attribute [rw] category + # @return [::String] + # The processor category, used by UI to group processor types. + # @!attribute [rw] available_locations + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType::LocationInfo>] + # The locations in which this processor is available. + # @!attribute [rw] allow_creation + # @return [::Boolean] + # Whether the processor type allows creation. If true, users can create a + # processor of this processor type. Otherwise, users need to request access. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of the processor type + # @!attribute [rw] sample_document_uris + # @return [::Array<::String>] + # A set of Cloud Storage URIs of sample documents for this processor. + class ProcessorType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The location information about where the processor is available. + # @!attribute [rw] location_id + # @return [::String] + # The location ID. For supported locations, refer to [regional and + # multi-regional support](/document-ai/docs/regions). + class LocationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..08ab43c84ae9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..629894f93777 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b4a53d0ac67f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..4c0ad96e8eb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..c437e42a7581 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..b7de80e5ed7f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..3f28f1fb18f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..6f72e88c418d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb new file mode 100644 index 000000000000..139261bdf919 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a color in the RGBA color space. This representation is designed + # for simplicity of conversion to/from color representations in various + # languages over compactness. For example, the fields of this representation + # can be trivially provided to the constructor of `java.awt.Color` in Java; it + # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` + # method in iOS; and, with just a little work, it can be easily formatted into + # a CSS `rgba()` string in JavaScript. + # + # This reference page doesn't carry information about the absolute color + # space + # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, + # DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color + # space. + # + # When color equality needs to be decided, implementations, unless + # documented otherwise, treat two colors as equal if all their red, + # green, blue, and alpha values each differ by at most 1e-5. + # + # Example (Java): + # + # import com.google.type.Color; + # + # // ... + # public static java.awt.Color fromProto(Color protocolor) { + # float alpha = protocolor.hasAlpha() + # ? protocolor.getAlpha().getValue() + # : 1.0; + # + # return new java.awt.Color( + # protocolor.getRed(), + # protocolor.getGreen(), + # protocolor.getBlue(), + # alpha); + # } + # + # public static Color toProto(java.awt.Color color) { + # float red = (float) color.getRed(); + # float green = (float) color.getGreen(); + # float blue = (float) color.getBlue(); + # float denominator = 255.0; + # Color.Builder resultBuilder = + # Color + # .newBuilder() + # .setRed(red / denominator) + # .setGreen(green / denominator) + # .setBlue(blue / denominator); + # int alpha = color.getAlpha(); + # if (alpha != 255) { + # result.setAlpha( + # FloatValue + # .newBuilder() + # .setValue(((float) alpha) / denominator) + # .build()); + # } + # return resultBuilder.build(); + # } + # // ... + # + # Example (iOS / Obj-C): + # + # // ... + # static UIColor* fromProto(Color* protocolor) { + # float red = [protocolor red]; + # float green = [protocolor green]; + # float blue = [protocolor blue]; + # FloatValue* alpha_wrapper = [protocolor alpha]; + # float alpha = 1.0; + # if (alpha_wrapper != nil) { + # alpha = [alpha_wrapper value]; + # } + # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; + # } + # + # static Color* toProto(UIColor* color) { + # CGFloat red, green, blue, alpha; + # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { + # return nil; + # } + # Color* result = [[Color alloc] init]; + # [result setRed:red]; + # [result setGreen:green]; + # [result setBlue:blue]; + # if (alpha <= 0.9999) { + # [result setAlpha:floatWrapperWithValue(alpha)]; + # } + # [result autorelease]; + # return result; + # } + # // ... + # + # Example (JavaScript): + # + # // ... + # + # var protoToCssColor = function(rgb_color) { + # var redFrac = rgb_color.red || 0.0; + # var greenFrac = rgb_color.green || 0.0; + # var blueFrac = rgb_color.blue || 0.0; + # var red = Math.floor(redFrac * 255); + # var green = Math.floor(greenFrac * 255); + # var blue = Math.floor(blueFrac * 255); + # + # if (!('alpha' in rgb_color)) { + # return rgbToCssColor(red, green, blue); + # } + # + # var alphaFrac = rgb_color.alpha.value || 0.0; + # var rgbParams = [red, green, blue].join(','); + # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); + # }; + # + # var rgbToCssColor = function(red, green, blue) { + # var rgbNumber = new Number((red << 16) | (green << 8) | blue); + # var hexString = rgbNumber.toString(16); + # var missingZeros = 6 - hexString.length; + # var resultBuilder = ['#']; + # for (var i = 0; i < missingZeros; i++) { + # resultBuilder.push('0'); + # } + # resultBuilder.push(hexString); + # return resultBuilder.join(''); + # }; + # + # // ... + # @!attribute [rw] red + # @return [::Float] + # The amount of red in the color as a value in the interval [0, 1]. + # @!attribute [rw] green + # @return [::Float] + # The amount of green in the color as a value in the interval [0, 1]. + # @!attribute [rw] blue + # @return [::Float] + # The amount of blue in the color as a value in the interval [0, 1]. + # @!attribute [rw] alpha + # @return [::Google::Protobuf::FloatValue] + # The fraction of this color that should be applied to the pixel. That is, + # the final pixel color is defined by the equation: + # + # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + # + # This means that a value of 1.0 corresponds to a solid color, whereas + # a value of 0.0 corresponds to a completely transparent color. This + # uses a wrapper message rather than a simple float scalar so that it is + # possible to distinguish between a default value and the value being unset. + # If omitted, this color object is rendered as a solid color + # (as if the alpha value had been explicitly given a value of 1.0). + class Color + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..086a71b4869a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a whole or partial calendar date, such as a birthday. The time of + # day and time zone are either specified elsewhere or are insignificant. The + # date is relative to the Gregorian Calendar. This can represent one of the + # following: + # + # * A full date, with non-zero year, month, and day values + # * A month and day value, with a zero year, such as an anniversary + # * A year on its own, with zero month and day values + # * A year and month value, with a zero day, such as a credit card expiration + # date + # + # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] year + # @return [::Integer] + # Year of the date. Must be from 1 to 9999, or 0 to specify a date without + # a year. + # @!attribute [rw] month + # @return [::Integer] + # Month of a year. Must be from 1 to 12, or 0 to specify a year without a + # month and day. + # @!attribute [rw] day + # @return [::Integer] + # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + # to specify a year by itself or a year and month where the day isn't + # significant. + class Date + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb new file mode 100644 index 000000000000..2d8961edc217 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents civil time (or occasionally physical time). + # + # This type can represent a civil time in one of a few possible ways: + # + # * When utc_offset is set and time_zone is unset: a civil time on a calendar + # day with a particular offset from UTC. + # * When time_zone is set and utc_offset is unset: a civil time on a calendar + # day in a particular time zone. + # * When neither time_zone nor utc_offset is set: a civil time on a calendar + # day in local time. + # + # The date is relative to the Proleptic Gregorian Calendar. + # + # If year is 0, the DateTime is considered not to have a specific year. month + # and day must have valid, non-zero values. + # + # This type may also be used to represent a physical time if all the date and + # time fields are set and either case of the `time_offset` oneof is set. + # Consider using `Timestamp` message for physical time instead. If your use + # case also would like to store the user's timezone, that can be done in + # another field. + # + # This type is more flexible than some applications may want. Make sure to + # document and validate your application's limitations. + # @!attribute [rw] year + # @return [::Integer] + # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + # datetime without a year. + # @!attribute [rw] month + # @return [::Integer] + # Required. Month of year. Must be from 1 to 12. + # @!attribute [rw] day + # @return [::Integer] + # Required. Day of month. Must be from 1 to 31 and valid for the year and + # month. + # @!attribute [rw] hours + # @return [::Integer] + # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + # may choose to allow the value "24:00:00" for scenarios like business + # closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Required. Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + # API may allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Required. Fractions of seconds in nanoseconds. Must be from 0 to + # 999,999,999. + # @!attribute [rw] utc_offset + # @return [::Google::Protobuf::Duration] + # UTC offset. Must be whole seconds, between -18 hours and +18 hours. + # For example, a UTC offset of -4:00 would be represented as + # { seconds: -14400 }. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone. + class DateTime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a time zone from the + # [IANA Time Zone Database](https://www.iana.org/time-zones). + # @!attribute [rw] id + # @return [::String] + # IANA Time Zone Database time zone, e.g. "America/New_York". + # @!attribute [rw] version + # @return [::String] + # Optional. IANA Time Zone Database version number, e.g. "2019a". + class TimeZone + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb new file mode 100644 index 000000000000..800ef43f01cb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents an amount of money with its currency type. + # @!attribute [rw] currency_code + # @return [::String] + # The three-letter currency code defined in ISO 4217. + # @!attribute [rw] units + # @return [::Integer] + # The whole units of the amount. + # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + # @!attribute [rw] nanos + # @return [::Integer] + # Number of nano (10^-9) units of the amount. + # The value must be between -999,999,999 and +999,999,999 inclusive. + # If `units` is positive, `nanos` must be positive or zero. + # If `units` is zero, `nanos` can be positive, zero, or negative. + # If `units` is negative, `nanos` must be negative or zero. + # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + class Money + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb new file mode 100644 index 000000000000..cd58486c563e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a postal address, e.g. for postal delivery or payments addresses. + # Given a postal address, a postal service can deliver items to a premise, P.O. + # Box or similar. + # It is not intended to model geographical locations (roads, towns, + # mountains). + # + # In typical usage an address would be created via user input or from importing + # existing data, depending on the type of process. + # + # Advice on address input / editing: + # - Use an i18n-ready address widget such as + # https://github.com/google/libaddressinput) + # - Users should not be presented with UI elements for input or editing of + # fields outside countries where that field is used. + # + # For more guidance on how to use this schema, please see: + # https://support.google.com/business/answer/6397478 + # @!attribute [rw] revision + # @return [::Integer] + # The schema revision of the `PostalAddress`. This must be set to 0, which is + # the latest revision. + # + # All new revisions **must** be backward compatible with old revisions. + # @!attribute [rw] region_code + # @return [::String] + # Required. CLDR region code of the country/region of the address. This + # is never inferred and it is up to the user to ensure the value is + # correct. See http://cldr.unicode.org/ and + # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] language_code + # @return [::String] + # Optional. BCP-47 language code of the contents of this address (if + # known). This is often the UI language of the input form or is expected + # to match one of the languages used in the address' country/region, or their + # transliterated equivalents. + # This can affect formatting in certain countries, but is not critical + # to the correctness of the data and will never affect any validation or + # other non-formatting related operations. + # + # If this value is not known, it should be omitted (rather than specifying a + # possibly incorrect default). + # + # Examples: "zh-Hant", "ja", "ja-Latn", "en". + # @!attribute [rw] postal_code + # @return [::String] + # Optional. Postal code of the address. Not all countries use or require + # postal codes to be present, but where they are used, they may trigger + # additional validation with other parts of the address (e.g. state/zip + # validation in the U.S.A.). + # @!attribute [rw] sorting_code + # @return [::String] + # Optional. Additional, country-specific, sorting code. This is not used + # in most regions. Where it is used, the value is either a string like + # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + # alone, representing the "sector code" (Jamaica), "delivery area indicator" + # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + # @!attribute [rw] administrative_area + # @return [::String] + # Optional. Highest administrative subdivision which is used for postal + # addresses of a country or region. + # For example, this can be a state, a province, an oblast, or a prefecture. + # Specifically, for Spain this is the province and not the autonomous + # community (e.g. "Barcelona" and not "Catalonia"). + # Many countries don't use an administrative area in postal addresses. E.g. + # in Switzerland this should be left unpopulated. + # @!attribute [rw] locality + # @return [::String] + # Optional. Generally refers to the city/town portion of the address. + # Examples: US city, IT comune, UK post town. + # In regions of the world where localities are not well defined or do not fit + # into this structure well, leave locality empty and use address_lines. + # @!attribute [rw] sublocality + # @return [::String] + # Optional. Sublocality of the address. + # For example, this can be neighborhoods, boroughs, districts. + # @!attribute [rw] address_lines + # @return [::Array<::String>] + # Unstructured address lines describing the lower levels of an address. + # + # Because values in address_lines do not have type information and may + # sometimes contain multiple values in a single field (e.g. + # "Austin, TX"), it is important that the line order is clear. The order of + # address lines should be "envelope order" for the country/region of the + # address. In places where this can vary (e.g. Japan), address_language is + # used to make it explicit (e.g. "ja" for large-to-small ordering and + # "ja-Latn" or "en" for small-to-large). This way, the most specific line of + # an address can be selected based on the language. + # + # The minimum permitted structural representation of an address consists + # of a region_code with all remaining information placed in the + # address_lines. It would be possible to format such an address very + # approximately without geocoding, but no semantic reasoning could be + # made about any of the address components until it was at least + # partially resolved. + # + # Creating an address only containing a region_code and address_lines, and + # then geocoding is the recommended way to handle completely unstructured + # addresses (as opposed to guessing which parts of the address should be + # localities or administrative areas). + # @!attribute [rw] recipients + # @return [::Array<::String>] + # Optional. The recipient at the address. + # This field may, under certain circumstances, contain multiline information. + # For example, it might contain "care of" information. + # @!attribute [rw] organization + # @return [::String] + # Optional. The name of the organization at the address. + class PostalAddress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile new file mode 100644 index 000000000000..83a1cdf1d4f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-document_ai-v1beta3", path: "../" +else + gem "google-cloud-document_ai-v1beta3" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb new file mode 100644 index 000000000000..fa3a60379df8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the batch_process_documents call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents. +# It may require modification in order to execute successfully. +# +def batch_process_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new + + # Call the batch_process_documents method. + result = client.batch_process_documents request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb new file mode 100644 index 000000000000..defc60d73542 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the create_processor call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor. +# It may require modification in order to execute successfully. +# +def create_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new + + # Call the create_processor method. + result = client.create_processor request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb new file mode 100644 index 000000000000..2a1145291dee --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the delete_processor call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor. +# It may require modification in order to execute successfully. +# +def delete_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new + + # Call the delete_processor method. + result = client.delete_processor request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb new file mode 100644 index 000000000000..c897494ffc8b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the delete_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version. +# It may require modification in order to execute successfully. +# +def delete_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new + + # Call the delete_processor_version method. + result = client.delete_processor_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb new file mode 100644 index 000000000000..0170c85c4c1d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the deploy_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version. +# It may require modification in order to execute successfully. +# +def deploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new + + # Call the deploy_processor_version method. + result = client.deploy_processor_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb new file mode 100644 index 000000000000..8a5bd99db3a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the disable_processor call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor. +# It may require modification in order to execute successfully. +# +def disable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new + + # Call the disable_processor method. + result = client.disable_processor request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb new file mode 100644 index 000000000000..2ba25bf182c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the enable_processor call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor. +# It may require modification in order to execute successfully. +# +def enable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new + + # Call the enable_processor method. + result = client.enable_processor request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb new file mode 100644 index 000000000000..28e5ab341f8d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the evaluate_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version. +# It may require modification in order to execute successfully. +# +def evaluate_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + + # Call the evaluate_processor_version method. + result = client.evaluate_processor_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb new file mode 100644 index 000000000000..9e863b30ff58 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the fetch_processor_types call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types. +# It may require modification in order to execute successfully. +# +def fetch_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new + + # Call the fetch_processor_types method. + result = client.fetch_processor_types request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb new file mode 100644 index 000000000000..1c31420e55d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the get_evaluation call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation. +# It may require modification in order to execute successfully. +# +def get_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + + # Call the get_evaluation method. + result = client.get_evaluation request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb new file mode 100644 index 000000000000..75a79fcc7db4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the get_processor call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor. +# It may require modification in order to execute successfully. +# +def get_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new + + # Call the get_processor method. + result = client.get_processor request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb new file mode 100644 index 000000000000..ea4ac6aaa00d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the get_processor_type call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type. +# It may require modification in order to execute successfully. +# +def get_processor_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new + + # Call the get_processor_type method. + result = client.get_processor_type request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb new file mode 100644 index 000000000000..fc2447d64cc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the get_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version. +# It may require modification in order to execute successfully. +# +def get_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new + + # Call the get_processor_version method. + result = client.get_processor_version request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb new file mode 100644 index 000000000000..162b8eeb4f8e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the import_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version. +# It may require modification in order to execute successfully. +# +def import_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new + + # Call the import_processor_version method. + result = client.import_processor_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb new file mode 100644 index 000000000000..efa06cf7b855 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the list_evaluations call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations. +# It may require modification in order to execute successfully. +# +def list_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + + # Call the list_evaluations method. + result = client.list_evaluations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + p item + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb new file mode 100644 index 000000000000..eb6ab8a5ad6a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the list_processor_types call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types. +# It may require modification in order to execute successfully. +# +def list_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new + + # Call the list_processor_types method. + result = client.list_processor_types request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. + p item + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb new file mode 100644 index 000000000000..a159efcb88eb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the list_processor_versions call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions. +# It may require modification in order to execute successfully. +# +def list_processor_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new + + # Call the list_processor_versions method. + result = client.list_processor_versions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + p item + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb new file mode 100644 index 000000000000..ccb002bb2b36 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the list_processors call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors. +# It may require modification in order to execute successfully. +# +def list_processors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new + + # Call the list_processors method. + result = client.list_processors request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. + p item + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb new file mode 100644 index 000000000000..bec241717ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the process_document call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document. +# It may require modification in order to execute successfully. +# +def process_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new + + # Call the process_document method. + result = client.process_document request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb new file mode 100644 index 000000000000..0327a3f4c18d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the review_document call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document. +# It may require modification in order to execute successfully. +# +def review_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new + + # Call the review_document method. + result = client.review_document request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb new file mode 100644 index 000000000000..fd64302ce285 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the set_default_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version. +# It may require modification in order to execute successfully. +# +def set_default_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new + + # Call the set_default_processor_version method. + result = client.set_default_processor_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb new file mode 100644 index 000000000000..0b788c5f9e3f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the train_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version. +# It may require modification in order to execute successfully. +# +def train_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + + # Call the train_processor_version method. + result = client.train_processor_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb new file mode 100644 index 000000000000..d847773d49b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the undeploy_processor_version call in the DocumentProcessorService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version. +# It may require modification in order to execute successfully. +# +def undeploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new + + # Call the undeploy_processor_version method. + result = client.undeploy_processor_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb new file mode 100644 index 000000000000..b643a881aef7 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the batch_delete_documents call in the DocumentService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#batch_delete_documents. +# It may require modification in order to execute successfully. +# +def batch_delete_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new + + # Call the batch_delete_documents method. + result = client.batch_delete_documents request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb new file mode 100644 index 000000000000..9ef2f0aaf4ab --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentService_GetDatasetSchema_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the get_dataset_schema call in the DocumentService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_dataset_schema. +# It may require modification in order to execute successfully. +# +def get_dataset_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new + + # Call the get_dataset_schema method. + result = client.get_dataset_schema request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + p result +end +# [END documentai_v1beta3_generated_DocumentService_GetDatasetSchema_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb new file mode 100644 index 000000000000..171affa9ffec --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentService_GetDocument_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the get_document call in the DocumentService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_document. It +# may require modification in order to execute successfully. +# +def get_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new + + # Call the get_document method. + result = client.get_document request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse. + p result +end +# [END documentai_v1beta3_generated_DocumentService_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb new file mode 100644 index 000000000000..18f8df9efb64 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentService_ImportDocuments_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the import_documents call in the DocumentService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#import_documents. +# It may require modification in order to execute successfully. +# +def import_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new + + # Call the import_documents method. + result = client.import_documents request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentService_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb new file mode 100644 index 000000000000..c7fd118cac31 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentService_UpdateDataset_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the update_dataset call in the DocumentService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset. It +# may require modification in order to execute successfully. +# +def update_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new + + # Call the update_dataset method. + result = client.update_dataset request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END documentai_v1beta3_generated_DocumentService_UpdateDataset_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb new file mode 100644 index 000000000000..e1fe019bdad5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Snippet for the update_dataset_schema call in the DocumentService service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset_schema. +# It may require modification in order to execute successfully. +# +def update_dataset_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new + + # Call the update_dataset_schema method. + result = client.update_dataset_schema request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + p result +end +# [END documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json new file mode 100644 index 000000000000..e5668ebe3210 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -0,0 +1,1175 @@ +{ + "client_library": { + "name": "google-cloud-document_ai-v1beta3", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.documentai.v1beta3", + "version": "v1beta3" + } + ] + }, + "snippets": [ + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync", + "title": "Snippet for the process_document call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document. It may require modification in order to execute successfully.", + "file": "document_processor_service/process_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "process_document", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ProcessDocument", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync", + "title": "Snippet for the batch_process_documents call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents. It may require modification in order to execute successfully.", + "file": "document_processor_service/batch_process_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_process_documents", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "BatchProcessDocuments", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync", + "title": "Snippet for the fetch_processor_types call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types. It may require modification in order to execute successfully.", + "file": "document_processor_service/fetch_processor_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_processor_types", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "FetchProcessorTypes", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync", + "title": "Snippet for the list_processor_types call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types. It may require modification in order to execute successfully.", + "file": "document_processor_service/list_processor_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processor_types", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessorTypes", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync", + "title": "Snippet for the get_processor_type call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type. It may require modification in order to execute successfully.", + "file": "document_processor_service/get_processor_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor_type", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorType", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessorType", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync", + "title": "Snippet for the list_processors call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors. It may require modification in order to execute successfully.", + "file": "document_processor_service/list_processors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processors", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessors", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync", + "title": "Snippet for the get_processor call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor. It may require modification in order to execute successfully.", + "file": "document_processor_service/get_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync", + "title": "Snippet for the train_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/train_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "train_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "TrainProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync", + "title": "Snippet for the get_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/get_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync", + "title": "Snippet for the list_processor_versions call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions. It may require modification in order to execute successfully.", + "file": "document_processor_service/list_processor_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processor_versions", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessorVersions", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync", + "title": "Snippet for the delete_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/delete_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeleteProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync", + "title": "Snippet for the deploy_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/deploy_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "deploy_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeployProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync", + "title": "Snippet for the undeploy_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/undeploy_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "undeploy_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "UndeployProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync", + "title": "Snippet for the create_processor call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor. It may require modification in order to execute successfully.", + "file": "document_processor_service/create_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "CreateProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync", + "title": "Snippet for the delete_processor call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor. It may require modification in order to execute successfully.", + "file": "document_processor_service/delete_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeleteProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync", + "title": "Snippet for the enable_processor call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor. It may require modification in order to execute successfully.", + "file": "document_processor_service/enable_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "EnableProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync", + "title": "Snippet for the disable_processor call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor. It may require modification in order to execute successfully.", + "file": "document_processor_service/disable_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DisableProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync", + "title": "Snippet for the set_default_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/set_default_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_default_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "SetDefaultProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync", + "title": "Snippet for the review_document call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document. It may require modification in order to execute successfully.", + "file": "document_processor_service/review_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "review_document", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ReviewDocument", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync", + "title": "Snippet for the evaluate_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/evaluate_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "evaluate_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "EvaluateProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync", + "title": "Snippet for the get_evaluation call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation. It may require modification in order to execute successfully.", + "file": "document_processor_service/get_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_evaluation", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::Evaluation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetEvaluation", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync", + "title": "Snippet for the list_evaluations call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations. It may require modification in order to execute successfully.", + "file": "document_processor_service/list_evaluations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_evaluations", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListEvaluations", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_sync", + "title": "Snippet for the import_processor_version call in the DocumentProcessorService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version. It may require modification in order to execute successfully.", + "file": "document_processor_service/import_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ImportProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentService_UpdateDataset_sync", + "title": "Snippet for the update_dataset call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset. It may require modification in order to execute successfully.", + "file": "document_service/update_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_dataset", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" + }, + "method": { + "short_name": "UpdateDataset", + "full_name": "google.cloud.documentai.v1beta3.DocumentService.UpdateDataset", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.documentai.v1beta3.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentService_ImportDocuments_sync", + "title": "Snippet for the import_documents call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#import_documents. It may require modification in order to execute successfully.", + "file": "document_service/import_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_documents", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#import_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" + }, + "method": { + "short_name": "ImportDocuments", + "full_name": "google.cloud.documentai.v1beta3.DocumentService.ImportDocuments", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.documentai.v1beta3.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentService_GetDocument_sync", + "title": "Snippet for the get_document call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_document. It may require modification in order to execute successfully.", + "file": "document_service/get_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_document", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" + }, + "method": { + "short_name": "GetDocument", + "full_name": "google.cloud.documentai.v1beta3.DocumentService.GetDocument", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.documentai.v1beta3.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_sync", + "title": "Snippet for the batch_delete_documents call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#batch_delete_documents. It may require modification in order to execute successfully.", + "file": "document_service/batch_delete_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_documents", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#batch_delete_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" + }, + "method": { + "short_name": "BatchDeleteDocuments", + "full_name": "google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocuments", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.documentai.v1beta3.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 48, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentService_GetDatasetSchema_sync", + "title": "Snippet for the get_dataset_schema call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_dataset_schema. It may require modification in order to execute successfully.", + "file": "document_service/get_dataset_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dataset_schema", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_dataset_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::DatasetSchema", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" + }, + "method": { + "short_name": "GetDatasetSchema", + "full_name": "google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchema", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.documentai.v1beta3.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_sync", + "title": "Snippet for the update_dataset_schema call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset_schema. It may require modification in order to execute successfully.", + "file": "document_service/update_dataset_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_dataset_schema", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::DatasetSchema", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" + }, + "method": { + "short_name": "UpdateDatasetSchema", + "full_name": "google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchema", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.documentai.v1beta3.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb new file mode 100644 index 000000000000..fef6ec26facd --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" +require "google/cloud/document_ai/v1beta3/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb new file mode 100644 index 000000000000..7caf5491ec9c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/document_ai/v1beta3/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientPathsTest < Minitest::Test + def test_evaluation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.evaluation_path project: "value0", location: "value1", processor: "value2", processor_version: "value3", evaluation: "value4" + assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3/evaluations/value4", path + end + end + + def test_human_review_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.human_review_config_path project: "value0", location: "value1", processor: "value2" + assert_equal "projects/value0/locations/value1/processors/value2/humanReviewConfig", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_processor_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.processor_path project: "value0", location: "value1", processor: "value2" + assert_equal "projects/value0/locations/value1/processors/value2", path + end + end + + def test_processor_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.processor_type_path project: "value0", location: "value1", processor_type: "value2" + assert_equal "projects/value0/locations/value1/processorTypes/value2", path + end + end + + def test_processor_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.processor_version_path project: "value0", location: "value1", processor: "value2", processor_version: "value3" + assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb new file mode 100644 index 000000000000..1dceb202a6d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb @@ -0,0 +1,1357 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/document_ai/v1beta3/document_processor_service/rest" + + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + end + + def test_process_document + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_document = {} + name = "hello world" + document = {} + skip_human_review = true + field_mask = {} + process_options = {} + + process_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_process_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, process_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.process_document inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.process_document ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.process_document(::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, process_document_client_stub.call_count + end + end + end + + def test_batch_process_documents + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + input_configs = [{}] + output_config = {} + input_documents = {} + document_output_config = {} + skip_human_review = true + process_options = {} + + batch_process_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_batch_process_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_process_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_process_documents name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_process_documents ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_process_documents(::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_process_documents_client_stub.call_count + end + end + end + + def test_fetch_processor_types + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + fetch_processor_types_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_fetch_processor_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_processor_types_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_processor_types({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_processor_types parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_processor_types ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_processor_types({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_processor_types(::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_processor_types_client_stub.call_count + end + end + end + + def test_list_processor_types + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processor_types_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_processor_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_processor_types_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_processor_types parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_processor_types ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_processor_types(::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_processor_types_client_stub.call_count + end + end + end + + def test_get_processor_type + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_type_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_processor_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_processor_type_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_processor_type({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_processor_type name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_processor_type ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_processor_type({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_processor_type(::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_processor_type_client_stub.call_count + end + end + end + + def test_list_processors + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processors_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_processors_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_processors_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_processors parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_processors ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_processors(::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_processors_client_stub.call_count + end + end + end + + def test_get_processor + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::Processor.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_processor({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_processor name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_processor ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_processor({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_processor(::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_processor_client_stub.call_count + end + end + end + + def test_train_processor_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_document_extraction_options = {} + parent = "hello world" + processor_version = {} + document_schema = {} + input_data = {} + base_processor_version = "hello world" + + train_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_train_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, train_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.train_processor_version custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.train_processor_version ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.train_processor_version(::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, train_processor_version_client_stub.call_count + end + end + end + + def test_get_processor_version + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_processor_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_processor_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_processor_version ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_processor_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_processor_version(::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_processor_version_client_stub.call_count + end + end + end + + def test_list_processor_versions + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processor_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_processor_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_processor_versions_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_processor_versions parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_processor_versions ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_processor_versions(::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_processor_versions_client_stub.call_count + end + end + end + + def test_delete_processor_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_delete_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_processor_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_processor_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_processor_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_processor_version_client_stub.call_count + end + end + end + + def test_deploy_processor_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + deploy_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_deploy_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, deploy_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.deploy_processor_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.deploy_processor_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.deploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.deploy_processor_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.deploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, deploy_processor_version_client_stub.call_count + end + end + end + + def test_undeploy_processor_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + undeploy_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_undeploy_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undeploy_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undeploy_processor_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undeploy_processor_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undeploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undeploy_processor_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undeploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undeploy_processor_version_client_stub.call_count + end + end + end + + def test_create_processor + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::Processor.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + processor = {} + + create_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_create_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_processor({ parent: parent, processor: processor }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_processor parent: parent, processor: processor do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_processor ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_processor({ parent: parent, processor: processor }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_processor(::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_processor_client_stub.call_count + end + end + end + + def test_delete_processor + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_delete_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_processor({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_processor name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_processor ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_processor({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_processor(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_processor_client_stub.call_count + end + end + end + + def test_enable_processor + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + enable_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_enable_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_processor({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_processor name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_processor ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_processor({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_processor(::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_processor_client_stub.call_count + end + end + end + + def test_disable_processor + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + disable_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_disable_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_processor({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_processor name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_processor ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_processor({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_processor(::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_processor_client_stub.call_count + end + end + end + + def test_set_default_processor_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + processor = "hello world" + default_processor_version = "hello world" + + set_default_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_set_default_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_default_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_default_processor_version processor: processor, default_processor_version: default_processor_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_default_processor_version ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_default_processor_version(::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_default_processor_version_client_stub.call_count + end + end + end + + def test_review_document + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_document = {} + human_review_config = "hello world" + document = {} + enable_schema_validation = true + priority = :DEFAULT + document_schema = {} + + review_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_review_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, review_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.review_document inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.review_document ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.review_document(::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, review_document_client_stub.call_count + end + end + end + + def test_evaluate_processor_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + processor_version = "hello world" + evaluation_documents = {} + + evaluate_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_evaluate_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, evaluate_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.evaluate_processor_version processor_version: processor_version, evaluation_documents: evaluation_documents do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.evaluate_processor_version ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.evaluate_processor_version(::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, evaluate_processor_version_client_stub.call_count + end + end + end + + def test_get_evaluation + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_evaluation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_evaluation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_evaluation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_evaluation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_evaluation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_evaluation ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_evaluation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_evaluation(::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_evaluation_client_stub.call_count + end + end + end + + def test_list_evaluations + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_evaluations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_evaluations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_evaluations_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_evaluations parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_evaluations ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_evaluations(::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_evaluations_client_stub.call_count + end + end + end + + def test_import_processor_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + processor_version_source = "hello world" + parent = "hello world" + + import_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_import_processor_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_processor_version processor_version_source: processor_version_source, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_processor_version ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_processor_version(::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_processor_version_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + Gapic::Rest::ClientStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb new file mode 100644 index 000000000000..9617be12841f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb @@ -0,0 +1,1564 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" +require "google/cloud/document_ai/v1beta3/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_process_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_document = {} + name = "hello world" + document = {} + skip_human_review = true + field_mask = {} + process_options = {} + + process_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :process_document, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] + assert_equal :inline_document, request.source + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] + assert_equal true, request["skip_human_review"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, process_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.process_document inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.process_document ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.process_document(::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, process_document_client_stub.call_rpc_count + end + end + + def test_batch_process_documents + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + input_configs = [{}] + output_config = {} + input_documents = {} + document_output_config = {} + skip_human_review = true + process_options = {} + + batch_process_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_process_documents, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, request["input_configs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig), request["output_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["input_documents"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig), request["document_output_config"] + assert_equal true, request["skip_human_review"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_process_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_process_documents name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_process_documents ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_process_documents(::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_process_documents_client_stub.call_rpc_count + end + end + + def test_fetch_processor_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + fetch_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_processor_types, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_processor_types_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_processor_types({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_processor_types parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_processor_types ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_processor_types({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_processor_types(::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_processor_types_client_stub.call_rpc_count + end + end + + def test_list_processor_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processor_types, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_processor_types_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_processor_types parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_processor_types ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_processor_types(::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_processor_types_client_stub.call_rpc_count + end + end + + def test_get_processor_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_processor_type, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_processor_type_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_processor_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_processor_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_processor_type ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_processor_type({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_processor_type(::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_processor_type_client_stub.call_rpc_count + end + end + + def test_list_processors + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processors, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_processors_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_processors parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_processors ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_processors(::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_processors_client_stub.call_rpc_count + end + end + + def test_get_processor + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_processor({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_processor name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_processor ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_processor({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_processor(::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_processor_client_stub.call_rpc_count + end + end + + def test_train_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + custom_document_extraction_options = {} + parent = "hello world" + processor_version = {} + document_schema = {} + input_data = {} + base_processor_version = "hello world" + + train_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :train_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions), request["custom_document_extraction_options"] + assert_equal :custom_document_extraction_options, request.processor_flags + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion), request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData), request["input_data"] + assert_equal "hello world", request["base_processor_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, train_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.train_processor_version custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.train_processor_version ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.train_processor_version(::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, train_processor_version_client_stub.call_rpc_count + end + end + + def test_get_processor_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_processor_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_processor_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_processor_version ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_processor_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_processor_version(::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_processor_version_client_stub.call_rpc_count + end + end + + def test_list_processor_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processor_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processor_versions, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_processor_versions_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_processor_versions parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_processor_versions ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_processor_versions(::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_processor_versions_client_stub.call_rpc_count + end + end + + def test_delete_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_processor_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_processor_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_processor_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_processor_version_client_stub.call_rpc_count + end + end + + def test_deploy_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + deploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :deploy_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, deploy_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.deploy_processor_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.deploy_processor_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.deploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.deploy_processor_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.deploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, deploy_processor_version_client_stub.call_rpc_count + end + end + + def test_undeploy_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + undeploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undeploy_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undeploy_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undeploy_processor_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undeploy_processor_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undeploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undeploy_processor_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undeploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, undeploy_processor_version_client_stub.call_rpc_count + end + end + + def test_create_processor + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + processor = {} + + create_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Processor), request["processor"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_processor({ parent: parent, processor: processor }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_processor parent: parent, processor: processor do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_processor ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_processor({ parent: parent, processor: processor }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_processor(::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_processor_client_stub.call_rpc_count + end + end + + def test_delete_processor + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_processor({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_processor name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_processor ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_processor({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_processor(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_processor_client_stub.call_rpc_count + end + end + + def test_enable_processor + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + enable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_processor({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_processor name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_processor ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_processor({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_processor(::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_processor_client_stub.call_rpc_count + end + end + + def test_disable_processor + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + disable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_processor({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_processor name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_processor ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_processor({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_processor(::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_processor_client_stub.call_rpc_count + end + end + + def test_set_default_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + processor = "hello world" + default_processor_version = "hello world" + + set_default_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_default_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, request + assert_equal "hello world", request["processor"] + assert_equal "hello world", request["default_processor_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_default_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_default_processor_version processor: processor, default_processor_version: default_processor_version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_default_processor_version ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_default_processor_version(::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_default_processor_version_client_stub.call_rpc_count + end + end + + def test_review_document + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_document = {} + human_review_config = "hello world" + document = {} + enable_schema_validation = true + priority = :DEFAULT + document_schema = {} + + review_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :review_document, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] + assert_equal :inline_document, request.source + assert_equal "hello world", request["human_review_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] + assert_equal true, request["enable_schema_validation"] + assert_equal :DEFAULT, request["priority"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, review_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.review_document inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.review_document ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.review_document(::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, review_document_client_stub.call_rpc_count + end + end + + def test_evaluate_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + processor_version = "hello world" + evaluation_documents = {} + + evaluate_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :evaluate_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, request + assert_equal "hello world", request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["evaluation_documents"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, evaluate_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.evaluate_processor_version processor_version: processor_version, evaluation_documents: evaluation_documents do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.evaluate_processor_version ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.evaluate_processor_version(::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, evaluate_processor_version_client_stub.call_rpc_count + end + end + + def test_get_evaluation + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_evaluation, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_evaluation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_evaluation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_evaluation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_evaluation ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_evaluation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_evaluation(::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_evaluation_client_stub.call_rpc_count + end + end + + def test_list_evaluations + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_evaluations, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_evaluations_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_evaluations parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_evaluations ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_evaluations(::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_evaluations_client_stub.call_rpc_count + end + end + + def test_import_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + processor_version_source = "hello world" + parent = "hello world" + + import_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, request + assert_equal "hello world", request["processor_version_source"] + assert_equal :processor_version_source, request.source + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_processor_version processor_version_source: processor_version_source, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_processor_version ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_processor_version(::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_processor_version_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb new file mode 100644 index 000000000000..13f8919a8b71 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/documentai/v1beta3/document_service_pb" +require "google/cloud/documentai/v1beta3/document_service_services_pb" +require "google/cloud/document_ai/v1beta3/document_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb new file mode 100644 index 000000000000..b3f13eaeef7b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/document_ai/v1beta3/document_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::ClientPathsTest < Minitest::Test + def test_dataset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dataset_path project: "value0", location: "value1", processor: "value2" + assert_equal "projects/value0/locations/value1/processors/value2/dataset", path + end + end + + def test_dataset_schema_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dataset_schema_path project: "value0", location: "value1", processor: "value2" + assert_equal "projects/value0/locations/value1/processors/value2/dataset/datasetSchema", path + end + end + + def test_schema_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.schema_path project: "value0", location: "value1", schema: "value2" + assert_equal "projects/value0/locations/value1/schemas/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb new file mode 100644 index 000000000000..b3360e7a5b20 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb @@ -0,0 +1,414 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/documentai/v1beta3/document_service_pb" +require "google/cloud/document_ai/v1beta3/document_service/rest" + + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + end + + def test_update_dataset + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + dataset = {} + update_mask = {} + + update_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_update_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_dataset_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_dataset({ dataset: dataset, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_dataset dataset: dataset, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_dataset ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_dataset({ dataset: dataset, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_dataset(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_dataset_client_stub.call_count + end + end + end + + def test_import_documents + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + dataset = "hello world" + batch_documents_import_configs = [{}] + + import_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_documents dataset: dataset, batch_documents_import_configs: batch_documents_import_configs do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_documents ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_documents(::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_documents_client_stub.call_count + end + end + end + + def test_get_document + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + dataset = "hello world" + document_id = {} + read_mask = {} + page_range = {} + + get_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_document dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_document ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_document(::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_document_client_stub.call_count + end + end + end + + def test_batch_delete_documents + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + dataset = "hello world" + dataset_documents = {} + + batch_delete_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_batch_delete_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_delete_documents dataset: dataset, dataset_documents: dataset_documents do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_delete_documents ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_delete_documents(::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_documents_client_stub.call_count + end + end + end + + def test_get_dataset_schema + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + visible_fields_only = true + + get_dataset_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_get_dataset_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dataset_schema_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dataset_schema name: name, visible_fields_only: visible_fields_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dataset_schema_client_stub.call_count + end + end + end + + def test_update_dataset_schema + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + dataset_schema = {} + update_mask = {} + + update_dataset_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_update_dataset_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_dataset_schema_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_dataset_schema dataset_schema: dataset_schema, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_dataset_schema_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + Gapic::Rest::ClientStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb new file mode 100644 index 000000000000..0029b1f48f2f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/documentai/v1beta3/document_service_pb" +require "google/cloud/documentai/v1beta3/document_service_services_pb" +require "google/cloud/document_ai/v1beta3/document_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_update_dataset + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + dataset = {} + update_mask = {} + + update_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_dataset, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Dataset), request["dataset"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_dataset_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_dataset({ dataset: dataset, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_dataset dataset: dataset, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_dataset ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_dataset({ dataset: dataset, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_dataset(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_dataset_client_stub.call_rpc_count + end + end + + def test_import_documents + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + dataset = "hello world" + batch_documents_import_configs = [{}] + + import_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_documents, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, request + assert_equal "hello world", request["dataset"] + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig, request["batch_documents_import_configs"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_documents dataset: dataset, batch_documents_import_configs: batch_documents_import_configs do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_documents ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_documents(::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_documents_client_stub.call_rpc_count + end + end + + def test_get_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + dataset = "hello world" + document_id = {} + read_mask = {} + page_range = {} + + get_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_document, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, request + assert_equal "hello world", request["dataset"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentId), request["document_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange), request["page_range"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_document dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_document ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_document(::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_document_client_stub.call_rpc_count + end + end + + def test_batch_delete_documents + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + dataset = "hello world" + dataset_documents = {} + + batch_delete_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_documents, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, request + assert_equal "hello world", request["dataset"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments), request["dataset_documents"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_delete_documents dataset: dataset, dataset_documents: dataset_documents do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_delete_documents ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_delete_documents(::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_delete_documents_client_stub.call_rpc_count + end + end + + def test_get_dataset_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + visible_fields_only = true + + get_dataset_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dataset_schema, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["visible_fields_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dataset_schema_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dataset_schema name: name, visible_fields_only: visible_fields_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_dataset_schema_client_stub.call_rpc_count + end + end + + def test_update_dataset_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + dataset_schema = {} + update_mask = {} + + update_dataset_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_dataset_schema, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema), request["dataset_schema"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_dataset_schema_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_dataset_schema dataset_schema: dataset_schema, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_dataset_schema_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb new file mode 100644 index 000000000000..8f4f6cf3de22 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" From 445012839bd8d70cb860bdbd462526141b77f66c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 12 Sep 2023 19:53:26 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../documentai/v1beta3/document_io_pb.rb | 3 +- .../v1beta3/document_processor_service_pb.rb | 3 +- .../cloud/documentai/v1beta3/document_io.rb | 28 +- .../v1beta3/document_processor_service.rb | 19 + .../.gitignore | 22 - .../.repo-metadata.json | 19 - .../.rubocop.yml | 33 - .../.yardopts | 12 - .../AUTHENTICATION.md | 151 - .../CHANGELOG.md | 2 - .../google-cloud-document_ai-v1beta3/Gemfile | 3 - .../LICENSE.md | 201 -- .../README.md | 144 - .../google-cloud-document_ai-v1beta3/Rakefile | 201 -- .../gapic_metadata.json | 172 -- .../google-cloud-document_ai-v1beta3.gemspec | 38 - .../lib/google-cloud-document_ai-v1beta3.rb | 21 - .../lib/google/cloud/document_ai/v1beta3.rb | 46 - .../document_ai/v1beta3/bindings_override.rb | 118 - .../v1beta3/document_processor_service.rb | 59 - .../document_processor_service/client.rb | 2742 ----------------- .../document_processor_service/credentials.rb | 51 - .../document_processor_service/operations.rb | 779 ----- .../document_processor_service/paths.rb | 151 - .../document_processor_service/rest.rb | 57 - .../document_processor_service/rest/client.rb | 2560 --------------- .../rest/operations.rb | 890 ------ .../rest/service_stub.rb | 1433 --------- .../document_ai/v1beta3/document_service.rb | 56 - .../v1beta3/document_service/client.rb | 941 ------ .../v1beta3/document_service/credentials.rb | 51 - .../v1beta3/document_service/operations.rb | 779 ----- .../v1beta3/document_service/paths.rb | 90 - .../v1beta3/document_service/rest.rb | 54 - .../v1beta3/document_service/rest/client.rb | 878 ------ .../document_service/rest/operations.rb | 890 ------ .../document_service/rest/service_stub.rb | 406 --- .../google/cloud/document_ai/v1beta3/rest.rb | 39 - .../cloud/document_ai/v1beta3/version.rb | 28 - .../cloud/documentai/v1beta3/barcode_pb.rb | 42 - .../cloud/documentai/v1beta3/dataset_pb.rb | 62 - .../documentai/v1beta3/document_io_pb.rb | 55 - .../cloud/documentai/v1beta3/document_pb.rb | 104 - .../v1beta3/document_processor_service_pb.rb | 135 - .../document_processor_service_services_pb.rb | 107 - .../documentai/v1beta3/document_schema_pb.rb | 49 - .../documentai/v1beta3/document_service_pb.rb | 78 - .../v1beta3/document_service_services_pb.rb | 55 - .../cloud/documentai/v1beta3/evaluation_pb.rb | 52 - .../cloud/documentai/v1beta3/geometry_pb.rb | 44 - .../v1beta3/operation_metadata_pb.rb | 46 - .../cloud/documentai/v1beta3/processor_pb.rb | 55 - .../documentai/v1beta3/processor_type_pb.rb | 46 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 381 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 -- .../cloud/documentai/v1beta3/barcode.rb | 73 - .../cloud/documentai/v1beta3/dataset.rb | 187 -- .../cloud/documentai/v1beta3/document.rb | 1071 ------- .../cloud/documentai/v1beta3/document_io.rb | 193 -- .../v1beta3/document_processor_service.rb | 1082 ------- .../documentai/v1beta3/document_schema.rb | 186 -- .../documentai/v1beta3/document_service.rb | 275 -- .../cloud/documentai/v1beta3/evaluation.rb | 199 -- .../cloud/documentai/v1beta3/geometry.rb | 65 - .../documentai/v1beta3/operation_metadata.rb | 68 - .../cloud/documentai/v1beta3/processor.rb | 180 -- .../documentai/v1beta3/processor_type.rb | 66 - .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 121 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/color.rb | 173 -- .../proto_docs/google/type/date.rb | 53 - .../proto_docs/google/type/datetime.rb | 99 - .../proto_docs/google/type/money.rb | 43 - .../proto_docs/google/type/postal_address.rb | 135 - .../snippets/Gemfile | 32 - .../batch_process_documents.rb | 49 - .../create_processor.rb | 42 - .../delete_processor.rb | 49 - .../delete_processor_version.rb | 49 - .../deploy_processor_version.rb | 49 - .../disable_processor.rb | 49 - .../enable_processor.rb | 49 - .../evaluate_processor_version.rb | 49 - .../fetch_processor_types.rb | 42 - .../get_evaluation.rb | 42 - .../get_processor.rb | 42 - .../get_processor_type.rb | 42 - .../get_processor_version.rb | 42 - .../import_processor_version.rb | 49 - .../list_evaluations.rb | 46 - .../list_processor_types.rb | 46 - .../list_processor_versions.rb | 46 - .../list_processors.rb | 46 - .../process_document.rb | 42 - .../review_document.rb | 49 - .../set_default_processor_version.rb | 49 - .../train_processor_version.rb | 49 - .../undeploy_processor_version.rb | 49 - .../batch_delete_documents.rb | 49 - .../document_service/get_dataset_schema.rb | 42 - .../snippets/document_service/get_document.rb | 42 - .../document_service/import_documents.rb | 49 - .../document_service/update_dataset.rb | 49 - .../document_service/update_dataset_schema.rb | 42 - ...adata_google.cloud.documentai.v1beta3.json | 1175 ------- ...ument_processor_service_operations_test.rb | 380 --- .../document_processor_service_paths_test.rb | 97 - .../document_processor_service_rest_test.rb | 1357 -------- .../document_processor_service_test.rb | 1564 ---------- .../document_service_operations_test.rb | 380 --- .../v1beta3/document_service_paths_test.rb | 61 - .../v1beta3/document_service_rest_test.rb | 414 --- .../v1beta3/document_service_test.rb | 459 --- .../test/helper.rb | 25 - 123 files changed, 50 insertions(+), 28209 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/README.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb index 64cfb88023ca..ca1ad4e5ff7a 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb @@ -7,7 +7,7 @@ require 'google/protobuf/field_mask_pb' -descriptor_data = "\n1google/cloud/documentai/v1beta3/document_io.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a google/protobuf/field_mask.proto\"1\n\x0bRawDocument\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\"1\n\x0bGcsDocument\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"O\n\x0cGcsDocuments\x12?\n\tdocuments\x18\x01 \x03(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocument\"#\n\tGcsPrefix\x12\x16\n\x0egcs_uri_prefix\x18\x01 \x01(\t\"\xaf\x01\n\x19\x42\x61tchDocumentsInputConfig\x12@\n\ngcs_prefix\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.GcsPrefixH\x00\x12\x46\n\rgcs_documents\x18\x02 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.GcsDocumentsH\x00\x42\x08\n\x06source\"\x8f\x03\n\x14\x44ocumentOutputConfig\x12\x62\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\x45.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfigH\x00\x1a\x83\x02\n\x0fGcsOutputConfig\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12m\n\x0fsharding_config\x18\x03 \x01(\x0b\x32T.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig\x1a@\n\x0eShardingConfig\x12\x17\n\x0fpages_per_shard\x18\x01 \x01(\x05\x12\x15\n\rpages_overlap\x18\x02 \x01(\x05\x42\r\n\x0b\x64\x65stination\"\x86\x02\n\tOcrConfig\x12?\n\x05hints\x18\x02 \x01(\x0b\x32\x30.google.cloud.documentai.v1beta3.OcrConfig.Hints\x12!\n\x19\x65nable_native_pdf_parsing\x18\x03 \x01(\x08\x12#\n\x1b\x65nable_image_quality_scores\x18\x04 \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x05 \x03(\t\x12\x15\n\renable_symbol\x18\x06 \x01(\x08\x12\x1a\n\x12\x63ompute_style_info\x18\x08 \x01(\x08\x1a\x1f\n\x05Hints\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\tB\xe6\x01\n#com.google.cloud.documentai.v1beta3B\x0f\x44ocumentIoProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" +descriptor_data = "\n1google/cloud/documentai/v1beta3/document_io.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a google/protobuf/field_mask.proto\"1\n\x0bRawDocument\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\"1\n\x0bGcsDocument\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"O\n\x0cGcsDocuments\x12?\n\tdocuments\x18\x01 \x03(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocument\"#\n\tGcsPrefix\x12\x16\n\x0egcs_uri_prefix\x18\x01 \x01(\t\"\xaf\x01\n\x19\x42\x61tchDocumentsInputConfig\x12@\n\ngcs_prefix\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.GcsPrefixH\x00\x12\x46\n\rgcs_documents\x18\x02 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.GcsDocumentsH\x00\x42\x08\n\x06source\"\x8f\x03\n\x14\x44ocumentOutputConfig\x12\x62\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\x45.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfigH\x00\x1a\x83\x02\n\x0fGcsOutputConfig\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12m\n\x0fsharding_config\x18\x03 \x01(\x0b\x32T.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig\x1a@\n\x0eShardingConfig\x12\x17\n\x0fpages_per_shard\x18\x01 \x01(\x05\x12\x15\n\rpages_overlap\x18\x02 \x01(\x05\x42\r\n\x0b\x64\x65stination\"\xfc\x03\n\tOcrConfig\x12?\n\x05hints\x18\x02 \x01(\x0b\x32\x30.google.cloud.documentai.v1beta3.OcrConfig.Hints\x12!\n\x19\x65nable_native_pdf_parsing\x18\x03 \x01(\x08\x12#\n\x1b\x65nable_image_quality_scores\x18\x04 \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x05 \x03(\t\x12\x15\n\renable_symbol\x18\x06 \x01(\x08\x12\x1e\n\x12\x63ompute_style_info\x18\x08 \x01(\x08\x42\x02\x18\x01\x12)\n!disable_character_boxes_detection\x18\n \x01(\x08\x12T\n\x10premium_features\x18\x0b \x01(\x0b\x32:.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures\x1a\x1f\n\x05Hints\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\t\x1ao\n\x0fPremiumFeatures\x12\'\n\x1f\x65nable_selection_mark_detection\x18\x03 \x01(\x08\x12\x1a\n\x12\x63ompute_style_info\x18\x04 \x01(\x08\x12\x17\n\x0f\x65nable_math_ocr\x18\x05 \x01(\x08\x42\xe6\x01\n#com.google.cloud.documentai.v1beta3B\x0f\x44ocumentIoProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -48,6 +48,7 @@ module V1beta3 DocumentOutputConfig::GcsOutputConfig::ShardingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig").msgclass OcrConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig").msgclass OcrConfig::Hints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig.Hints").msgclass + OcrConfig::PremiumFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures").msgclass end end end diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb index 6ae6e1affbca..aa0602fed2ee 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb @@ -22,7 +22,7 @@ require 'google/rpc/status_pb' -descriptor_data = "\n@google/cloud/documentai/v1beta3/document_processor_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\x1a\x30google/cloud/documentai/v1beta3/evaluation.proto\x1a\x38google/cloud/documentai/v1beta3/operation_metadata.proto\x1a/google/cloud/documentai/v1beta3/processor.proto\x1a\x34google/cloud/documentai/v1beta3/processor_type.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"P\n\x0eProcessOptions\x12>\n\nocr_config\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.OcrConfig\"\xdb\x03\n\x0eProcessRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12\x44\n\x0craw_document\x18\x05 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.RawDocumentH\x00\x12\x44\n\x0cgcs_document\x18\x08 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocumentH\x00\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08\x12.\n\nfield_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptionsB\x08\n\x06source\"\xf3\x01\n\x11HumanReviewStatus\x12G\n\x05state\x18\x01 \x01(\x0e\x32\x38.google.cloud.documentai.v1beta3.HumanReviewStatus.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12\x1e\n\x16human_review_operation\x18\x03 \x01(\t\"^\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SKIPPED\x10\x01\x12\x15\n\x11VALIDATION_PASSED\x10\x02\x12\x0f\n\x0bIN_PROGRESS\x10\x03\x12\t\n\x05\x45RROR\x10\x04\"\xc3\x01\n\x0fProcessResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\"\n\x16human_review_operation\x18\x02 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x03 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"\xf5\x04\n\x13\x42\x61tchProcessRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12`\n\rinput_configs\x18\x02 \x03(\x0b\x32\x45.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfigB\x02\x18\x01\x12\x61\n\routput_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfigB\x02\x18\x01\x12S\n\x0finput_documents\x18\x05 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12U\n\x16\x64ocument_output_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.DocumentOutputConfig\x12\x19\n\x11skip_human_review\x18\x04 \x01(\x08\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptions\x1a=\n\x10\x42\x61tchInputConfig\x12\x12\n\ngcs_source\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t:\x02\x18\x01\x1a\x30\n\x11\x42\x61tchOutputConfig\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t:\x02\x18\x01\"\x16\n\x14\x42\x61tchProcessResponse\"\xb2\x05\n\x14\x42\x61tchProcessMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.documentai.v1beta3.BatchProcessMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32M.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus\x1a\xec\x01\n\x17IndividualProcessStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16output_gcs_destination\x18\x03 \x01(\t\x12\"\n\x16human_review_operation\x18\x04 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x05 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07WAITING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\"]\n\x1a\x46\x65tchProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\"f\n\x1b\x46\x65tchProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\"\x83\x01\n\x19ListProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"~\n\x1aListProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x15ListProcessorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x16ListProcessorsResponse\x12>\n\nprocessors\x18\x01 \x03(\x0b\x32*.google.cloud.documentai.v1beta3.Processor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x17GetProcessorTypeRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'documentai.googleapis.com/ProcessorType\"P\n\x13GetProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"^\n\x1aGetProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x89\x01\n\x1cListProcessorVersionsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x87\x01\n\x1dListProcessorVersionsResponse\x12M\n\x12processor_versions\x18\x01 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1d\x44\x65leteProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1e\x44\x65leteProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"a\n\x1d\x44\x65ployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\" \n\x1e\x44\x65ployProcessorVersionResponse\"s\n\x1e\x44\x65ployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"c\n\x1fUndeployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\"\n UndeployProcessorVersionResponse\"u\n UndeployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\x99\x01\n\x16\x43reateProcessorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x42\n\tprocessor\x18\x02 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.ProcessorB\x03\xe0\x41\x02\"S\n\x16\x44\x65leteProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"l\n\x17\x44\x65leteProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"S\n\x16\x45nableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x19\n\x17\x45nableProcessorResponse\"l\n\x17\x45nableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"T\n\x17\x44isableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x1a\n\x18\x44isableProcessorResponse\"m\n\x18\x44isableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xba\x01\n!SetDefaultProcessorVersionRequest\x12>\n\tprocessor\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12U\n\x19\x64\x65\x66\x61ult_processor_version\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"$\n\"SetDefaultProcessorVersionResponse\"w\n\"SetDefaultProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xe3\x07\n\x1cTrainProcessorVersionRequest\x12\x8b\x01\n\"custom_document_extraction_options\x18\x05 \x01(\x0b\x32].google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptionsH\x00\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12Q\n\x11processor_version\x18\x02 \x01(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersionB\x03\xe0\x41\x02\x12M\n\x0f\x64ocument_schema\x18\n \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchemaB\x03\xe0\x41\x01\x12`\n\ninput_data\x18\x04 \x01(\x0b\x32G.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputDataB\x03\xe0\x41\x01\x12#\n\x16\x62\x61se_processor_version\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1a\xb7\x01\n\tInputData\x12V\n\x12training_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12R\n\x0etest_documents\x18\x04 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x1a\x81\x02\n\x1f\x43ustomDocumentExtractionOptions\x12\x85\x01\n\x0ftraining_method\x18\x03 \x01(\x0e\x32l.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod\"V\n\x0eTrainingMethod\x12\x1f\n\x1bTRAINING_METHOD_UNSPECIFIED\x10\x00\x12\x0f\n\x0bMODEL_BASED\x10\x01\x12\x12\n\x0eTEMPLATE_BASED\x10\x02\x42\x11\n\x0fprocessor_flags\":\n\x1dTrainProcessorVersionResponse\x12\x19\n\x11processor_version\x18\x01 \x01(\t\"\x86\x04\n\x1dTrainProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12u\n\x1btraining_dataset_validation\x18\x02 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x12q\n\x17test_dataset_validation\x18\x03 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x1a\xa7\x01\n\x11\x44\x61tasetValidation\x12\x1c\n\x14\x64ocument_error_count\x18\x03 \x01(\x05\x12\x1b\n\x13\x64\x61taset_error_count\x18\x04 \x01(\x05\x12+\n\x0f\x64ocument_errors\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12*\n\x0e\x64\x61taset_errors\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\xde\x03\n\x15ReviewDocumentRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12 \n\x18\x65nable_schema_validation\x18\x03 \x01(\x08\x12Q\n\x08priority\x18\x05 \x01(\x0e\x32?.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority\x12H\n\x0f\x64ocument_schema\x18\x06 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchema\"#\n\x08Priority\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\n\n\x06URGENT\x10\x01\x42\x08\n\x06source\"\xd6\x01\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t\x12L\n\x05state\x18\x02 \x01(\x0e\x32=.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State\x12\x18\n\x10rejection_reason\x18\x03 \x01(\t\";\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REJECTED\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\"\xc0\x03\n\x1fReviewDocumentOperationMetadata\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12\x13\n\x0bquestion_id\x18\x06 \x01(\t\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xcf\x01\n\x1f\x45valuateProcessorVersionRequest\x12M\n\x11processor_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12]\n\x14\x65valuation_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfigB\x03\xe0\x41\x01\"u\n EvaluateProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"6\n EvaluateProcessorVersionResponse\x12\x12\n\nevaluation\x18\x02 \x01(\t\"R\n\x14GetEvaluationRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$documentai.googleapis.com/Evaluation\"\x83\x01\n\x16ListEvaluationsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListEvaluationsResponse\x12@\n\x0b\x65valuations\x18\x01 \x03(\x0b\x32+.google.cloud.documentai.v1beta3.Evaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x03\n\x1dImportProcessorVersionRequest\x12S\n\x18processor_version_source\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersionH\x00\x12\x8a\x01\n!external_processor_version_source\x18\x03 \x01(\x0b\x32].google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSourceH\x00\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x1a_\n\x1e\x45xternalProcessorVersionSource\x12\x1e\n\x11processor_version\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1d\n\x10service_endpoint\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06source\"l\n\x1eImportProcessorVersionResponse\x12J\n\x11processor_version\x18\x01 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1eImportProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata2\xeb.\n\x18\x44ocumentProcessorService\x12\x9b\x02\n\x0fProcessDocument\x12/.google.cloud.documentai.v1beta3.ProcessRequest\x1a\x30.google.cloud.documentai.v1beta3.ProcessResponse\"\xa4\x01\x82\xd3\xe4\x93\x02\x96\x01\";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\x01*ZT\"O/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process:\x01*\xda\x41\x04name\x12\xcc\x02\n\x15\x42\x61tchProcessDocuments\x12\x34.google.cloud.documentai.v1beta3.BatchProcessRequest\x1a\x1d.google.longrunning.Operation\"\xdd\x01\x82\xd3\xe4\x93\x02\xa0\x01\"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*ZY\"T/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess:\x01*\xda\x41\x04name\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\x12\xdf\x01\n\x13\x46\x65tchProcessorTypes\x12;.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest\x1a<.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse\"M\x82\xd3\xe4\x93\x02>\x12\n\x1dTrainProcessorVersionResponse\x12\x1dTrainProcessorVersionMetadata\x12\xdd\x01\n\x13GetProcessorVersion\x12;.google.cloud.documentai.v1beta3.GetProcessorVersionRequest\x1a\x31.google.cloud.documentai.v1beta3.ProcessorVersion\"V\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\x12\xf0\x01\n\x15ListProcessorVersions\x12=.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest\x1a>.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse\"X\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions\xda\x41\x06parent\x12\x8a\x02\n\x16\x44\x65leteProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\x82\xd3\xe4\x93\x02I*G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteProcessorVersionMetadata\x12\x9d\x02\n\x16\x44\x65ployProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\x82\xd3\xe4\x93\x02S\"N/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy:\x01*\xda\x41\x04name\xca\x41@\n\x1e\x44\x65ployProcessorVersionResponse\x12\x1e\x44\x65ployProcessorVersionMetadata\x12\xa7\x02\n\x18UndeployProcessorVersion\x12@.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02U\"P/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy:\x01*\xda\x41\x04name\xca\x41\x44\n UndeployProcessorVersionResponse\x12 UndeployProcessorVersionMetadata\x12\xd1\x01\n\x0f\x43reateProcessor\x12\x37.google.cloud.documentai.v1beta3.CreateProcessorRequest\x1a*.google.cloud.documentai.v1beta3.Processor\"Y\x82\xd3\xe4\x93\x02@\"3/v1beta3/{parent=projects/*/locations/*}/processors:\tprocessor\xda\x41\x10parent,processor\x12\xe0\x01\n\x0f\x44\x65leteProcessor\x12\x37.google.cloud.documentai.v1beta3.DeleteProcessorRequest\x1a\x1d.google.longrunning.Operation\"u\x82\xd3\xe4\x93\x02\x35*3/v1beta3/{name=projects/*/locations/*/processors/*}\xda\x41\x04name\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteProcessorMetadata\x12\xe5\x01\n\x0f\x45nableProcessor\x12\x37.google.cloud.documentai.v1beta3.EnableProcessorRequest\x1a\x1d.google.longrunning.Operation\"z\x82\xd3\xe4\x93\x02?\":/v1beta3/{name=projects/*/locations/*/processors/*}:enable:\x01*\xca\x41\x32\n\x17\x45nableProcessorResponse\x12\x17\x45nableProcessorMetadata\x12\xea\x01\n\x10\x44isableProcessor\x12\x38.google.cloud.documentai.v1beta3.DisableProcessorRequest\x1a\x1d.google.longrunning.Operation\"}\x82\xd3\xe4\x93\x02@\";/v1beta3/{name=projects/*/locations/*/processors/*}:disable:\x01*\xca\x41\x34\n\x18\x44isableProcessorResponse\x12\x18\x44isableProcessorMetadata\x12\xab\x02\n\x1aSetDefaultProcessorVersion\x12\x42.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02X\"S/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion:\x01*\xca\x41H\n\"SetDefaultProcessorVersionResponse\x12\"SetDefaultProcessorVersionMetadata\x12\xaa\x02\n\x0eReviewDocument\x12\x36.google.cloud.documentai.v1beta3.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xc0\x01\x82\xd3\xe4\x93\x02h\"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\xda\x41\x13human_review_config\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\x12\xd1\x02\n\x18\x45valuateProcessorVersion\x12@.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\x82\xd3\xe4\x93\x02r\"m/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion:\x01*\xda\x41\x11processor_version\xca\x41\x44\n EvaluateProcessorVersionResponse\x12 EvaluateProcessorVersionMetadata\x12\xd9\x01\n\rGetEvaluation\x12\x35.google.cloud.documentai.v1beta3.GetEvaluationRequest\x1a+.google.cloud.documentai.v1beta3.Evaluation\"d\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}\xda\x41\x04name\x12\xec\x01\n\x0fListEvaluations\x12\x37.google.cloud.documentai.v1beta3.ListEvaluationsRequest\x1a\x38.google.cloud.documentai.v1beta3.ListEvaluationsResponse\"f\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations\xda\x41\x06parent\x12\xaf\x02\n\x16ImportProcessorVersion\x12>.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\x82\xd3\xe4\x93\x02\x63\"^/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion:\x01*\xda\x41\x06parent\xca\x41@\n\x1eImportProcessorVersionResponse\x12\x1eImportProcessorVersionMetadata\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc3\x03\n#com.google.cloud.documentai.v1beta3B\x1a\x44ocumentAiProcessorServiceP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3\xea\x41\x7f\n+documentai.googleapis.com/HumanReviewConfig\x12Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfig\xea\x41M\n\"documentai.googleapis.com/Location\x12\'projects/{project}/locations/{location}b\x06proto3" +descriptor_data = "\n@google/cloud/documentai/v1beta3/document_processor_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\x1a\x30google/cloud/documentai/v1beta3/evaluation.proto\x1a\x38google/cloud/documentai/v1beta3/operation_metadata.proto\x1a/google/cloud/documentai/v1beta3/processor.proto\x1a\x34google/cloud/documentai/v1beta3/processor_type.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa2\x02\n\x0eProcessOptions\x12j\n\x18individual_page_selector\x18\x05 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelectorH\x00\x12\x14\n\nfrom_start\x18\x06 \x01(\x05H\x00\x12\x12\n\x08\x66rom_end\x18\x07 \x01(\x05H\x00\x12>\n\nocr_config\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.OcrConfig\x1a,\n\x16IndividualPageSelector\x12\x12\n\x05pages\x18\x01 \x03(\x05\x42\x03\xe0\x41\x01\x42\x0c\n\npage_range\"\xdb\x03\n\x0eProcessRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12\x44\n\x0craw_document\x18\x05 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.RawDocumentH\x00\x12\x44\n\x0cgcs_document\x18\x08 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocumentH\x00\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08\x12.\n\nfield_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptionsB\x08\n\x06source\"\xf3\x01\n\x11HumanReviewStatus\x12G\n\x05state\x18\x01 \x01(\x0e\x32\x38.google.cloud.documentai.v1beta3.HumanReviewStatus.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12\x1e\n\x16human_review_operation\x18\x03 \x01(\t\"^\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SKIPPED\x10\x01\x12\x15\n\x11VALIDATION_PASSED\x10\x02\x12\x0f\n\x0bIN_PROGRESS\x10\x03\x12\t\n\x05\x45RROR\x10\x04\"\xc3\x01\n\x0fProcessResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\"\n\x16human_review_operation\x18\x02 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x03 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"\xf5\x04\n\x13\x42\x61tchProcessRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12`\n\rinput_configs\x18\x02 \x03(\x0b\x32\x45.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfigB\x02\x18\x01\x12\x61\n\routput_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfigB\x02\x18\x01\x12S\n\x0finput_documents\x18\x05 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12U\n\x16\x64ocument_output_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.DocumentOutputConfig\x12\x19\n\x11skip_human_review\x18\x04 \x01(\x08\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptions\x1a=\n\x10\x42\x61tchInputConfig\x12\x12\n\ngcs_source\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t:\x02\x18\x01\x1a\x30\n\x11\x42\x61tchOutputConfig\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t:\x02\x18\x01\"\x16\n\x14\x42\x61tchProcessResponse\"\xb2\x05\n\x14\x42\x61tchProcessMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.documentai.v1beta3.BatchProcessMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32M.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus\x1a\xec\x01\n\x17IndividualProcessStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16output_gcs_destination\x18\x03 \x01(\t\x12\"\n\x16human_review_operation\x18\x04 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x05 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07WAITING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\"]\n\x1a\x46\x65tchProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\"f\n\x1b\x46\x65tchProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\"\x83\x01\n\x19ListProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"~\n\x1aListProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x15ListProcessorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x16ListProcessorsResponse\x12>\n\nprocessors\x18\x01 \x03(\x0b\x32*.google.cloud.documentai.v1beta3.Processor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x17GetProcessorTypeRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'documentai.googleapis.com/ProcessorType\"P\n\x13GetProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"^\n\x1aGetProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x89\x01\n\x1cListProcessorVersionsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x87\x01\n\x1dListProcessorVersionsResponse\x12M\n\x12processor_versions\x18\x01 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1d\x44\x65leteProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1e\x44\x65leteProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"a\n\x1d\x44\x65ployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\" \n\x1e\x44\x65ployProcessorVersionResponse\"s\n\x1e\x44\x65ployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"c\n\x1fUndeployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\"\n UndeployProcessorVersionResponse\"u\n UndeployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\x99\x01\n\x16\x43reateProcessorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x42\n\tprocessor\x18\x02 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.ProcessorB\x03\xe0\x41\x02\"S\n\x16\x44\x65leteProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"l\n\x17\x44\x65leteProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"S\n\x16\x45nableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x19\n\x17\x45nableProcessorResponse\"l\n\x17\x45nableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"T\n\x17\x44isableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x1a\n\x18\x44isableProcessorResponse\"m\n\x18\x44isableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xba\x01\n!SetDefaultProcessorVersionRequest\x12>\n\tprocessor\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12U\n\x19\x64\x65\x66\x61ult_processor_version\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"$\n\"SetDefaultProcessorVersionResponse\"w\n\"SetDefaultProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xe3\x07\n\x1cTrainProcessorVersionRequest\x12\x8b\x01\n\"custom_document_extraction_options\x18\x05 \x01(\x0b\x32].google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptionsH\x00\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12Q\n\x11processor_version\x18\x02 \x01(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersionB\x03\xe0\x41\x02\x12M\n\x0f\x64ocument_schema\x18\n \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchemaB\x03\xe0\x41\x01\x12`\n\ninput_data\x18\x04 \x01(\x0b\x32G.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputDataB\x03\xe0\x41\x01\x12#\n\x16\x62\x61se_processor_version\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1a\xb7\x01\n\tInputData\x12V\n\x12training_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12R\n\x0etest_documents\x18\x04 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x1a\x81\x02\n\x1f\x43ustomDocumentExtractionOptions\x12\x85\x01\n\x0ftraining_method\x18\x03 \x01(\x0e\x32l.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod\"V\n\x0eTrainingMethod\x12\x1f\n\x1bTRAINING_METHOD_UNSPECIFIED\x10\x00\x12\x0f\n\x0bMODEL_BASED\x10\x01\x12\x12\n\x0eTEMPLATE_BASED\x10\x02\x42\x11\n\x0fprocessor_flags\":\n\x1dTrainProcessorVersionResponse\x12\x19\n\x11processor_version\x18\x01 \x01(\t\"\x86\x04\n\x1dTrainProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12u\n\x1btraining_dataset_validation\x18\x02 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x12q\n\x17test_dataset_validation\x18\x03 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x1a\xa7\x01\n\x11\x44\x61tasetValidation\x12\x1c\n\x14\x64ocument_error_count\x18\x03 \x01(\x05\x12\x1b\n\x13\x64\x61taset_error_count\x18\x04 \x01(\x05\x12+\n\x0f\x64ocument_errors\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12*\n\x0e\x64\x61taset_errors\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\xde\x03\n\x15ReviewDocumentRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12 \n\x18\x65nable_schema_validation\x18\x03 \x01(\x08\x12Q\n\x08priority\x18\x05 \x01(\x0e\x32?.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority\x12H\n\x0f\x64ocument_schema\x18\x06 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchema\"#\n\x08Priority\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\n\n\x06URGENT\x10\x01\x42\x08\n\x06source\"\xd6\x01\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t\x12L\n\x05state\x18\x02 \x01(\x0e\x32=.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State\x12\x18\n\x10rejection_reason\x18\x03 \x01(\t\";\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REJECTED\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\"\xc0\x03\n\x1fReviewDocumentOperationMetadata\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12\x13\n\x0bquestion_id\x18\x06 \x01(\t\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xcf\x01\n\x1f\x45valuateProcessorVersionRequest\x12M\n\x11processor_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12]\n\x14\x65valuation_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfigB\x03\xe0\x41\x01\"u\n EvaluateProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"6\n EvaluateProcessorVersionResponse\x12\x12\n\nevaluation\x18\x02 \x01(\t\"R\n\x14GetEvaluationRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$documentai.googleapis.com/Evaluation\"\x83\x01\n\x16ListEvaluationsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListEvaluationsResponse\x12@\n\x0b\x65valuations\x18\x01 \x03(\x0b\x32+.google.cloud.documentai.v1beta3.Evaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x03\n\x1dImportProcessorVersionRequest\x12S\n\x18processor_version_source\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersionH\x00\x12\x8a\x01\n!external_processor_version_source\x18\x03 \x01(\x0b\x32].google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSourceH\x00\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x1a_\n\x1e\x45xternalProcessorVersionSource\x12\x1e\n\x11processor_version\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1d\n\x10service_endpoint\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06source\"l\n\x1eImportProcessorVersionResponse\x12J\n\x11processor_version\x18\x01 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1eImportProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata2\xeb.\n\x18\x44ocumentProcessorService\x12\x9b\x02\n\x0fProcessDocument\x12/.google.cloud.documentai.v1beta3.ProcessRequest\x1a\x30.google.cloud.documentai.v1beta3.ProcessResponse\"\xa4\x01\x82\xd3\xe4\x93\x02\x96\x01\";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\x01*ZT\"O/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process:\x01*\xda\x41\x04name\x12\xcc\x02\n\x15\x42\x61tchProcessDocuments\x12\x34.google.cloud.documentai.v1beta3.BatchProcessRequest\x1a\x1d.google.longrunning.Operation\"\xdd\x01\x82\xd3\xe4\x93\x02\xa0\x01\"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*ZY\"T/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess:\x01*\xda\x41\x04name\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\x12\xdf\x01\n\x13\x46\x65tchProcessorTypes\x12;.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest\x1a<.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse\"M\x82\xd3\xe4\x93\x02>\x12\n\x1dTrainProcessorVersionResponse\x12\x1dTrainProcessorVersionMetadata\x12\xdd\x01\n\x13GetProcessorVersion\x12;.google.cloud.documentai.v1beta3.GetProcessorVersionRequest\x1a\x31.google.cloud.documentai.v1beta3.ProcessorVersion\"V\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\x12\xf0\x01\n\x15ListProcessorVersions\x12=.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest\x1a>.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse\"X\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions\xda\x41\x06parent\x12\x8a\x02\n\x16\x44\x65leteProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\x82\xd3\xe4\x93\x02I*G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteProcessorVersionMetadata\x12\x9d\x02\n\x16\x44\x65ployProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\x82\xd3\xe4\x93\x02S\"N/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy:\x01*\xda\x41\x04name\xca\x41@\n\x1e\x44\x65ployProcessorVersionResponse\x12\x1e\x44\x65ployProcessorVersionMetadata\x12\xa7\x02\n\x18UndeployProcessorVersion\x12@.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02U\"P/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy:\x01*\xda\x41\x04name\xca\x41\x44\n UndeployProcessorVersionResponse\x12 UndeployProcessorVersionMetadata\x12\xd1\x01\n\x0f\x43reateProcessor\x12\x37.google.cloud.documentai.v1beta3.CreateProcessorRequest\x1a*.google.cloud.documentai.v1beta3.Processor\"Y\x82\xd3\xe4\x93\x02@\"3/v1beta3/{parent=projects/*/locations/*}/processors:\tprocessor\xda\x41\x10parent,processor\x12\xe0\x01\n\x0f\x44\x65leteProcessor\x12\x37.google.cloud.documentai.v1beta3.DeleteProcessorRequest\x1a\x1d.google.longrunning.Operation\"u\x82\xd3\xe4\x93\x02\x35*3/v1beta3/{name=projects/*/locations/*/processors/*}\xda\x41\x04name\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteProcessorMetadata\x12\xe5\x01\n\x0f\x45nableProcessor\x12\x37.google.cloud.documentai.v1beta3.EnableProcessorRequest\x1a\x1d.google.longrunning.Operation\"z\x82\xd3\xe4\x93\x02?\":/v1beta3/{name=projects/*/locations/*/processors/*}:enable:\x01*\xca\x41\x32\n\x17\x45nableProcessorResponse\x12\x17\x45nableProcessorMetadata\x12\xea\x01\n\x10\x44isableProcessor\x12\x38.google.cloud.documentai.v1beta3.DisableProcessorRequest\x1a\x1d.google.longrunning.Operation\"}\x82\xd3\xe4\x93\x02@\";/v1beta3/{name=projects/*/locations/*/processors/*}:disable:\x01*\xca\x41\x34\n\x18\x44isableProcessorResponse\x12\x18\x44isableProcessorMetadata\x12\xab\x02\n\x1aSetDefaultProcessorVersion\x12\x42.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02X\"S/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion:\x01*\xca\x41H\n\"SetDefaultProcessorVersionResponse\x12\"SetDefaultProcessorVersionMetadata\x12\xaa\x02\n\x0eReviewDocument\x12\x36.google.cloud.documentai.v1beta3.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xc0\x01\x82\xd3\xe4\x93\x02h\"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\xda\x41\x13human_review_config\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\x12\xd1\x02\n\x18\x45valuateProcessorVersion\x12@.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\x82\xd3\xe4\x93\x02r\"m/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion:\x01*\xda\x41\x11processor_version\xca\x41\x44\n EvaluateProcessorVersionResponse\x12 EvaluateProcessorVersionMetadata\x12\xd9\x01\n\rGetEvaluation\x12\x35.google.cloud.documentai.v1beta3.GetEvaluationRequest\x1a+.google.cloud.documentai.v1beta3.Evaluation\"d\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}\xda\x41\x04name\x12\xec\x01\n\x0fListEvaluations\x12\x37.google.cloud.documentai.v1beta3.ListEvaluationsRequest\x1a\x38.google.cloud.documentai.v1beta3.ListEvaluationsResponse\"f\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations\xda\x41\x06parent\x12\xaf\x02\n\x16ImportProcessorVersion\x12>.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\x82\xd3\xe4\x93\x02\x63\"^/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion:\x01*\xda\x41\x06parent\xca\x41@\n\x1eImportProcessorVersionResponse\x12\x1eImportProcessorVersionMetadata\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc3\x03\n#com.google.cloud.documentai.v1beta3B\x1a\x44ocumentAiProcessorServiceP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3\xea\x41\x7f\n+documentai.googleapis.com/HumanReviewConfig\x12Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfig\xea\x41M\n\"documentai.googleapis.com/Location\x12\'projects/{project}/locations/{location}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -63,6 +63,7 @@ module Cloud module DocumentAI module V1beta3 ProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions").msgclass + ProcessOptions::IndividualPageSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector").msgclass ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessRequest").msgclass HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus").msgclass HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus.State").enummodule diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb index fa43ed392a4a..b9f94095d12d 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb @@ -142,7 +142,17 @@ class ShardingConfig # Includes symbol level OCR information if set to true. # @!attribute [rw] compute_style_info # @return [::Boolean] - # Turn on font id model and returns font style information. + # Turn on font identification model and return font style information. + # Deprecated, use + # {::Google::Cloud::DocumentAI::V1beta3::OcrConfig::PremiumFeatures#compute_style_info PremiumFeatures.compute_style_info} + # instead. + # @!attribute [rw] disable_character_boxes_detection + # @return [::Boolean] + # Turn off character box detector in OCR engine. Character box detection is + # enabled by default in OCR 2.0+ processors. + # @!attribute [rw] premium_features + # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig::PremiumFeatures] + # Configurations for premium OCR features. class OcrConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -160,6 +170,22 @@ class Hints include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Configurations for premium OCR features. + # @!attribute [rw] enable_selection_mark_detection + # @return [::Boolean] + # Turn on selection mark detector in OCR engine. Only available in OCR 2.0+ + # processors. + # @!attribute [rw] compute_style_info + # @return [::Boolean] + # Turn on font identification model and return font style information. + # @!attribute [rw] enable_math_ocr + # @return [::Boolean] + # Turn on the model that can extract LaTeX math formulas. + class PremiumFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end end end diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb index 79707b3ad476..9be1c66feb13 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb @@ -22,6 +22,16 @@ module Cloud module DocumentAI module V1beta3 # Options for Process API + # @!attribute [rw] individual_page_selector + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions::IndividualPageSelector] + # Which pages to process (1-indexed). + # @!attribute [rw] from_start + # @return [::Integer] + # Only process certain pages from the start, process all if the document + # has less pages. + # @!attribute [rw] from_end + # @return [::Integer] + # Only process certain pages from the end, same as above. # @!attribute [rw] ocr_config # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig] # Only applicable to `OCR_PROCESSOR`. Returns error if set on other @@ -29,6 +39,15 @@ module V1beta3 class ProcessOptions include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods + + # A list of individual page numbers. + # @!attribute [rw] pages + # @return [::Array<::Integer>] + # Optional. Indices of the pages (starting from 1). + class IndividualPageSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # Request message for the diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore b/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json deleted file mode 100644 index e4eca1154624..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "api_id": "us-documentai.googleapis.com", - "api_shortname": "documentai", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest", - "distribution_name": "google-cloud-document_ai-v1beta3", - "is_cloud": true, - "language": "ruby", - "name": "documentai", - "name_pretty": "Document AI V1beta3 API", - "product_documentation": "https://cloud.google.com/document-ai/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details.", - "ruby-cloud-env-prefix": "DOCUMENT_AI", - "ruby-cloud-product-url": "https://cloud.google.com/document-ai/", - "ruby-cloud-namespace-override": "DocumentAi=DocumentAI", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml b/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml deleted file mode 100644 index 945616d355d4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-document_ai-v1beta3.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-document_ai-v1beta3.rb" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts b/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts deleted file mode 100644 index fd21d6f25a32..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Document AI V1beta3 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md deleted file mode 100644 index ebe733081f48..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md +++ /dev/null @@ -1,151 +0,0 @@ -# Authentication - -In general, the google-cloud-document_ai-v1beta3 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. - -## Quickstart - -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). - -```sh -export DOCUMENT_AI_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. - -```ruby -require "google/cloud/document_ai/v1beta3" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -``` - -## Credential Lookup - -The google-cloud-document_ai-v1beta3 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. -Code should be written as if already authenticated. - -### Environment Variables - -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. - -The environment variables that google-cloud-document_ai-v1beta3 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials}): - -* `DOCUMENT_AI_CREDENTIALS` - Path to JSON file, or JSON contents -* `DOCUMENT_AI_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/document_ai/v1beta3" - -ENV["DOCUMENT_AI_CREDENTIALS"] = "path/to/keyfile.json" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -``` - -### Configuration - -The path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: - -```ruby -require "google/cloud/document_ai/v1beta3" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = "path/to/keyfile.json" -end -``` - -Or globally for all clients: - -```ruby -require "google/cloud/document_ai/v1beta3" - -::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| - config.credentials = "path/to/keyfile.json" -end - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -``` - -### Cloud SDK - -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. - -To configure your system for this, simply: - -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. - -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. - -## Creating a Service Account - -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-document_ai-v1beta3. - -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. - -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. - - *Note: You may need to enable billing in order to use these services.* - -4. Select **Credentials** from the side navigation. - - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. - - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. - - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile deleted file mode 100644 index b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md deleted file mode 100644 index a9540356e91d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Document AI V1beta3 API - -Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML. - -Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Document AI V1beta3 API. Most users should consider using -the main client gem, -[google-cloud-document_ai](https://rubygems.org/gems/google-cloud-document_ai). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-document_ai-v1beta3 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/us-documentai.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/document_ai/v1beta3" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -request = ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new # (request fields as keyword arguments...) -response = client.process_document request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/document-ai/) -for general usage information. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-document_ai`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-document_ai-v1beta3`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-document_ai`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-document_ai-v1beta3`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile deleted file mode 100644 index eefce4d611cb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-document_ai-v1beta3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-document_ai-v1beta3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -end - -# Acceptance tests -desc "Run the google-cloud-document_ai-v1beta3 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["DOCUMENT_AI_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["DOCUMENT_AI_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["DOCUMENT_AI_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or DOCUMENT_AI_TEST_PROJECT=test123 DOCUMENT_AI_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["DOCUMENT_AI_PROJECT"] = project - ENV["DOCUMENT_AI_TEST_PROJECT"] = project - ENV["DOCUMENT_AI_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-document_ai-v1beta3 gem has no acceptance tests." - end - end - - desc "Run acceptance tests with coverage." - task :coverage do - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-document_ai-v1beta3 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-document_ai-v1beta3" - header "google-cloud-document_ai-v1beta3 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-document_ai-v1beta3 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-document_ai-v1beta3 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-document_ai-v1beta3 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-document_ai-v1beta3 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json deleted file mode 100644 index 1134d91d09c7..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.documentai.v1beta3", - "libraryPackage": "::Google::Cloud::DocumentAI::V1beta3", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client", - "rpcs": { - "ProcessDocument": { - "methods": [ - "process_document" - ] - }, - "BatchProcessDocuments": { - "methods": [ - "batch_process_documents" - ] - }, - "FetchProcessorTypes": { - "methods": [ - "fetch_processor_types" - ] - }, - "ListProcessorTypes": { - "methods": [ - "list_processor_types" - ] - }, - "GetProcessorType": { - "methods": [ - "get_processor_type" - ] - }, - "ListProcessors": { - "methods": [ - "list_processors" - ] - }, - "GetProcessor": { - "methods": [ - "get_processor" - ] - }, - "TrainProcessorVersion": { - "methods": [ - "train_processor_version" - ] - }, - "GetProcessorVersion": { - "methods": [ - "get_processor_version" - ] - }, - "ListProcessorVersions": { - "methods": [ - "list_processor_versions" - ] - }, - "DeleteProcessorVersion": { - "methods": [ - "delete_processor_version" - ] - }, - "DeployProcessorVersion": { - "methods": [ - "deploy_processor_version" - ] - }, - "UndeployProcessorVersion": { - "methods": [ - "undeploy_processor_version" - ] - }, - "CreateProcessor": { - "methods": [ - "create_processor" - ] - }, - "DeleteProcessor": { - "methods": [ - "delete_processor" - ] - }, - "EnableProcessor": { - "methods": [ - "enable_processor" - ] - }, - "DisableProcessor": { - "methods": [ - "disable_processor" - ] - }, - "SetDefaultProcessorVersion": { - "methods": [ - "set_default_processor_version" - ] - }, - "ReviewDocument": { - "methods": [ - "review_document" - ] - }, - "EvaluateProcessorVersion": { - "methods": [ - "evaluate_processor_version" - ] - }, - "GetEvaluation": { - "methods": [ - "get_evaluation" - ] - }, - "ListEvaluations": { - "methods": [ - "list_evaluations" - ] - }, - "ImportProcessorVersion": { - "methods": [ - "import_processor_version" - ] - } - } - } - } - }, - "DocumentService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client", - "rpcs": { - "UpdateDataset": { - "methods": [ - "update_dataset" - ] - }, - "ImportDocuments": { - "methods": [ - "import_documents" - ] - }, - "GetDocument": { - "methods": [ - "get_document" - ] - }, - "BatchDeleteDocuments": { - "methods": [ - "batch_delete_documents" - ] - }, - "GetDatasetSchema": { - "methods": [ - "get_dataset_schema" - ] - }, - "UpdateDatasetSchema": { - "methods": [ - "update_dataset_schema" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec b/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec deleted file mode 100644 index 364e7462d316..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/document_ai/v1beta3/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-document_ai-v1beta3" - gem.version = Google::Cloud::DocumentAI::V1beta3::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details." - gem.summary = "Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb deleted file mode 100644 index 8aad94dd490d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/document_ai/v1beta3" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb deleted file mode 100644 index 6e23c80b71c4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/document_ai/v1beta3/document_processor_service" -require "google/cloud/document_ai/v1beta3/document_service" -require "google/cloud/document_ai/v1beta3/version" - -module Google - module Cloud - module DocumentAI - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/document_ai/v1beta3" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/document_ai/v1beta3" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - module V1beta3 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta3", "_helpers.rb" -require "google/cloud/document_ai/v1beta3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb deleted file mode 100644 index f10525932f59..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/bindings_override.rb +++ /dev/null @@ -1,118 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module DocumentAI - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/document_ai/v1beta3/rest" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - module V1beta3 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DocumentAI"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = Configuration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/uiv1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta3/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/uiv1beta3/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - - ## - # @private - # Configuration class for the google.cloud.documentai.v1beta3 package. - # - # This class contains common configuration for all services - # of the google.cloud.documentai.v1beta3 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb deleted file mode 100644 index 6609f25652fb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/document_ai/v1beta3/version" - -require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" -require "google/cloud/document_ai/v1beta3/document_processor_service/paths" -require "google/cloud/document_ai/v1beta3/document_processor_service/operations" -require "google/cloud/document_ai/v1beta3/document_processor_service/client" -require "google/cloud/document_ai/v1beta3/document_processor_service/rest" - -module Google - module Cloud - module DocumentAI - module V1beta3 - ## - # 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. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/document_ai/v1beta3/document_processor_service" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/document_ai/v1beta3/document_processor_service/rest" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - module DocumentProcessorService - end - end - end - end -end - -helper_path = ::File.join __dir__, "document_processor_service", "helpers.rb" -require "google/cloud/document_ai/v1beta3/document_processor_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb deleted file mode 100644 index e84e89ebb6a5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +++ /dev/null @@ -1,2742 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - ## - # Client for the DocumentProcessorService service. - # - # Service to call Document AI to process documents according to the - # processor's definition. Processors are built using state-of-the-art Google - # AI such as natural language, computer vision, and translation to extract - # structured information from unstructured or semi-structured documents. - # - class Client - include Paths - - # @private - attr_reader :document_processor_service_stub - - ## - # Configure the DocumentProcessorService Client class. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentProcessorService clients - # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.process_document.timeout = 300.0 - default_config.rpcs.process_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_process_documents.timeout = 120.0 - default_config.rpcs.batch_process_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.review_document.timeout = 120.0 - default_config.rpcs.review_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentProcessorService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new DocumentProcessorService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DocumentProcessorService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @document_processor_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Processes a single document. - # - # @overload process_document(request, options = nil) - # Pass arguments to `process_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil) - # Pass arguments to `process_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # An inline document proto. - # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash] - # A raw document content (bytes). - # @param gcs_document [::Google::Cloud::DocumentAI::V1beta3::GcsDocument, ::Hash] - # A raw document on Google Cloud Storage. - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the - # server will use its [default - # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # The document payload, the - # {::Google::Cloud::DocumentAI::V1beta3::Document#content content} and - # {::Google::Cloud::DocumentAI::V1beta3::Document#mime_type mime_type} fields must - # be set. - # @param skip_human_review [::Boolean] - # Whether human review should be skipped for this request. Default to - # `false`. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Specifies which fields to include in the - # {::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 process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] - # Inference-time options for the process API - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new - # - # # Call the process_document method. - # result = client.process_document request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. - # p result - # - def process_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.process_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.process_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.process_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :process_document, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # LRO endpoint to batch process many documents. The output is written - # to Cloud Storage as JSON in the [Document] format. - # - # @overload batch_process_documents(request, options = nil) - # Pass arguments to `batch_process_documents` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil) - # Pass arguments to `batch_process_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param input_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, ::Hash>] - # The input config for each single document in the batch process. - # @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash] - # The overall output config for batch process. - # @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] - # The input documents for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} - # method. - # @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash] - # The output configuration for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} - # method. - # @param skip_human_review [::Boolean] - # Whether human review should be skipped for this request. Default to - # `false`. - # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] - # Inference-time options for the process API - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new - # - # # Call the batch_process_documents method. - # result = client.batch_process_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_process_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_process_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_process_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :batch_process_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Fetches processor types. Note that we don't use - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} - # here, because it isn't paginated. - # - # @overload fetch_processor_types(request, options = nil) - # Pass arguments to `fetch_processor_types` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_processor_types(parent: nil) - # Pass arguments to `fetch_processor_types` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of processor types to list. - # Format: `projects/{project}/locations/{location}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new - # - # # Call the fetch_processor_types method. - # result = client.fetch_processor_types request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. - # p result - # - def fetch_processor_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.fetch_processor_types.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_processor_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :fetch_processor_types, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the processor types that exist. - # - # @overload list_processor_types(request, options = nil) - # Pass arguments to `list_processor_types` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_processor_types(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processor_types` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of processor types to list. - # Format: `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of processor types to return. - # If unspecified, at most `100` processor types will be returned. - # The maximum value is `500`. Values above `500` will be coerced to `500`. - # @param page_token [::String] - # Used to retrieve the next page of results, empty if at the end of the list. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new - # - # # Call the list_processor_types method. - # result = client.list_processor_types request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. - # p item - # end - # - def list_processor_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_processor_types.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_processor_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processor_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_processor_types, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor type detail. - # - # @overload get_processor_type(request, options = nil) - # Pass arguments to `get_processor_type` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_processor_type(name: nil) - # Pass arguments to `get_processor_type` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor type resource name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new - # - # # Call the get_processor_type method. - # result = client.get_processor_type request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. - # p result - # - def get_processor_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_processor_type.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_processor_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_processor_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_processor_type, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all processors which belong to this project. - # - # @overload list_processors(request, options = nil) - # Pass arguments to `list_processors` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_processors(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processors` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project and location) which owns this collection of - # Processors. Format: `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # The maximum number of processors to return. - # If unspecified, at most `50` processors will be returned. - # The maximum value is `100`. Values above `100` will be coerced to `100`. - # @param page_token [::String] - # We will return the processors sorted by creation time. The page token - # will point to the next processor. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new - # - # # Call the list_processors method. - # result = client.list_processors request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. - # p item - # end - # - def list_processors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_processors.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_processors.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_processors, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processors, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor detail. - # - # @overload get_processor(request, options = nil) - # Pass arguments to `get_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_processor(name: nil) - # Pass arguments to `get_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new - # - # # Call the get_processor method. - # result = client.get_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - # p result - # - def get_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_processor, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Trains a new processor version. - # Operation metadata is returned as - # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata TrainProcessorVersionMetadata}. - # - # @overload train_processor_version(request, options = nil) - # Pass arguments to `train_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload train_processor_version(custom_document_extraction_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil) - # Pass arguments to `train_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] - # Options to control Custom Document Extraction (CDE) Processor. - # @param parent [::String] - # Required. The parent (project, location and processor) to create the new - # version for. Format: - # `projects/{project}/locations/{location}/processors/{processor}`. - # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash] - # Required. The processor version to be created. - # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] - # Optional. The schema the processor version will be trained with. - # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash] - # Optional. The input data used to train the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # @param base_processor_version [::String] - # Optional. The processor version to use as a base for training. This - # processor version must be a child of `parent`. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new - # - # # Call the train_processor_version method. - # result = client.train_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def train_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.train_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.train_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor version detail. - # - # @overload get_processor_version(request, options = nil) - # Pass arguments to `get_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_processor_version(name: nil) - # Pass arguments to `get_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new - # - # # Call the get_processor_version method. - # result = client.get_processor_version request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - # p result - # - def get_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_processor_version, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all versions of a processor. - # - # @overload list_processor_versions(request, options = nil) - # Pass arguments to `list_processor_versions` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_processor_versions(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processor_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project, location and processor) to list all - # versions. Format: - # `projects/{project}/locations/{location}/processors/{processor}` - # @param page_size [::Integer] - # The maximum number of processor versions to return. - # If unspecified, at most `10` processor versions will be returned. - # The maximum value is `20`. Values above `20` will be coerced to `20`. - # @param page_token [::String] - # We will return the processor versions sorted by creation time. The page - # token will point to the next processor version. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new - # - # # Call the list_processor_versions method. - # result = client.list_processor_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - # p item - # end - # - def list_processor_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_processor_versions.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_processor_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processor_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_processor_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the processor version, all artifacts under the processor version - # will be deleted. - # - # @overload delete_processor_version(request, options = nil) - # Pass arguments to `delete_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_processor_version(name: nil) - # Pass arguments to `delete_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new - # - # # Call the delete_processor_version method. - # result = client.delete_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :delete_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deploys the processor version. - # - # @overload deploy_processor_version(request, options = nil) - # Pass arguments to `deploy_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload deploy_processor_version(name: nil) - # Pass arguments to `deploy_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be deployed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new - # - # # Call the deploy_processor_version method. - # result = client.deploy_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def deploy_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.deploy_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.deploy_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deploy_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :deploy_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeploys the processor version. - # - # @overload undeploy_processor_version(request, options = nil) - # Pass arguments to `undeploy_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undeploy_processor_version(name: nil) - # Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be undeployed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new - # - # # Call the undeploy_processor_version method. - # result = client.undeploy_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undeploy_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.undeploy_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.undeploy_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undeploy_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :undeploy_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a processor from the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorType ProcessorType} provided. - # The processor will be at `ENABLED` state by default after its creation. - # - # @overload create_processor(request, options = nil) - # Pass arguments to `create_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_processor(parent: nil, processor: nil) - # Pass arguments to `create_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project and location) under which to create the - # processor. Format: `projects/{project}/locations/{location}` - # @param processor [::Google::Cloud::DocumentAI::V1beta3::Processor, ::Hash] - # Required. The processor to be created, requires - # {::Google::Cloud::DocumentAI::V1beta3::Processor#type Processor.type} and - # [Processor.display_name]][] to be set. Also, the - # {::Google::Cloud::DocumentAI::V1beta3::Processor#kms_key_name Processor.kms_key_name} - # field must be set if the processor is under CMEK. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new - # - # # Call the create_processor method. - # result = client.create_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - # p result - # - def create_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :create_processor, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the processor, unloads all deployed model artifacts if it was - # enabled and then deletes all artifacts associated with this processor. - # - # @overload delete_processor(request, options = nil) - # Pass arguments to `delete_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_processor(name: nil) - # Pass arguments to `delete_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new - # - # # Call the delete_processor method. - # result = client.delete_processor request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :delete_processor, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a processor - # - # @overload enable_processor(request, options = nil) - # Pass arguments to `enable_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_processor(name: nil) - # Pass arguments to `enable_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be enabled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new - # - # # Call the enable_processor method. - # result = client.enable_processor request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def enable_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :enable_processor, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a processor - # - # @overload disable_processor(request, options = nil) - # Pass arguments to `disable_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_processor(name: nil) - # Pass arguments to `disable_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be disabled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new - # - # # Call the disable_processor method. - # result = client.disable_processor request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def disable_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :disable_processor, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Set the default (active) version of a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} that will be used in - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} - # and - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. - # - # @overload set_default_processor_version(request, options = nil) - # Pass arguments to `set_default_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_default_processor_version(processor: nil, default_processor_version: nil) - # Pass arguments to `set_default_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default - # version. - # @param default_processor_version [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use - # as default. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new - # - # # Call the set_default_processor_version method. - # result = client.set_default_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def set_default_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_default_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.processor - header_params["processor"] = request.processor - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_default_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_default_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :set_default_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Send a document for Human Review. The input document should be processed by - # the specified processor. - # - # @overload review_document(request, options = nil) - # Pass arguments to `review_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload review_document(inline_document: nil, human_review_config: nil, document: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) - # Pass arguments to `review_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # An inline document proto. - # @param human_review_config [::String] - # Required. The resource name of the - # [HumanReviewConfig][google.cloud.documentai.v1beta3.HumanReviewConfig] that - # the document will be reviewed with. - # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # The document that needs human review. - # @param enable_schema_validation [::Boolean] - # Whether the validation should be performed on the ad-hoc review request. - # @param priority [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] - # The document schema of the human review task. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new - # - # # Call the review_document method. - # result = client.review_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def review_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.review_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.human_review_config - header_params["human_review_config"] = request.human_review_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.review_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.review_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :review_document, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Evaluates a ProcessorVersion against annotated documents, producing an - # Evaluation. - # - # @overload evaluate_processor_version(request, options = nil) - # Pass arguments to `evaluate_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil) - # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor_version [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] - # Optional. The documents used in the evaluation. If unspecified, use the - # processor's dataset as evaluation input. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new - # - # # Call the evaluate_processor_version method. - # result = client.evaluate_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def evaluate_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.evaluate_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.processor_version - header_params["processor_version"] = request.processor_version - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.evaluate_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a specific evaluation. - # - # @overload get_evaluation(request, options = nil) - # Pass arguments to `get_evaluation` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_evaluation(name: nil) - # Pass arguments to `get_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new - # - # # Call the get_evaluation method. - # result = client.get_evaluation request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. - # p result - # - def get_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_evaluation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a set of evaluations for a given processor version. - # - # @overload list_evaluations(request, options = nil) - # Pass arguments to `list_evaluations` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_evaluations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # list evaluations for. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param page_size [::Integer] - # The standard list page size. - # If unspecified, at most `5` evaluations are returned. - # The maximum value is `100`. Values above `100` are coerced to `100`. - # @param page_token [::String] - # A page token, received from a previous `ListEvaluations` call. - # Provide this to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new - # - # # Call the list_evaluations method. - # result = client.list_evaluations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. - # p item - # end - # - def list_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_evaluations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports a processor version from source processor version. - # - # @overload import_processor_version(request, options = nil) - # Pass arguments to `import_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_processor_version(processor_version_source: nil, external_processor_version_source: nil, parent: nil) - # Pass arguments to `import_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor_version_source [::String] - # The source processor version to import from. The source processor version - # and destination processor need to be in the same environment and region. - # @param external_processor_version_source [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource, ::Hash] - # The source processor version to import from, and can be from different - # environment and region than the destination processor. - # @param parent [::String] - # Required. The destination processor name to create the processor version - # in. Format: - # `projects/{project}/locations/{location}/processors/{processor}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new - # - # # Call the import_processor_version method. - # result = client.import_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :import_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DocumentProcessorService API. - # - # This class represents the configuration for DocumentProcessorService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # process_document to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the DocumentProcessorService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `process_document` - # @return [::Gapic::Config::Method] - # - attr_reader :process_document - ## - # RPC-specific configuration for `batch_process_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_process_documents - ## - # RPC-specific configuration for `fetch_processor_types` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_processor_types - ## - # RPC-specific configuration for `list_processor_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processor_types - ## - # RPC-specific configuration for `get_processor_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor_type - ## - # RPC-specific configuration for `list_processors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processors - ## - # RPC-specific configuration for `get_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor - ## - # RPC-specific configuration for `train_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :train_processor_version - ## - # RPC-specific configuration for `get_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor_version - ## - # RPC-specific configuration for `list_processor_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processor_versions - ## - # RPC-specific configuration for `delete_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_processor_version - ## - # RPC-specific configuration for `deploy_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_processor_version - ## - # RPC-specific configuration for `undeploy_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_processor_version - ## - # RPC-specific configuration for `create_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :create_processor - ## - # RPC-specific configuration for `delete_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_processor - ## - # RPC-specific configuration for `enable_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_processor - ## - # RPC-specific configuration for `disable_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_processor - ## - # RPC-specific configuration for `set_default_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :set_default_processor_version - ## - # RPC-specific configuration for `review_document` - # @return [::Gapic::Config::Method] - # - attr_reader :review_document - ## - # RPC-specific configuration for `evaluate_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :evaluate_processor_version - ## - # RPC-specific configuration for `get_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_evaluation - ## - # RPC-specific configuration for `list_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_evaluations - ## - # RPC-specific configuration for `import_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :import_processor_version - - # @private - def initialize parent_rpcs = nil - process_document_config = parent_rpcs.process_document if parent_rpcs.respond_to? :process_document - @process_document = ::Gapic::Config::Method.new process_document_config - batch_process_documents_config = parent_rpcs.batch_process_documents if parent_rpcs.respond_to? :batch_process_documents - @batch_process_documents = ::Gapic::Config::Method.new batch_process_documents_config - fetch_processor_types_config = parent_rpcs.fetch_processor_types if parent_rpcs.respond_to? :fetch_processor_types - @fetch_processor_types = ::Gapic::Config::Method.new fetch_processor_types_config - list_processor_types_config = parent_rpcs.list_processor_types if parent_rpcs.respond_to? :list_processor_types - @list_processor_types = ::Gapic::Config::Method.new list_processor_types_config - get_processor_type_config = parent_rpcs.get_processor_type if parent_rpcs.respond_to? :get_processor_type - @get_processor_type = ::Gapic::Config::Method.new get_processor_type_config - list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors - @list_processors = ::Gapic::Config::Method.new list_processors_config - get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor - @get_processor = ::Gapic::Config::Method.new get_processor_config - train_processor_version_config = parent_rpcs.train_processor_version if parent_rpcs.respond_to? :train_processor_version - @train_processor_version = ::Gapic::Config::Method.new train_processor_version_config - get_processor_version_config = parent_rpcs.get_processor_version if parent_rpcs.respond_to? :get_processor_version - @get_processor_version = ::Gapic::Config::Method.new get_processor_version_config - list_processor_versions_config = parent_rpcs.list_processor_versions if parent_rpcs.respond_to? :list_processor_versions - @list_processor_versions = ::Gapic::Config::Method.new list_processor_versions_config - delete_processor_version_config = parent_rpcs.delete_processor_version if parent_rpcs.respond_to? :delete_processor_version - @delete_processor_version = ::Gapic::Config::Method.new delete_processor_version_config - deploy_processor_version_config = parent_rpcs.deploy_processor_version if parent_rpcs.respond_to? :deploy_processor_version - @deploy_processor_version = ::Gapic::Config::Method.new deploy_processor_version_config - undeploy_processor_version_config = parent_rpcs.undeploy_processor_version if parent_rpcs.respond_to? :undeploy_processor_version - @undeploy_processor_version = ::Gapic::Config::Method.new undeploy_processor_version_config - create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor - @create_processor = ::Gapic::Config::Method.new create_processor_config - delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor - @delete_processor = ::Gapic::Config::Method.new delete_processor_config - enable_processor_config = parent_rpcs.enable_processor if parent_rpcs.respond_to? :enable_processor - @enable_processor = ::Gapic::Config::Method.new enable_processor_config - disable_processor_config = parent_rpcs.disable_processor if parent_rpcs.respond_to? :disable_processor - @disable_processor = ::Gapic::Config::Method.new disable_processor_config - set_default_processor_version_config = parent_rpcs.set_default_processor_version if parent_rpcs.respond_to? :set_default_processor_version - @set_default_processor_version = ::Gapic::Config::Method.new set_default_processor_version_config - review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document - @review_document = ::Gapic::Config::Method.new review_document_config - evaluate_processor_version_config = parent_rpcs.evaluate_processor_version if parent_rpcs.respond_to? :evaluate_processor_version - @evaluate_processor_version = ::Gapic::Config::Method.new evaluate_processor_version_config - get_evaluation_config = parent_rpcs.get_evaluation if parent_rpcs.respond_to? :get_evaluation - @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config - list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations - @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config - import_processor_version_config = parent_rpcs.import_processor_version if parent_rpcs.respond_to? :import_processor_version - @import_processor_version = ::Gapic::Config::Method.new import_processor_version_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb deleted file mode 100644 index 75ae5a98a886..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Credentials for the DocumentProcessorService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DOCUMENT_AI_CREDENTIALS", - "DOCUMENT_AI_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DOCUMENT_AI_CREDENTIALS_JSON", - "DOCUMENT_AI_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb deleted file mode 100644 index e9104f254115..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +++ /dev/null @@ -1,779 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Service that implements Longrunning Operations API. - class Operations - # @private - attr_reader :operations_stub - - ## - # Configuration for the DocumentProcessorService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentProcessorService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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 - # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb deleted file mode 100644 index bd199612e369..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb +++ /dev/null @@ -1,151 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Path helper methods for the DocumentProcessorService API. - module Paths - ## - # Create a fully-qualified Evaluation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # @param processor_version [String] - # @param evaluation [String] - # - # @return [::String] - def evaluation_path project:, location:, processor:, processor_version:, evaluation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" - raise ::ArgumentError, "processor_version cannot contain /" if processor_version.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}/evaluations/#{evaluation}" - end - - ## - # Create a fully-qualified HumanReviewConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # - # @return [::String] - def human_review_config_path project:, location:, processor: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/humanReviewConfig" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Processor resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # - # @return [::String] - def processor_path project:, location:, processor: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}" - end - - ## - # Create a fully-qualified ProcessorType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processorTypes/{processor_type}` - # - # @param project [String] - # @param location [String] - # @param processor_type [String] - # - # @return [::String] - def processor_type_path project:, location:, processor_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processorTypes/#{processor_type}" - end - - ## - # Create a fully-qualified ProcessorVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # @param processor_version [String] - # - # @return [::String] - def processor_version_path project:, location:, processor:, processor_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb deleted file mode 100644 index 26f2fc6e52bb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/document_ai/v1beta3/version" -require "google/cloud/document_ai/v1beta3/bindings_override" - -require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" -require "google/cloud/document_ai/v1beta3/document_processor_service/paths" -require "google/cloud/document_ai/v1beta3/document_processor_service/rest/operations" -require "google/cloud/document_ai/v1beta3/document_processor_service/rest/client" - -module Google - module Cloud - module DocumentAI - module V1beta3 - ## - # 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. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/document_ai/v1beta3/document_processor_service/rest" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - module DocumentProcessorService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/document_ai/v1beta3/document_processor_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb deleted file mode 100644 index d7db1cf29d3e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb +++ /dev/null @@ -1,2560 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - module Rest - ## - # REST client for the DocumentProcessorService service. - # - # Service to call Document AI to process documents according to the - # processor's definition. Processors are built using state-of-the-art Google - # AI such as natural language, computer vision, and translation to extract - # structured information from unstructured or semi-structured documents. - # - class Client - include Paths - - # @private - attr_reader :document_processor_service_stub - - ## - # Configure the DocumentProcessorService Client class. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentProcessorService clients - # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.process_document.timeout = 300.0 - default_config.rpcs.process_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_process_documents.timeout = 120.0 - default_config.rpcs.batch_process_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.review_document.timeout = 120.0 - default_config.rpcs.review_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentProcessorService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new DocumentProcessorService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DocumentProcessorService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.bindings_override = @config.bindings_override - end - - @document_processor_service_stub = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Processes a single document. - # - # @overload process_document(request, options = nil) - # Pass arguments to `process_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil) - # Pass arguments to `process_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # An inline document proto. - # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash] - # A raw document content (bytes). - # @param gcs_document [::Google::Cloud::DocumentAI::V1beta3::GcsDocument, ::Hash] - # A raw document on Google Cloud Storage. - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the - # server will use its [default - # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # The document payload, the - # {::Google::Cloud::DocumentAI::V1beta3::Document#content content} and - # {::Google::Cloud::DocumentAI::V1beta3::Document#mime_type mime_type} fields must - # be set. - # @param skip_human_review [::Boolean] - # Whether human review should be skipped for this request. Default to - # `false`. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Specifies which fields to include in the - # {::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 process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] - # Inference-time options for the process API - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new - # - # # Call the process_document method. - # result = client.process_document request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. - # p result - # - def process_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.process_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.process_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.process_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.process_document request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # LRO endpoint to batch process many documents. The output is written - # to Cloud Storage as JSON in the [Document] format. - # - # @overload batch_process_documents(request, options = nil) - # Pass arguments to `batch_process_documents` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil) - # Pass arguments to `batch_process_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param input_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, ::Hash>] - # The input config for each single document in the batch process. - # @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash] - # The overall output config for batch process. - # @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] - # The input documents for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments} - # method. - # @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash] - # The output configuration for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments} - # method. - # @param skip_human_review [::Boolean] - # Whether human review should be skipped for this request. Default to - # `false`. - # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] - # Inference-time options for the process API - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new - # - # # Call the batch_process_documents method. - # result = client.batch_process_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_process_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_process_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_process_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.batch_process_documents request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Fetches processor types. Note that we don't use - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#list_processor_types ListProcessorTypes} - # here, because it isn't paginated. - # - # @overload fetch_processor_types(request, options = nil) - # Pass arguments to `fetch_processor_types` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_processor_types(parent: nil) - # Pass arguments to `fetch_processor_types` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of processor types to list. - # Format: `projects/{project}/locations/{location}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new - # - # # Call the fetch_processor_types method. - # result = client.fetch_processor_types request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. - # p result - # - def fetch_processor_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.fetch_processor_types.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_processor_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.fetch_processor_types request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the processor types that exist. - # - # @overload list_processor_types(request, options = nil) - # Pass arguments to `list_processor_types` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_processor_types(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processor_types` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of processor types to list. - # Format: `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of processor types to return. - # If unspecified, at most `100` processor types will be returned. - # The maximum value is `500`. Values above `500` will be coerced to `500`. - # @param page_token [::String] - # Used to retrieve the next page of results, empty if at the end of the list. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new - # - # # Call the list_processor_types method. - # result = client.list_processor_types request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. - # p item - # end - # - def list_processor_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_processor_types.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_processor_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_processor_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.list_processor_types request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, "processor_types", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor type detail. - # - # @overload get_processor_type(request, options = nil) - # Pass arguments to `get_processor_type` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_processor_type(name: nil) - # Pass arguments to `get_processor_type` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor type resource name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new - # - # # Call the get_processor_type method. - # result = client.get_processor_type request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. - # p result - # - def get_processor_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_processor_type.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_processor_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_processor_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.get_processor_type request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all processors which belong to this project. - # - # @overload list_processors(request, options = nil) - # Pass arguments to `list_processors` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_processors(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processors` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project and location) which owns this collection of - # Processors. Format: `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # The maximum number of processors to return. - # If unspecified, at most `50` processors will be returned. - # The maximum value is `100`. Values above `100` will be coerced to `100`. - # @param page_token [::String] - # We will return the processors sorted by creation time. The page token - # will point to the next processor. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new - # - # # Call the list_processors method. - # result = client.list_processors request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. - # p item - # end - # - def list_processors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_processors.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_processors.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_processors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.list_processors request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processors, "processors", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor detail. - # - # @overload get_processor(request, options = nil) - # Pass arguments to `get_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_processor(name: nil) - # Pass arguments to `get_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new - # - # # Call the get_processor method. - # result = client.get_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - # p result - # - def get_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.get_processor request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Trains a new processor version. - # Operation metadata is returned as - # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata TrainProcessorVersionMetadata}. - # - # @overload train_processor_version(request, options = nil) - # Pass arguments to `train_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload train_processor_version(custom_document_extraction_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil) - # Pass arguments to `train_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] - # Options to control Custom Document Extraction (CDE) Processor. - # @param parent [::String] - # Required. The parent (project, location and processor) to create the new - # version for. Format: - # `projects/{project}/locations/{location}/processors/{processor}`. - # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash] - # Required. The processor version to be created. - # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] - # Optional. The schema the processor version will be trained with. - # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash] - # Optional. The input data used to train the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # @param base_processor_version [::String] - # Optional. The processor version to use as a base for training. This - # processor version must be a child of `parent`. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new - # - # # Call the train_processor_version method. - # result = client.train_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def train_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.train_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.train_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.train_processor_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor version detail. - # - # @overload get_processor_version(request, options = nil) - # Pass arguments to `get_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_processor_version(name: nil) - # Pass arguments to `get_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new - # - # # Call the get_processor_version method. - # result = client.get_processor_version request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - # p result - # - def get_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.get_processor_version request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all versions of a processor. - # - # @overload list_processor_versions(request, options = nil) - # Pass arguments to `list_processor_versions` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_processor_versions(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processor_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project, location and processor) to list all - # versions. Format: - # `projects/{project}/locations/{location}/processors/{processor}` - # @param page_size [::Integer] - # The maximum number of processor versions to return. - # If unspecified, at most `10` processor versions will be returned. - # The maximum value is `20`. Values above `20` will be coerced to `20`. - # @param page_token [::String] - # We will return the processor versions sorted by creation time. The page - # token will point to the next processor version. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new - # - # # Call the list_processor_versions method. - # result = client.list_processor_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - # p item - # end - # - def list_processor_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_processor_versions.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_processor_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_processor_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.list_processor_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, "processor_versions", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the processor version, all artifacts under the processor version - # will be deleted. - # - # @overload delete_processor_version(request, options = nil) - # Pass arguments to `delete_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_processor_version(name: nil) - # Pass arguments to `delete_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new - # - # # Call the delete_processor_version method. - # result = client.delete_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.delete_processor_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deploys the processor version. - # - # @overload deploy_processor_version(request, options = nil) - # Pass arguments to `deploy_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload deploy_processor_version(name: nil) - # Pass arguments to `deploy_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be deployed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new - # - # # Call the deploy_processor_version method. - # result = client.deploy_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def deploy_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.deploy_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.deploy_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.deploy_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.deploy_processor_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeploys the processor version. - # - # @overload undeploy_processor_version(request, options = nil) - # Pass arguments to `undeploy_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undeploy_processor_version(name: nil) - # Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be undeployed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new - # - # # Call the undeploy_processor_version method. - # result = client.undeploy_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undeploy_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.undeploy_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undeploy_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undeploy_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.undeploy_processor_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a processor from the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorType ProcessorType} provided. - # The processor will be at `ENABLED` state by default after its creation. - # - # @overload create_processor(request, options = nil) - # Pass arguments to `create_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_processor(parent: nil, processor: nil) - # Pass arguments to `create_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project and location) under which to create the - # processor. Format: `projects/{project}/locations/{location}` - # @param processor [::Google::Cloud::DocumentAI::V1beta3::Processor, ::Hash] - # Required. The processor to be created, requires - # {::Google::Cloud::DocumentAI::V1beta3::Processor#type Processor.type} and - # [Processor.display_name]][] to be set. Also, the - # {::Google::Cloud::DocumentAI::V1beta3::Processor#kms_key_name Processor.kms_key_name} - # field must be set if the processor is under CMEK. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new - # - # # Call the create_processor method. - # result = client.create_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - # p result - # - def create_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.create_processor request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the processor, unloads all deployed model artifacts if it was - # enabled and then deletes all artifacts associated with this processor. - # - # @overload delete_processor(request, options = nil) - # Pass arguments to `delete_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_processor(name: nil) - # Pass arguments to `delete_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new - # - # # Call the delete_processor method. - # result = client.delete_processor request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.delete_processor request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a processor - # - # @overload enable_processor(request, options = nil) - # Pass arguments to `enable_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_processor(name: nil) - # Pass arguments to `enable_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be enabled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new - # - # # Call the enable_processor method. - # result = client.enable_processor request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def enable_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.enable_processor request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a processor - # - # @overload disable_processor(request, options = nil) - # Pass arguments to `disable_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_processor(name: nil) - # Pass arguments to `disable_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be disabled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new - # - # # Call the disable_processor method. - # result = client.disable_processor request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def disable_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.disable_processor request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Set the default (active) version of a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} that will be used in - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#process_document ProcessDocument} - # and - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments}. - # - # @overload set_default_processor_version(request, options = nil) - # Pass arguments to `set_default_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_default_processor_version(processor: nil, default_processor_version: nil) - # Pass arguments to `set_default_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default - # version. - # @param default_processor_version [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use - # as default. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new - # - # # Call the set_default_processor_version method. - # result = client.set_default_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def set_default_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_default_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_default_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_default_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.set_default_processor_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Send a document for Human Review. The input document should be processed by - # the specified processor. - # - # @overload review_document(request, options = nil) - # Pass arguments to `review_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload review_document(inline_document: nil, human_review_config: nil, document: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) - # Pass arguments to `review_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # An inline document proto. - # @param human_review_config [::String] - # Required. The resource name of the - # [HumanReviewConfig][google.cloud.documentai.v1beta3.HumanReviewConfig] that - # the document will be reviewed with. - # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # The document that needs human review. - # @param enable_schema_validation [::Boolean] - # Whether the validation should be performed on the ad-hoc review request. - # @param priority [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] - # The document schema of the human review task. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new - # - # # Call the review_document method. - # result = client.review_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def review_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.review_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.review_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.review_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.review_document request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Evaluates a ProcessorVersion against annotated documents, producing an - # Evaluation. - # - # @overload evaluate_processor_version(request, options = nil) - # Pass arguments to `evaluate_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil) - # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor_version [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] - # Optional. The documents used in the evaluation. If unspecified, use the - # processor's dataset as evaluation input. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new - # - # # Call the evaluate_processor_version method. - # result = client.evaluate_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def evaluate_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.evaluate_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.evaluate_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.evaluate_processor_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a specific evaluation. - # - # @overload get_evaluation(request, options = nil) - # Pass arguments to `get_evaluation` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_evaluation(name: nil) - # Pass arguments to `get_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new - # - # # Call the get_evaluation method. - # result = client.get_evaluation request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. - # p result - # - def get_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_evaluation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.get_evaluation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a set of evaluations for a given processor version. - # - # @overload list_evaluations(request, options = nil) - # Pass arguments to `list_evaluations` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_evaluations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # list evaluations for. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param page_size [::Integer] - # The standard list page size. - # If unspecified, at most `5` evaluations are returned. - # The maximum value is `100`. Values above `100` are coerced to `100`. - # @param page_token [::String] - # A page token, received from a previous `ListEvaluations` call. - # Provide this to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new - # - # # Call the list_evaluations method. - # result = client.list_evaluations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. - # p item - # end - # - def list_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_evaluations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.list_evaluations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, "evaluations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports a processor version from source processor version. - # - # @overload import_processor_version(request, options = nil) - # Pass arguments to `import_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_processor_version(processor_version_source: nil, external_processor_version_source: nil, parent: nil) - # Pass arguments to `import_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor_version_source [::String] - # The source processor version to import from. The source processor version - # and destination processor need to be in the same environment and region. - # @param external_processor_version_source [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource, ::Hash] - # The source processor version to import from, and can be from different - # environment and region than the destination processor. - # @param parent [::String] - # Required. The destination processor name to create the processor version - # in. Format: - # `projects/{project}/locations/{location}/processors/{processor}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new - # - # # Call the import_processor_version method. - # result = client.import_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_processor_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.import_processor_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DocumentProcessorService REST API. - # - # This class represents the configuration for DocumentProcessorService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # process_document to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the DocumentProcessorService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `process_document` - # @return [::Gapic::Config::Method] - # - attr_reader :process_document - ## - # RPC-specific configuration for `batch_process_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_process_documents - ## - # RPC-specific configuration for `fetch_processor_types` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_processor_types - ## - # RPC-specific configuration for `list_processor_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processor_types - ## - # RPC-specific configuration for `get_processor_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor_type - ## - # RPC-specific configuration for `list_processors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processors - ## - # RPC-specific configuration for `get_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor - ## - # RPC-specific configuration for `train_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :train_processor_version - ## - # RPC-specific configuration for `get_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor_version - ## - # RPC-specific configuration for `list_processor_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processor_versions - ## - # RPC-specific configuration for `delete_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_processor_version - ## - # RPC-specific configuration for `deploy_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_processor_version - ## - # RPC-specific configuration for `undeploy_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_processor_version - ## - # RPC-specific configuration for `create_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :create_processor - ## - # RPC-specific configuration for `delete_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_processor - ## - # RPC-specific configuration for `enable_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_processor - ## - # RPC-specific configuration for `disable_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_processor - ## - # RPC-specific configuration for `set_default_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :set_default_processor_version - ## - # RPC-specific configuration for `review_document` - # @return [::Gapic::Config::Method] - # - attr_reader :review_document - ## - # RPC-specific configuration for `evaluate_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :evaluate_processor_version - ## - # RPC-specific configuration for `get_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_evaluation - ## - # RPC-specific configuration for `list_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_evaluations - ## - # RPC-specific configuration for `import_processor_version` - # @return [::Gapic::Config::Method] - # - attr_reader :import_processor_version - - # @private - def initialize parent_rpcs = nil - process_document_config = parent_rpcs.process_document if parent_rpcs.respond_to? :process_document - @process_document = ::Gapic::Config::Method.new process_document_config - batch_process_documents_config = parent_rpcs.batch_process_documents if parent_rpcs.respond_to? :batch_process_documents - @batch_process_documents = ::Gapic::Config::Method.new batch_process_documents_config - fetch_processor_types_config = parent_rpcs.fetch_processor_types if parent_rpcs.respond_to? :fetch_processor_types - @fetch_processor_types = ::Gapic::Config::Method.new fetch_processor_types_config - list_processor_types_config = parent_rpcs.list_processor_types if parent_rpcs.respond_to? :list_processor_types - @list_processor_types = ::Gapic::Config::Method.new list_processor_types_config - get_processor_type_config = parent_rpcs.get_processor_type if parent_rpcs.respond_to? :get_processor_type - @get_processor_type = ::Gapic::Config::Method.new get_processor_type_config - list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors - @list_processors = ::Gapic::Config::Method.new list_processors_config - get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor - @get_processor = ::Gapic::Config::Method.new get_processor_config - train_processor_version_config = parent_rpcs.train_processor_version if parent_rpcs.respond_to? :train_processor_version - @train_processor_version = ::Gapic::Config::Method.new train_processor_version_config - get_processor_version_config = parent_rpcs.get_processor_version if parent_rpcs.respond_to? :get_processor_version - @get_processor_version = ::Gapic::Config::Method.new get_processor_version_config - list_processor_versions_config = parent_rpcs.list_processor_versions if parent_rpcs.respond_to? :list_processor_versions - @list_processor_versions = ::Gapic::Config::Method.new list_processor_versions_config - delete_processor_version_config = parent_rpcs.delete_processor_version if parent_rpcs.respond_to? :delete_processor_version - @delete_processor_version = ::Gapic::Config::Method.new delete_processor_version_config - deploy_processor_version_config = parent_rpcs.deploy_processor_version if parent_rpcs.respond_to? :deploy_processor_version - @deploy_processor_version = ::Gapic::Config::Method.new deploy_processor_version_config - undeploy_processor_version_config = parent_rpcs.undeploy_processor_version if parent_rpcs.respond_to? :undeploy_processor_version - @undeploy_processor_version = ::Gapic::Config::Method.new undeploy_processor_version_config - create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor - @create_processor = ::Gapic::Config::Method.new create_processor_config - delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor - @delete_processor = ::Gapic::Config::Method.new delete_processor_config - enable_processor_config = parent_rpcs.enable_processor if parent_rpcs.respond_to? :enable_processor - @enable_processor = ::Gapic::Config::Method.new enable_processor_config - disable_processor_config = parent_rpcs.disable_processor if parent_rpcs.respond_to? :disable_processor - @disable_processor = ::Gapic::Config::Method.new disable_processor_config - set_default_processor_version_config = parent_rpcs.set_default_processor_version if parent_rpcs.respond_to? :set_default_processor_version - @set_default_processor_version = ::Gapic::Config::Method.new set_default_processor_version_config - review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document - @review_document = ::Gapic::Config::Method.new review_document_config - evaluate_processor_version_config = parent_rpcs.evaluate_processor_version if parent_rpcs.respond_to? :evaluate_processor_version - @evaluate_processor_version = ::Gapic::Config::Method.new evaluate_processor_version_config - get_evaluation_config = parent_rpcs.get_evaluation if parent_rpcs.respond_to? :get_evaluation - @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config - list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations - @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config - import_processor_version_config = parent_rpcs.import_processor_version if parent_rpcs.respond_to? :import_processor_version - @import_processor_version = ::Gapic::Config::Method.new import_processor_version_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb deleted file mode 100644 index 03738013040f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb +++ /dev/null @@ -1,890 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - attr_reader :operations_stub - - ## - # Configuration for the DocumentProcessorService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentProcessorService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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 - # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/uiv1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/uiv1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/uiv1beta3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb deleted file mode 100644 index 3d8987bc9f97..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb +++ /dev/null @@ -1,1433 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/documentai/v1beta3/document_processor_service_pb" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - module Rest - ## - # REST service stub for the DocumentProcessorService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # Baseline implementation for the process_document REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # A result object deserialized from the server's reply - def process_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_process_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the batch_process_documents REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_process_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_process_documents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the fetch_processor_types REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # A result object deserialized from the server's reply - def fetch_processor_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_processor_types_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_processor_types REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse] - # A result object deserialized from the server's reply - def list_processor_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_processor_types_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_processor_type REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # A result object deserialized from the server's reply - def get_processor_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_processors REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse] - # A result object deserialized from the server's reply - def list_processors request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_processors_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # A result object deserialized from the server's reply - def get_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::Processor.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the train_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def train_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_train_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # A result object deserialized from the server's reply - def get_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_processor_versions REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse] - # A result object deserialized from the server's reply - def list_processor_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_processor_versions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the deploy_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def deploy_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_deploy_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the undeploy_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def undeploy_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the create_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # A result object deserialized from the server's reply - def create_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_processor_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::Processor.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the enable_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def enable_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_processor_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the disable_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def disable_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_processor_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the set_default_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def set_default_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_default_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the review_document REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def review_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_review_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the evaluate_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def evaluate_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_evaluate_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_evaluation REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # A result object deserialized from the server's reply - def get_evaluation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_evaluation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_evaluations REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse] - # A result object deserialized from the server's reply - def list_evaluations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_evaluations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the import_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_processor_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_processor_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the process_document REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_process_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:process", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:process", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_process_documents REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_process_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:batchProcess", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:batchProcess", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_processor_types REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_processor_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{parent}:fetchProcessorTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_processor_types REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_processor_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{parent}/processorTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_processor_type REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_processor_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_processors REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_processors_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{parent}/processors", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the train_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_train_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{parent}/processorVersions:train", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_processor_versions REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_processor_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{parent}/processorVersions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the deploy_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_deploy_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:deploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undeploy_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undeploy_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:undeploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{parent}/processors", - body: "processor", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_processor REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_default_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_default_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{processor}:setDefaultProcessorVersion", - body: "*", - matches: [ - ["processor", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the review_document REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_review_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{human_review_config}:reviewDocument", - body: "*", - matches: [ - ["human_review_config", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/humanReviewConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the evaluate_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_evaluate_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{processor_version}:evaluateProcessorVersion", - body: "*", - matches: [ - ["processor_version", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_evaluation REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_evaluation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/evaluations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_evaluations REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_evaluations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{parent}/evaluations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_processor_version REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_processor_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{parent}/processorVersions:importProcessorVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb deleted file mode 100644 index 69eb7bc63b3a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/document_ai/v1beta3/version" - -require "google/cloud/document_ai/v1beta3/document_service/credentials" -require "google/cloud/document_ai/v1beta3/document_service/paths" -require "google/cloud/document_ai/v1beta3/document_service/operations" -require "google/cloud/document_ai/v1beta3/document_service/client" -require "google/cloud/document_ai/v1beta3/document_service/rest" - -module Google - module Cloud - module DocumentAI - module V1beta3 - ## - # Service to call Cloud DocumentAI to manage document collection (dataset). - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/document_ai/v1beta3/document_service" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/document_ai/v1beta3/document_service/rest" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - module DocumentService - end - end - end - end -end - -helper_path = ::File.join __dir__, "document_service", "helpers.rb" -require "google/cloud/document_ai/v1beta3/document_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb deleted file mode 100644 index a0a9f6d1221c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb +++ /dev/null @@ -1,941 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/documentai/v1beta3/document_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - ## - # Client for the DocumentService service. - # - # Service to call Cloud DocumentAI to manage document collection (dataset). - # - class Client - include Paths - - # @private - attr_reader :document_service_stub - - ## - # Configure the DocumentService Client class. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentService clients - # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new DocumentService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DocumentService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/documentai/v1beta3/document_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @document_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Updates metadata associated with a dataset. - # - # @overload update_dataset(request, options = nil) - # Pass arguments to `update_dataset` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_dataset(dataset: nil, update_mask: nil) - # Pass arguments to `update_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::Google::Cloud::DocumentAI::V1beta3::Dataset, ::Hash] - # Required. The `name` field of the `Dataset` is used to identify the - # resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The update mask applies to the resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new - # - # # Call the update_dataset method. - # result = client.update_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_dataset.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.dataset&.name - header_params["dataset.name"] = request.dataset.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :update_dataset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Import documents into a dataset. - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_documents(dataset: nil, batch_documents_import_configs: nil) - # Pass arguments to `import_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. The dataset resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @param batch_documents_import_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig, ::Hash>] - # Required. The Cloud Storage uri containing raw documents that must be - # imported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new - # - # # Call the import_documents method. - # result = client.import_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.dataset - header_params["dataset"] = request.dataset - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :import_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns relevant fields present in the requested document. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_document(dataset: nil, document_id: nil, read_mask: nil, page_range: nil) - # Pass arguments to `get_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. The resource name of the dataset that the document belongs to . - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @param document_id [::Google::Cloud::DocumentAI::V1beta3::DocumentId, ::Hash] - # Required. Document identifier. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # If set, only fields listed here will be returned. Otherwise, all fields - # will be returned by default. - # @param page_range [::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange, ::Hash] - # List of pages for which the fields specified in the `read_mask` must - # be served. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse. - # p result - # - def get_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.dataset - header_params["dataset"] = request.dataset - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :get_document, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a set of documents. - # - # @overload batch_delete_documents(request, options = nil) - # Pass arguments to `batch_delete_documents` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_delete_documents(dataset: nil, dataset_documents: nil) - # Pass arguments to `batch_delete_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. The dataset resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @param dataset_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments, ::Hash] - # Required. Dataset documents input. If given `filter`, all documents - # satisfying the filter will be deleted. If given documentIds, a maximum of - # 50 documents can be deleted in a batch. The request will be rejected if - # more than 50 document_ids are provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new - # - # # Call the batch_delete_documents method. - # result = client.batch_delete_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_delete_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_delete_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.dataset - header_params["dataset"] = request.dataset - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_delete_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :batch_delete_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the `DatasetSchema` of a `Dataset`. - # - # @overload get_dataset_schema(request, options = nil) - # Pass arguments to `get_dataset_schema` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_dataset_schema(name: nil, visible_fields_only: nil) - # Pass arguments to `get_dataset_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The dataset schema resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset/datasetSchema - # @param visible_fields_only [::Boolean] - # If set, only returns the visible fields of the schema. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new - # - # # Call the get_dataset_schema method. - # result = client.get_dataset_schema request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. - # p result - # - def get_dataset_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_dataset_schema.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_dataset_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_dataset_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :get_dataset_schema, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a `DatasetSchema`. - # - # @overload update_dataset_schema(request, options = nil) - # Pass arguments to `update_dataset_schema` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_dataset_schema(dataset_schema: nil, update_mask: nil) - # Pass arguments to `update_dataset_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset_schema [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema, ::Hash] - # Required. The name field of the `DatasetSchema` is used to identify the - # resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The update mask applies to the resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new - # - # # Call the update_dataset_schema method. - # result = client.update_dataset_schema request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. - # p result - # - def update_dataset_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_dataset_schema.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.dataset_schema&.name - header_params["dataset_schema.name"] = request.dataset_schema.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_dataset_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_dataset_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :update_dataset_schema, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DocumentService API. - # - # This class represents the configuration for DocumentService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_dataset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_dataset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_dataset.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the DocumentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `batch_delete_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_documents - ## - # RPC-specific configuration for `get_dataset_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset_schema - ## - # RPC-specific configuration for `update_dataset_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset_schema - - # @private - def initialize parent_rpcs = nil - update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset - @update_dataset = ::Gapic::Config::Method.new update_dataset_config - import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents - @import_documents = ::Gapic::Config::Method.new import_documents_config - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - batch_delete_documents_config = parent_rpcs.batch_delete_documents if parent_rpcs.respond_to? :batch_delete_documents - @batch_delete_documents = ::Gapic::Config::Method.new batch_delete_documents_config - get_dataset_schema_config = parent_rpcs.get_dataset_schema if parent_rpcs.respond_to? :get_dataset_schema - @get_dataset_schema = ::Gapic::Config::Method.new get_dataset_schema_config - update_dataset_schema_config = parent_rpcs.update_dataset_schema if parent_rpcs.respond_to? :update_dataset_schema - @update_dataset_schema = ::Gapic::Config::Method.new update_dataset_schema_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb deleted file mode 100644 index c035ea57158b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - # Credentials for the DocumentService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DOCUMENT_AI_CREDENTIALS", - "DOCUMENT_AI_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DOCUMENT_AI_CREDENTIALS_JSON", - "DOCUMENT_AI_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb deleted file mode 100644 index 1ba5041bfcef..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb +++ /dev/null @@ -1,779 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - # Service that implements Longrunning Operations API. - class Operations - # @private - attr_reader :operations_stub - - ## - # Configuration for the DocumentService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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 - # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb deleted file mode 100644 index 6d22632859f9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/paths.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - # Path helper methods for the DocumentService API. - module Paths - ## - # Create a fully-qualified Dataset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/dataset` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # - # @return [::String] - def dataset_path project:, location:, processor: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/dataset" - end - - ## - # Create a fully-qualified DatasetSchema resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # - # @return [::String] - def dataset_schema_path project:, location:, processor: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/dataset/datasetSchema" - end - - ## - # Create a fully-qualified Schema resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/schemas/{schema}` - # - # @param project [String] - # @param location [String] - # @param schema [String] - # - # @return [::String] - def schema_path project:, location:, schema: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/schemas/#{schema}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb deleted file mode 100644 index 286f54e74e9d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/document_ai/v1beta3/version" -require "google/cloud/document_ai/v1beta3/bindings_override" - -require "google/cloud/document_ai/v1beta3/document_service/credentials" -require "google/cloud/document_ai/v1beta3/document_service/paths" -require "google/cloud/document_ai/v1beta3/document_service/rest/operations" -require "google/cloud/document_ai/v1beta3/document_service/rest/client" - -module Google - module Cloud - module DocumentAI - module V1beta3 - ## - # Service to call Cloud DocumentAI to manage document collection (dataset). - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/document_ai/v1beta3/document_service/rest" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - module DocumentService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/document_ai/v1beta3/document_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb deleted file mode 100644 index efc1bf3c1911..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb +++ /dev/null @@ -1,878 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/documentai/v1beta3/document_service_pb" -require "google/cloud/document_ai/v1beta3/document_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - module Rest - ## - # REST client for the DocumentService service. - # - # Service to call Cloud DocumentAI to manage document collection (dataset). - # - class Client - include Paths - - # @private - attr_reader :document_service_stub - - ## - # Configure the DocumentService Client class. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentService clients - # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new DocumentService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DocumentService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.bindings_override = @config.bindings_override - end - - @document_service_stub = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Updates metadata associated with a dataset. - # - # @overload update_dataset(request, options = nil) - # Pass arguments to `update_dataset` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_dataset(dataset: nil, update_mask: nil) - # Pass arguments to `update_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::Google::Cloud::DocumentAI::V1beta3::Dataset, ::Hash] - # Required. The `name` field of the `Dataset` is used to identify the - # resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The update mask applies to the resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new - # - # # Call the update_dataset method. - # result = client.update_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_dataset.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.update_dataset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Import documents into a dataset. - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_documents(dataset: nil, batch_documents_import_configs: nil) - # Pass arguments to `import_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. The dataset resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @param batch_documents_import_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig, ::Hash>] - # Required. The Cloud Storage uri containing raw documents that must be - # imported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new - # - # # Call the import_documents method. - # result = client.import_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.import_documents request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns relevant fields present in the requested document. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_document(dataset: nil, document_id: nil, read_mask: nil, page_range: nil) - # Pass arguments to `get_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. The resource name of the dataset that the document belongs to . - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @param document_id [::Google::Cloud::DocumentAI::V1beta3::DocumentId, ::Hash] - # Required. Document identifier. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # If set, only fields listed here will be returned. Otherwise, all fields - # will be returned by default. - # @param page_range [::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange, ::Hash] - # List of pages for which the fields specified in the `read_mask` must - # be served. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse. - # p result - # - def get_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.get_document request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a set of documents. - # - # @overload batch_delete_documents(request, options = nil) - # Pass arguments to `batch_delete_documents` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_delete_documents(dataset: nil, dataset_documents: nil) - # Pass arguments to `batch_delete_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. The dataset resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @param dataset_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments, ::Hash] - # Required. Dataset documents input. If given `filter`, all documents - # satisfying the filter will be deleted. If given documentIds, a maximum of - # 50 documents can be deleted in a batch. The request will be rejected if - # more than 50 document_ids are provided. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new - # - # # Call the batch_delete_documents method. - # result = client.batch_delete_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_delete_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_delete_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_delete_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.batch_delete_documents request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the `DatasetSchema` of a `Dataset`. - # - # @overload get_dataset_schema(request, options = nil) - # Pass arguments to `get_dataset_schema` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_dataset_schema(name: nil, visible_fields_only: nil) - # Pass arguments to `get_dataset_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The dataset schema resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset/datasetSchema - # @param visible_fields_only [::Boolean] - # If set, only returns the visible fields of the schema. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new - # - # # Call the get_dataset_schema method. - # result = client.get_dataset_schema request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. - # p result - # - def get_dataset_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_dataset_schema.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_dataset_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_dataset_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.get_dataset_schema request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a `DatasetSchema`. - # - # @overload update_dataset_schema(request, options = nil) - # Pass arguments to `update_dataset_schema` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_dataset_schema(dataset_schema: nil, update_mask: nil) - # Pass arguments to `update_dataset_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset_schema [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema, ::Hash] - # Required. The name field of the `DatasetSchema` is used to identify the - # resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The update mask applies to the resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new - # - # # Call the update_dataset_schema method. - # result = client.update_dataset_schema request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. - # p result - # - def update_dataset_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_dataset_schema.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_dataset_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_dataset_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.update_dataset_schema request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DocumentService REST API. - # - # This class represents the configuration for DocumentService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_dataset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_dataset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_dataset.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the DocumentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `batch_delete_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_documents - ## - # RPC-specific configuration for `get_dataset_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset_schema - ## - # RPC-specific configuration for `update_dataset_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset_schema - - # @private - def initialize parent_rpcs = nil - update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset - @update_dataset = ::Gapic::Config::Method.new update_dataset_config - import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents - @import_documents = ::Gapic::Config::Method.new import_documents_config - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - batch_delete_documents_config = parent_rpcs.batch_delete_documents if parent_rpcs.respond_to? :batch_delete_documents - @batch_delete_documents = ::Gapic::Config::Method.new batch_delete_documents_config - get_dataset_schema_config = parent_rpcs.get_dataset_schema if parent_rpcs.respond_to? :get_dataset_schema - @get_dataset_schema = ::Gapic::Config::Method.new get_dataset_schema_config - update_dataset_schema_config = parent_rpcs.update_dataset_schema if parent_rpcs.respond_to? :update_dataset_schema - @update_dataset_schema = ::Gapic::Config::Method.new update_dataset_schema_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb deleted file mode 100644 index 0c7e1e4b6223..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb +++ /dev/null @@ -1,890 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - attr_reader :operations_stub - - ## - # Configuration for the DocumentService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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 - # 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 {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/uiv1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/uiv1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/uiv1beta3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb deleted file mode 100644 index fe5650433d5a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb +++ /dev/null @@ -1,406 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/documentai/v1beta3/document_service_pb" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - module Rest - ## - # REST service stub for the DocumentService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # Baseline implementation for the update_dataset REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the import_documents REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_documents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_document REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] - # A result object deserialized from the server's reply - def get_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the batch_delete_documents REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_delete_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_documents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_dataset_schema REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # A result object deserialized from the server's reply - def get_dataset_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_schema_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_dataset_schema REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # A result object deserialized from the server's reply - def update_dataset_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_schema_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the update_dataset REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta3/{dataset.name}", - body: "dataset", - matches: [ - ["dataset.name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_documents REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{dataset}:importDocuments", - body: "*", - matches: [ - ["dataset", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_document REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{dataset}:getDocument", - matches: [ - ["dataset", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_documents REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_delete_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta3/{dataset}:batchDeleteDocuments", - body: "*", - matches: [ - ["dataset", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_dataset_schema REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_dataset_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/datasetSchema/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_dataset_schema REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_dataset_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta3/{dataset_schema.name}", - body: "dataset_schema", - matches: [ - ["dataset_schema.name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/dataset/datasetSchema/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb deleted file mode 100644 index ee74e6b6996f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/document_ai/v1beta3/document_processor_service/rest" -require "google/cloud/document_ai/v1beta3/document_service/rest" -require "google/cloud/document_ai/v1beta3/bindings_override" -require "google/cloud/document_ai/v1beta3/version" - -module Google - module Cloud - module DocumentAI - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/document_ai/v1beta3/rest" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new - # - module V1beta3 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb deleted file mode 100644 index 9b6a7dd5f7d1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb deleted file mode 100644 index 8e86a0f1540c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/barcode.proto - -require 'google/protobuf' - - -descriptor_data = "\n-google/cloud/documentai/v1beta3/barcode.proto\x12\x1fgoogle.cloud.documentai.v1beta3\"B\n\x07\x42\x61rcode\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\x12\x14\n\x0cvalue_format\x18\x02 \x01(\t\x12\x11\n\traw_value\x18\x03 \x01(\tB\xe3\x01\n#com.google.cloud.documentai.v1beta3B\x0c\x42\x61rcodeProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Barcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Barcode").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb deleted file mode 100644 index 3813c4ba899f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/dataset_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/dataset.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/documentai/v1beta3/document_pb' -require 'google/cloud/documentai/v1beta3/document_io_pb' -require 'google/cloud/documentai/v1beta3/document_schema_pb' - - -descriptor_data = "\n-google/cloud/documentai/v1beta3/dataset.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\"\xe2\x07\n\x07\x44\x61taset\x12\\\n\x12gcs_managed_config\x18\x03 \x01(\x0b\x32\x39.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfigB\x03\xe0\x41\x01H\x00\x12j\n\x19\x64ocument_warehouse_config\x18\x05 \x01(\x0b\x32@.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfigB\x03\xe0\x41\x01H\x00\x12h\n\x18unmanaged_dataset_config\x18\x06 \x01(\x0b\x32?.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfigB\x03\xe0\x41\x01H\x00\x12\x66\n\x17spanner_indexing_config\x18\x04 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfigB\x03\xe0\x41\x01H\x01\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32..google.cloud.documentai.v1beta3.Dataset.StateB\x03\xe0\x41\x02\x1aW\n\x10GCSManagedConfig\x12\x43\n\ngcs_prefix\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.GcsPrefixB\x03\xe0\x41\x02\x1ar\n\x17\x44ocumentWarehouseConfig\x12\x17\n\ncollection\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12>\n\x06schema\x18\x02 \x01(\tB.\xe0\x41\x03\xfa\x41(\n&contentwarehouse.googleapis.com/Schema\x1a\x18\n\x16UnmanagedDatasetConfig\x1a\x17\n\x15SpannerIndexingConfig\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rUNINITIALIZED\x10\x01\x12\x10\n\x0cINITIALIZING\x10\x02\x12\x0f\n\x0bINITIALIZED\x10\x03:n\xea\x41k\n!documentai.googleapis.com/Dataset\x12\x46projects/{project}/locations/{location}/processors/{processor}/datasetB\x10\n\x0estorage_sourceB\x11\n\x0findexing_source\"\x86\x03\n\nDocumentId\x12^\n\x12gcs_managed_doc_id\x18\x01 \x01(\x0b\x32@.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentIdH\x00\x12[\n\x10unmanaged_doc_id\x18\x04 \x01(\x0b\x32?.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentIdH\x00\x12\x42\n\x0crevision_ref\x18\x03 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.RevisionRef\x1a\x43\n\x14GCSManagedDocumentId\x12\x14\n\x07gcs_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\tcw_doc_id\x18\x02 \x01(\tB\x02\x18\x01\x1a*\n\x13UnmanagedDocumentId\x12\x13\n\x06\x64oc_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x06\n\x04type\"\xf1\x01\n\rDatasetSchema\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x0f\x64ocument_schema\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchemaB\x03\xe0\x41\x01:\x82\x01\xea\x41\x7f\n\'documentai.googleapis.com/DatasetSchema\x12Tprojects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema\"\x87\x02\n\x15\x42\x61tchDatasetDocuments\x12o\n\x17individual_document_ids\x18\x01 \x01(\x0b\x32L.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIdsH\x00\x12\x10\n\x06\x66ilter\x18\x02 \x01(\tH\x00\x1a_\n\x15IndividualDocumentIds\x12\x46\n\x0c\x64ocument_ids\x18\x01 \x03(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentIdB\x03\xe0\x41\x02\x42\n\n\x08\x63riteriaB\xc8\x02\n#com.google.cloud.documentai.v1beta3B\x0c\x44\x61tasetProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3\xea\x41\x62\n&contentwarehouse.googleapis.com/Schema\x12\x38projects/{project}/locations/{location}/schemas/{schema}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.documentai.v1beta3.GcsPrefix", "google/cloud/documentai/v1beta3/document_io.proto"], - ["google.cloud.documentai.v1beta3.RevisionRef", "google/cloud/documentai/v1beta3/document.proto"], - ["google.cloud.documentai.v1beta3.DocumentSchema", "google/cloud/documentai/v1beta3/document_schema.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset").msgclass - Dataset::GCSManagedConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig").msgclass - Dataset::DocumentWarehouseConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig").msgclass - Dataset::UnmanagedDatasetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig").msgclass - Dataset::SpannerIndexingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig").msgclass - Dataset::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Dataset.State").enummodule - DocumentId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentId").msgclass - DocumentId::GCSManagedDocumentId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId").msgclass - DocumentId::UnmanagedDocumentId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId").msgclass - DatasetSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DatasetSchema").msgclass - BatchDatasetDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDatasetDocuments").msgclass - BatchDatasetDocuments::IndividualDocumentIds = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb deleted file mode 100644 index ca1ad4e5ff7a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document_io.proto - -require 'google/protobuf' - -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n1google/cloud/documentai/v1beta3/document_io.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a google/protobuf/field_mask.proto\"1\n\x0bRawDocument\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\"1\n\x0bGcsDocument\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"O\n\x0cGcsDocuments\x12?\n\tdocuments\x18\x01 \x03(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocument\"#\n\tGcsPrefix\x12\x16\n\x0egcs_uri_prefix\x18\x01 \x01(\t\"\xaf\x01\n\x19\x42\x61tchDocumentsInputConfig\x12@\n\ngcs_prefix\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.GcsPrefixH\x00\x12\x46\n\rgcs_documents\x18\x02 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.GcsDocumentsH\x00\x42\x08\n\x06source\"\x8f\x03\n\x14\x44ocumentOutputConfig\x12\x62\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\x45.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfigH\x00\x1a\x83\x02\n\x0fGcsOutputConfig\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12m\n\x0fsharding_config\x18\x03 \x01(\x0b\x32T.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig\x1a@\n\x0eShardingConfig\x12\x17\n\x0fpages_per_shard\x18\x01 \x01(\x05\x12\x15\n\rpages_overlap\x18\x02 \x01(\x05\x42\r\n\x0b\x64\x65stination\"\xfc\x03\n\tOcrConfig\x12?\n\x05hints\x18\x02 \x01(\x0b\x32\x30.google.cloud.documentai.v1beta3.OcrConfig.Hints\x12!\n\x19\x65nable_native_pdf_parsing\x18\x03 \x01(\x08\x12#\n\x1b\x65nable_image_quality_scores\x18\x04 \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x05 \x03(\t\x12\x15\n\renable_symbol\x18\x06 \x01(\x08\x12\x1e\n\x12\x63ompute_style_info\x18\x08 \x01(\x08\x42\x02\x18\x01\x12)\n!disable_character_boxes_detection\x18\n \x01(\x08\x12T\n\x10premium_features\x18\x0b \x01(\x0b\x32:.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures\x1a\x1f\n\x05Hints\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\t\x1ao\n\x0fPremiumFeatures\x12\'\n\x1f\x65nable_selection_mark_detection\x18\x03 \x01(\x08\x12\x1a\n\x12\x63ompute_style_info\x18\x04 \x01(\x08\x12\x17\n\x0f\x65nable_math_ocr\x18\x05 \x01(\x08\x42\xe6\x01\n#com.google.cloud.documentai.v1beta3B\x0f\x44ocumentIoProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - RawDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RawDocument").msgclass - GcsDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocument").msgclass - GcsDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocuments").msgclass - GcsPrefix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsPrefix").msgclass - BatchDocumentsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDocumentsInputConfig").msgclass - DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig").msgclass - DocumentOutputConfig::GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig").msgclass - DocumentOutputConfig::GcsOutputConfig::ShardingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig").msgclass - OcrConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig").msgclass - OcrConfig::Hints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig.Hints").msgclass - OcrConfig::PremiumFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb deleted file mode 100644 index 3ff62752bf2d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/documentai/v1beta3/barcode_pb' -require 'google/cloud/documentai/v1beta3/geometry_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/color_pb' -require 'google/type/date_pb' -require 'google/type/datetime_pb' -require 'google/type/money_pb' -require 'google/type/postal_address_pb' - - -descriptor_data = "\n.google/cloud/documentai/v1beta3/document.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a-google/cloud/documentai/v1beta3/barcode.proto\x1a.google/cloud/documentai/v1beta3/geometry.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x16google/type/date.proto\x1a\x1agoogle/type/datetime.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"\x88H\n\x08\x44ocument\x12\x12\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x16\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01H\x00\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x11\n\x04text\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12H\n\x0btext_styles\x18\x05 \x03(\x0b\x32/.google.cloud.documentai.v1beta3.Document.StyleB\x02\x18\x01\x12=\n\x05pages\x18\x06 \x03(\x0b\x32..google.cloud.documentai.v1beta3.Document.Page\x12\x42\n\x08\x65ntities\x18\x07 \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.Entity\x12R\n\x10\x65ntity_relations\x18\x08 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.EntityRelation\x12J\n\x0ctext_changes\x18\x0e \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextChange\x12G\n\nshard_info\x18\t \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.ShardInfo\x12!\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\trevisions\x18\r \x03(\x0b\x32\x32.google.cloud.documentai.v1beta3.Document.Revision\x1aJ\n\tShardInfo\x12\x13\n\x0bshard_index\x18\x01 \x01(\x03\x12\x13\n\x0bshard_count\x18\x02 \x01(\x03\x12\x13\n\x0btext_offset\x18\x03 \x01(\x03\x1a\xef\x02\n\x05Style\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12!\n\x05\x63olor\x18\x02 \x01(\x0b\x32\x12.google.type.Color\x12,\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\x0b\x32\x12.google.type.Color\x12\x13\n\x0b\x66ont_weight\x18\x04 \x01(\t\x12\x12\n\ntext_style\x18\x05 \x01(\t\x12\x17\n\x0ftext_decoration\x18\x06 \x01(\t\x12K\n\tfont_size\x18\x07 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Style.FontSize\x12\x13\n\x0b\x66ont_family\x18\x08 \x01(\t\x1a&\n\x08\x46ontSize\x12\x0c\n\x04size\x18\x01 \x01(\x02\x12\x0c\n\x04unit\x18\x02 \x01(\t\x1a\xd0+\n\x04Page\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12\x43\n\x05image\x18\r \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Image\x12I\n\ntransforms\x18\x0e \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Matrix\x12K\n\tdimension\x18\x02 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Dimension\x12\x45\n\x06layout\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x44\n\x06\x62locks\x18\x05 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Block\x12L\n\nparagraphs\x18\x06 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Paragraph\x12\x42\n\x05lines\x18\x07 \x03(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.Page.Line\x12\x44\n\x06tokens\x18\x08 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Token\x12U\n\x0fvisual_elements\x18\t \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.Page.VisualElement\x12\x44\n\x06tables\x18\n \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Table\x12M\n\x0b\x66orm_fields\x18\x0b \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.FormField\x12\x46\n\x07symbols\x18\x0c \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Symbol\x12Y\n\x11\x64\x65tected_barcodes\x18\x0f \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode\x12_\n\x14image_quality_scores\x18\x11 \x01(\x0b\x32\x41.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores\x12L\n\nprovenance\x18\x10 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\x38\n\tDimension\x12\r\n\x05width\x18\x01 \x01(\x02\x12\x0e\n\x06height\x18\x02 \x01(\x02\x12\x0c\n\x04unit\x18\x03 \x01(\t\x1aJ\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\r\n\x05width\x18\x03 \x01(\x05\x12\x0e\n\x06height\x18\x04 \x01(\x05\x1a@\n\x06Matrix\x12\x0c\n\x04rows\x18\x01 \x01(\x05\x12\x0c\n\x04\x63ols\x18\x02 \x01(\x05\x12\x0c\n\x04type\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x1a\xec\x02\n\x06Layout\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x44\n\rbounding_poly\x18\x03 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPoly\x12V\n\x0borientation\x18\x04 \x01(\x0e\x32\x41.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation\"e\n\x0bOrientation\x12\x1b\n\x17ORIENTATION_UNSPECIFIED\x10\x00\x12\x0b\n\x07PAGE_UP\x10\x01\x12\x0e\n\nPAGE_RIGHT\x10\x02\x12\r\n\tPAGE_DOWN\x10\x03\x12\r\n\tPAGE_LEFT\x10\x04\x1a\xf9\x01\n\x05\x42lock\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\xfd\x01\n\tParagraph\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\xf8\x01\n\x04Line\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1a\xbc\x07\n\x05Token\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12Z\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x04 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x12R\n\nstyle_info\x18\x05 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo\x1a\xab\x01\n\rDetectedBreak\x12U\n\x04type\x18\x01 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type\"C\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nWIDE_SPACE\x10\x02\x12\n\n\x06HYPHEN\x10\x03\x1a\xe2\x02\n\tStyleInfo\x12\x11\n\tfont_size\x18\x01 \x01(\x05\x12\x17\n\x0fpixel_font_size\x18\x02 \x01(\x01\x12\x16\n\x0eletter_spacing\x18\x03 \x01(\x01\x12\x11\n\tfont_type\x18\x04 \x01(\t\x12\x0c\n\x04\x62old\x18\x05 \x01(\x08\x12\x0e\n\x06italic\x18\x06 \x01(\x08\x12\x12\n\nunderlined\x18\x07 \x01(\x08\x12\x11\n\tstrikeout\x18\x08 \x01(\x08\x12\x11\n\tsubscript\x18\t \x01(\x08\x12\x13\n\x0bsuperscript\x18\n \x01(\x08\x12\x11\n\tsmallcaps\x18\x0b \x01(\x08\x12\x13\n\x0b\x66ont_weight\x18\x0c \x01(\x05\x12\x13\n\x0bhandwritten\x18\r \x01(\x08\x12&\n\ntext_color\x18\x0e \x01(\x0b\x32\x12.google.type.Color\x12,\n\x10\x62\x61\x63kground_color\x18\x0f \x01(\x0b\x32\x12.google.type.Color\x1a\xac\x01\n\x06Symbol\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xc1\x01\n\rVisualElement\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x0c\n\x04type\x18\x02 \x01(\t\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xd0\x05\n\x05Table\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12R\n\x0bheader_rows\x18\x02 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12P\n\tbody_rows\x18\x03 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12L\n\nprovenance\x18\x05 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x1aY\n\x08TableRow\x12M\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell\x1a\xd3\x01\n\tTableCell\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x10\n\x08row_span\x18\x02 \x01(\x05\x12\x10\n\x08\x63ol_span\x18\x03 \x01(\x05\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xff\x03\n\tFormField\x12I\n\nfield_name\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12J\n\x0b\x66ield_value\x18\x02 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12`\n\x17name_detected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x61\n\x18value_detected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x12\n\nvalue_type\x18\x05 \x01(\t\x12\x1a\n\x12\x63orrected_key_text\x18\x06 \x01(\t\x12\x1c\n\x14\x63orrected_value_text\x18\x07 \x01(\t\x12H\n\nprovenance\x18\x08 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\x93\x01\n\x0f\x44\x65tectedBarcode\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x39\n\x07\x62\x61rcode\x18\x02 \x01(\x0b\x32(.google.cloud.documentai.v1beta3.Barcode\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xcb\x01\n\x12ImageQualityScores\x12\x15\n\rquality_score\x18\x01 \x01(\x02\x12j\n\x10\x64\x65tected_defects\x18\x02 \x03(\x0b\x32P.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect\x1a\x32\n\x0e\x44\x65tectedDefect\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xe9\x06\n\x06\x45ntity\x12N\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchorB\x03\xe0\x41\x01\x12\x11\n\x04type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cmention_text\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nmention_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nconfidence\x18\x05 \x01(\x02\x42\x03\xe0\x41\x01\x12N\n\x0bpage_anchor\x18\x06 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.PageAnchorB\x03\xe0\x41\x01\x12\x0f\n\x02id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12_\n\x10normalized_value\x18\t \x01(\x0b\x32@.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValueB\x03\xe0\x41\x01\x12I\n\nproperties\x18\n \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.EntityB\x03\xe0\x41\x01\x12M\n\nprovenance\x18\x0b \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x03\xe0\x41\x01\x12\x15\n\x08redacted\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a\xbb\x02\n\x0fNormalizedValue\x12)\n\x0bmoney_value\x18\x02 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12\'\n\ndate_value\x18\x03 \x01(\x0b\x32\x11.google.type.DateH\x00\x12/\n\x0e\x64\x61tetime_value\x18\x04 \x01(\x0b\x32\x15.google.type.DateTimeH\x00\x12\x33\n\raddress_value\x18\x05 \x01(\x0b\x32\x1a.google.type.PostalAddressH\x00\x12\x17\n\rboolean_value\x18\x06 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x07 \x01(\x05H\x00\x12\x15\n\x0b\x66loat_value\x18\x08 \x01(\x02H\x00\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01\x42\x12\n\x10structured_value\x1aI\n\x0e\x45ntityRelation\x12\x12\n\nsubject_id\x18\x01 \x01(\t\x12\x11\n\tobject_id\x18\x02 \x01(\t\x12\x10\n\x08relation\x18\x03 \x01(\t\x1a\xad\x01\n\nTextAnchor\x12W\n\rtext_segments\x18\x01 \x03(\x0b\x32@.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a\x35\n\x0bTextSegment\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x1a\xe7\x03\n\nPageAnchor\x12O\n\tpage_refs\x18\x01 \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef\x1a\x87\x03\n\x07PageRef\x12\x11\n\x04page\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x61\n\x0blayout_type\x18\x02 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutTypeB\x03\xe0\x41\x01\x12\x18\n\tlayout_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12I\n\rbounding_poly\x18\x04 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPolyB\x03\xe0\x41\x01\x12\x17\n\nconfidence\x18\x05 \x01(\x02\x42\x03\xe0\x41\x01\"\x87\x01\n\nLayoutType\x12\x1b\n\x17LAYOUT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x42LOCK\x10\x01\x12\r\n\tPARAGRAPH\x10\x02\x12\x08\n\x04LINE\x10\x03\x12\t\n\x05TOKEN\x10\x04\x12\x12\n\x0eVISUAL_ELEMENT\x10\x05\x12\t\n\x05TABLE\x10\x06\x12\x0e\n\nFORM_FIELD\x10\x07\x1a\xb2\x03\n\nProvenance\x12\x14\n\x08revision\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x0e\n\x02id\x18\x02 \x01(\x05\x42\x02\x18\x01\x12L\n\x07parents\x18\x03 \x03(\x0b\x32;.google.cloud.documentai.v1beta3.Document.Provenance.Parent\x12P\n\x04type\x18\x04 \x01(\x0e\x32\x42.google.cloud.documentai.v1beta3.Document.Provenance.OperationType\x1a\x39\n\x06Parent\x12\x10\n\x08revision\x18\x01 \x01(\x05\x12\r\n\x05index\x18\x03 \x01(\x05\x12\x0e\n\x02id\x18\x02 \x01(\x05\x42\x02\x18\x01\"\xa2\x01\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\n\n\x06UPDATE\x10\x07\x12\x0b\n\x07REPLACE\x10\x03\x12\x16\n\x0e\x45VAL_REQUESTED\x10\x04\x1a\x02\x08\x01\x12\x15\n\rEVAL_APPROVED\x10\x05\x1a\x02\x08\x01\x12\x14\n\x0c\x45VAL_SKIPPED\x10\x06\x1a\x02\x08\x01\x1a\xaa\x02\n\x08Revision\x12\x0f\n\x05\x61gent\x18\x04 \x01(\tH\x00\x12\x13\n\tprocessor\x18\x05 \x01(\tH\x00\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\x06parent\x18\x02 \x03(\x05\x42\x02\x18\x01\x12\x12\n\nparent_ids\x18\x07 \x03(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12T\n\x0chuman_review\x18\x06 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Revision.HumanReview\x1a\x33\n\x0bHumanReview\x12\r\n\x05state\x18\x01 \x01(\t\x12\x15\n\rstate_message\x18\x02 \x01(\tB\x08\n\x06source\x1a\xbb\x01\n\nTextChange\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x14\n\x0c\x63hanged_text\x18\x02 \x01(\t\x12L\n\nprovenance\x18\x03 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x02\x18\x01\x42\x08\n\x06source\"\x9b\x02\n\x0bRevisionRef\x12R\n\rrevision_case\x18\x01 \x01(\x0e\x32\x39.google.cloud.documentai.v1beta3.RevisionRef.RevisionCaseH\x00\x12\x15\n\x0brevision_id\x18\x02 \x01(\tH\x00\x12\"\n\x18latest_processor_version\x18\x03 \x01(\tH\x00\"s\n\x0cRevisionCase\x12\x1d\n\x19REVISION_CASE_UNSPECIFIED\x10\x00\x12\x17\n\x13LATEST_HUMAN_REVIEW\x10\x01\x12\x14\n\x10LATEST_TIMESTAMP\x10\x02\x12\x15\n\x11\x42\x41SE_OCR_REVISION\x10\x03\x42\x08\n\x06sourceB\xe4\x01\n#com.google.cloud.documentai.v1beta3B\rDocumentProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.type.Color", "google/type/color.proto"], - ["google.cloud.documentai.v1beta3.BoundingPoly", "google/cloud/documentai/v1beta3/geometry.proto"], - ["google.cloud.documentai.v1beta3.Barcode", "google/cloud/documentai/v1beta3/barcode.proto"], - ["google.type.Money", "google/type/money.proto"], - ["google.type.Date", "google/type/date.proto"], - ["google.type.DateTime", "google/type/datetime.proto"], - ["google.type.PostalAddress", "google/type/postal_address.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document").msgclass - Document::ShardInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.ShardInfo").msgclass - Document::Style = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style").msgclass - Document::Style::FontSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style.FontSize").msgclass - Document::Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page").msgclass - Document::Page::Dimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Dimension").msgclass - Document::Page::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Image").msgclass - Document::Page::Matrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Matrix").msgclass - Document::Page::Layout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout").msgclass - Document::Page::Layout::Orientation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation").enummodule - Document::Page::Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Block").msgclass - Document::Page::Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Paragraph").msgclass - Document::Page::Line = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Line").msgclass - Document::Page::Token = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token").msgclass - Document::Page::Token::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak").msgclass - Document::Page::Token::DetectedBreak::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type").enummodule - Document::Page::Token::StyleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo").msgclass - Document::Page::Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Symbol").msgclass - Document::Page::VisualElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.VisualElement").msgclass - Document::Page::Table = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table").msgclass - Document::Page::Table::TableRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableRow").msgclass - Document::Page::Table::TableCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableCell").msgclass - Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.FormField").msgclass - Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode").msgclass - Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage").msgclass - Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores").msgclass - Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect").msgclass - Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity").msgclass - Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue").msgclass - Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.EntityRelation").msgclass - Document::TextAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor").msgclass - Document::TextAnchor::TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment").msgclass - Document::PageAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor").msgclass - Document::PageAnchor::PageRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef").msgclass - Document::PageAnchor::PageRef::LayoutType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType").enummodule - Document::Provenance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance").msgclass - Document::Provenance::Parent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.Parent").msgclass - Document::Provenance::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.OperationType").enummodule - Document::Revision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision").msgclass - Document::Revision::HumanReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision.HumanReview").msgclass - Document::TextChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextChange").msgclass - RevisionRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RevisionRef").msgclass - RevisionRef::RevisionCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RevisionRef.RevisionCase").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb deleted file mode 100644 index aa0602fed2ee..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document_processor_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/documentai/v1beta3/document_pb' -require 'google/cloud/documentai/v1beta3/document_io_pb' -require 'google/cloud/documentai/v1beta3/document_schema_pb' -require 'google/cloud/documentai/v1beta3/evaluation_pb' -require 'google/cloud/documentai/v1beta3/operation_metadata_pb' -require 'google/cloud/documentai/v1beta3/processor_pb' -require 'google/cloud/documentai/v1beta3/processor_type_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n@google/cloud/documentai/v1beta3/document_processor_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\x1a\x30google/cloud/documentai/v1beta3/evaluation.proto\x1a\x38google/cloud/documentai/v1beta3/operation_metadata.proto\x1a/google/cloud/documentai/v1beta3/processor.proto\x1a\x34google/cloud/documentai/v1beta3/processor_type.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa2\x02\n\x0eProcessOptions\x12j\n\x18individual_page_selector\x18\x05 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelectorH\x00\x12\x14\n\nfrom_start\x18\x06 \x01(\x05H\x00\x12\x12\n\x08\x66rom_end\x18\x07 \x01(\x05H\x00\x12>\n\nocr_config\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.OcrConfig\x1a,\n\x16IndividualPageSelector\x12\x12\n\x05pages\x18\x01 \x03(\x05\x42\x03\xe0\x41\x01\x42\x0c\n\npage_range\"\xdb\x03\n\x0eProcessRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12\x44\n\x0craw_document\x18\x05 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.RawDocumentH\x00\x12\x44\n\x0cgcs_document\x18\x08 \x01(\x0b\x32,.google.cloud.documentai.v1beta3.GcsDocumentH\x00\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08\x12.\n\nfield_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptionsB\x08\n\x06source\"\xf3\x01\n\x11HumanReviewStatus\x12G\n\x05state\x18\x01 \x01(\x0e\x32\x38.google.cloud.documentai.v1beta3.HumanReviewStatus.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12\x1e\n\x16human_review_operation\x18\x03 \x01(\t\"^\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SKIPPED\x10\x01\x12\x15\n\x11VALIDATION_PASSED\x10\x02\x12\x0f\n\x0bIN_PROGRESS\x10\x03\x12\t\n\x05\x45RROR\x10\x04\"\xc3\x01\n\x0fProcessResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\"\n\x16human_review_operation\x18\x02 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x03 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"\xf5\x04\n\x13\x42\x61tchProcessRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12`\n\rinput_configs\x18\x02 \x03(\x0b\x32\x45.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfigB\x02\x18\x01\x12\x61\n\routput_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfigB\x02\x18\x01\x12S\n\x0finput_documents\x18\x05 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12U\n\x16\x64ocument_output_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.DocumentOutputConfig\x12\x19\n\x11skip_human_review\x18\x04 \x01(\x08\x12H\n\x0fprocess_options\x18\x07 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.ProcessOptions\x1a=\n\x10\x42\x61tchInputConfig\x12\x12\n\ngcs_source\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t:\x02\x18\x01\x1a\x30\n\x11\x42\x61tchOutputConfig\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t:\x02\x18\x01\"\x16\n\x14\x42\x61tchProcessResponse\"\xb2\x05\n\x14\x42\x61tchProcessMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.documentai.v1beta3.BatchProcessMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32M.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus\x1a\xec\x01\n\x17IndividualProcessStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16output_gcs_destination\x18\x03 \x01(\t\x12\"\n\x16human_review_operation\x18\x04 \x01(\tB\x02\x18\x01\x12O\n\x13human_review_status\x18\x05 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.HumanReviewStatus\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07WAITING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\"]\n\x1a\x46\x65tchProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\"f\n\x1b\x46\x65tchProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\"\x83\x01\n\x19ListProcessorTypesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'documentai.googleapis.com/ProcessorType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"~\n\x1aListProcessorTypesResponse\x12G\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32..google.cloud.documentai.v1beta3.ProcessorType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x15ListProcessorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x16ListProcessorsResponse\x12>\n\nprocessors\x18\x01 \x03(\x0b\x32*.google.cloud.documentai.v1beta3.Processor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x17GetProcessorTypeRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'documentai.googleapis.com/ProcessorType\"P\n\x13GetProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"^\n\x1aGetProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x89\x01\n\x1cListProcessorVersionsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x87\x01\n\x1dListProcessorVersionsResponse\x12M\n\x12processor_versions\x18\x01 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1d\x44\x65leteProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1e\x44\x65leteProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"a\n\x1d\x44\x65ployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\" \n\x1e\x44\x65ployProcessorVersionResponse\"s\n\x1e\x44\x65ployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"c\n\x1fUndeployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\"\n UndeployProcessorVersionResponse\"u\n UndeployProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\x99\x01\n\x16\x43reateProcessorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12\x42\n\tprocessor\x18\x02 \x01(\x0b\x32*.google.cloud.documentai.v1beta3.ProcessorB\x03\xe0\x41\x02\"S\n\x16\x44\x65leteProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"l\n\x17\x44\x65leteProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"S\n\x16\x45nableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x19\n\x17\x45nableProcessorResponse\"l\n\x17\x45nableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"T\n\x17\x44isableProcessorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\"\x1a\n\x18\x44isableProcessorResponse\"m\n\x18\x44isableProcessorMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xba\x01\n!SetDefaultProcessorVersionRequest\x12>\n\tprocessor\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12U\n\x19\x64\x65\x66\x61ult_processor_version\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"$\n\"SetDefaultProcessorVersionResponse\"w\n\"SetDefaultProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xe3\x07\n\x1cTrainProcessorVersionRequest\x12\x8b\x01\n\"custom_document_extraction_options\x18\x05 \x01(\x0b\x32].google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptionsH\x00\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12Q\n\x11processor_version\x18\x02 \x01(\x0b\x32\x31.google.cloud.documentai.v1beta3.ProcessorVersionB\x03\xe0\x41\x02\x12M\n\x0f\x64ocument_schema\x18\n \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchemaB\x03\xe0\x41\x01\x12`\n\ninput_data\x18\x04 \x01(\x0b\x32G.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputDataB\x03\xe0\x41\x01\x12#\n\x16\x62\x61se_processor_version\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1a\xb7\x01\n\tInputData\x12V\n\x12training_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x12R\n\x0etest_documents\x18\x04 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x1a\x81\x02\n\x1f\x43ustomDocumentExtractionOptions\x12\x85\x01\n\x0ftraining_method\x18\x03 \x01(\x0e\x32l.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod\"V\n\x0eTrainingMethod\x12\x1f\n\x1bTRAINING_METHOD_UNSPECIFIED\x10\x00\x12\x0f\n\x0bMODEL_BASED\x10\x01\x12\x12\n\x0eTEMPLATE_BASED\x10\x02\x42\x11\n\x0fprocessor_flags\":\n\x1dTrainProcessorVersionResponse\x12\x19\n\x11processor_version\x18\x01 \x01(\t\"\x86\x04\n\x1dTrainProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12u\n\x1btraining_dataset_validation\x18\x02 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x12q\n\x17test_dataset_validation\x18\x03 \x01(\x0b\x32P.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation\x1a\xa7\x01\n\x11\x44\x61tasetValidation\x12\x1c\n\x14\x64ocument_error_count\x18\x03 \x01(\x05\x12\x1b\n\x13\x64\x61taset_error_count\x18\x04 \x01(\x05\x12+\n\x0f\x64ocument_errors\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12*\n\x0e\x64\x61taset_errors\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\xde\x03\n\x15ReviewDocumentRequest\x12\x44\n\x0finline_document\x18\x04 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentH\x00\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12?\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.DocumentB\x02\x18\x01\x12 \n\x18\x65nable_schema_validation\x18\x03 \x01(\x08\x12Q\n\x08priority\x18\x05 \x01(\x0e\x32?.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority\x12H\n\x0f\x64ocument_schema\x18\x06 \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchema\"#\n\x08Priority\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\n\n\x06URGENT\x10\x01\x42\x08\n\x06source\"\xd6\x01\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t\x12L\n\x05state\x18\x02 \x01(\x0e\x32=.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State\x12\x18\n\x10rejection_reason\x18\x03 \x01(\t\";\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REJECTED\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\"\xc0\x03\n\x1fReviewDocumentOperationMetadata\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12Q\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12\x13\n\x0bquestion_id\x18\x06 \x01(\t\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xcf\x01\n\x1f\x45valuateProcessorVersionRequest\x12M\n\x11processor_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12]\n\x14\x65valuation_documents\x18\x03 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfigB\x03\xe0\x41\x01\"u\n EvaluateProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"6\n EvaluateProcessorVersionResponse\x12\x12\n\nevaluation\x18\x02 \x01(\t\"R\n\x14GetEvaluationRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$documentai.googleapis.com/Evaluation\"\x83\x01\n\x16ListEvaluationsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListEvaluationsResponse\x12@\n\x0b\x65valuations\x18\x01 \x03(\x0b\x32+.google.cloud.documentai.v1beta3.Evaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x03\n\x1dImportProcessorVersionRequest\x12S\n\x18processor_version_source\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersionH\x00\x12\x8a\x01\n!external_processor_version_source\x18\x03 \x01(\x0b\x32].google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSourceH\x00\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*documentai.googleapis.com/ProcessorVersion\x1a_\n\x1e\x45xternalProcessorVersionSource\x12\x1e\n\x11processor_version\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1d\n\x10service_endpoint\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06source\"l\n\x1eImportProcessorVersionResponse\x12J\n\x11processor_version\x18\x01 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"s\n\x1eImportProcessorVersionMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata2\xeb.\n\x18\x44ocumentProcessorService\x12\x9b\x02\n\x0fProcessDocument\x12/.google.cloud.documentai.v1beta3.ProcessRequest\x1a\x30.google.cloud.documentai.v1beta3.ProcessResponse\"\xa4\x01\x82\xd3\xe4\x93\x02\x96\x01\";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\x01*ZT\"O/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process:\x01*\xda\x41\x04name\x12\xcc\x02\n\x15\x42\x61tchProcessDocuments\x12\x34.google.cloud.documentai.v1beta3.BatchProcessRequest\x1a\x1d.google.longrunning.Operation\"\xdd\x01\x82\xd3\xe4\x93\x02\xa0\x01\"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*ZY\"T/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess:\x01*\xda\x41\x04name\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\x12\xdf\x01\n\x13\x46\x65tchProcessorTypes\x12;.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest\x1a<.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse\"M\x82\xd3\xe4\x93\x02>\x12\n\x1dTrainProcessorVersionResponse\x12\x1dTrainProcessorVersionMetadata\x12\xdd\x01\n\x13GetProcessorVersion\x12;.google.cloud.documentai.v1beta3.GetProcessorVersionRequest\x1a\x31.google.cloud.documentai.v1beta3.ProcessorVersion\"V\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\x12\xf0\x01\n\x15ListProcessorVersions\x12=.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest\x1a>.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse\"X\x82\xd3\xe4\x93\x02I\x12G/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions\xda\x41\x06parent\x12\x8a\x02\n\x16\x44\x65leteProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\x82\xd3\xe4\x93\x02I*G/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}\xda\x41\x04name\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteProcessorVersionMetadata\x12\x9d\x02\n\x16\x44\x65ployProcessorVersion\x12>.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\x82\xd3\xe4\x93\x02S\"N/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy:\x01*\xda\x41\x04name\xca\x41@\n\x1e\x44\x65ployProcessorVersionResponse\x12\x1e\x44\x65ployProcessorVersionMetadata\x12\xa7\x02\n\x18UndeployProcessorVersion\x12@.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02U\"P/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy:\x01*\xda\x41\x04name\xca\x41\x44\n UndeployProcessorVersionResponse\x12 UndeployProcessorVersionMetadata\x12\xd1\x01\n\x0f\x43reateProcessor\x12\x37.google.cloud.documentai.v1beta3.CreateProcessorRequest\x1a*.google.cloud.documentai.v1beta3.Processor\"Y\x82\xd3\xe4\x93\x02@\"3/v1beta3/{parent=projects/*/locations/*}/processors:\tprocessor\xda\x41\x10parent,processor\x12\xe0\x01\n\x0f\x44\x65leteProcessor\x12\x37.google.cloud.documentai.v1beta3.DeleteProcessorRequest\x1a\x1d.google.longrunning.Operation\"u\x82\xd3\xe4\x93\x02\x35*3/v1beta3/{name=projects/*/locations/*/processors/*}\xda\x41\x04name\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteProcessorMetadata\x12\xe5\x01\n\x0f\x45nableProcessor\x12\x37.google.cloud.documentai.v1beta3.EnableProcessorRequest\x1a\x1d.google.longrunning.Operation\"z\x82\xd3\xe4\x93\x02?\":/v1beta3/{name=projects/*/locations/*/processors/*}:enable:\x01*\xca\x41\x32\n\x17\x45nableProcessorResponse\x12\x17\x45nableProcessorMetadata\x12\xea\x01\n\x10\x44isableProcessor\x12\x38.google.cloud.documentai.v1beta3.DisableProcessorRequest\x1a\x1d.google.longrunning.Operation\"}\x82\xd3\xe4\x93\x02@\";/v1beta3/{name=projects/*/locations/*/processors/*}:disable:\x01*\xca\x41\x34\n\x18\x44isableProcessorResponse\x12\x18\x44isableProcessorMetadata\x12\xab\x02\n\x1aSetDefaultProcessorVersion\x12\x42.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\x82\xd3\xe4\x93\x02X\"S/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion:\x01*\xca\x41H\n\"SetDefaultProcessorVersionResponse\x12\"SetDefaultProcessorVersionMetadata\x12\xaa\x02\n\x0eReviewDocument\x12\x36.google.cloud.documentai.v1beta3.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xc0\x01\x82\xd3\xe4\x93\x02h\"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\xda\x41\x13human_review_config\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\x12\xd1\x02\n\x18\x45valuateProcessorVersion\x12@.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\x82\xd3\xe4\x93\x02r\"m/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion:\x01*\xda\x41\x11processor_version\xca\x41\x44\n EvaluateProcessorVersionResponse\x12 EvaluateProcessorVersionMetadata\x12\xd9\x01\n\rGetEvaluation\x12\x35.google.cloud.documentai.v1beta3.GetEvaluationRequest\x1a+.google.cloud.documentai.v1beta3.Evaluation\"d\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}\xda\x41\x04name\x12\xec\x01\n\x0fListEvaluations\x12\x37.google.cloud.documentai.v1beta3.ListEvaluationsRequest\x1a\x38.google.cloud.documentai.v1beta3.ListEvaluationsResponse\"f\x82\xd3\xe4\x93\x02W\x12U/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations\xda\x41\x06parent\x12\xaf\x02\n\x16ImportProcessorVersion\x12>.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\x82\xd3\xe4\x93\x02\x63\"^/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion:\x01*\xda\x41\x06parent\xca\x41@\n\x1eImportProcessorVersionResponse\x12\x1eImportProcessorVersionMetadata\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc3\x03\n#com.google.cloud.documentai.v1beta3B\x1a\x44ocumentAiProcessorServiceP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3\xea\x41\x7f\n+documentai.googleapis.com/HumanReviewConfig\x12Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfig\xea\x41M\n\"documentai.googleapis.com/Location\x12\'projects/{project}/locations/{location}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.documentai.v1beta3.OcrConfig", "google/cloud/documentai/v1beta3/document_io.proto"], - ["google.cloud.documentai.v1beta3.Document", "google/cloud/documentai/v1beta3/document.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.cloud.documentai.v1beta3.ProcessorType", "google/cloud/documentai/v1beta3/processor_type.proto"], - ["google.cloud.documentai.v1beta3.Processor", "google/cloud/documentai/v1beta3/processor.proto"], - ["google.cloud.documentai.v1beta3.CommonOperationMetadata", "google/cloud/documentai/v1beta3/operation_metadata.proto"], - ["google.cloud.documentai.v1beta3.DocumentSchema", "google/cloud/documentai/v1beta3/document_schema.proto"], - ["google.cloud.documentai.v1beta3.Evaluation", "google/cloud/documentai/v1beta3/evaluation.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - ProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions").msgclass - ProcessOptions::IndividualPageSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector").msgclass - ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessRequest").msgclass - HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus").msgclass - HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus.State").enummodule - ProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessResponse").msgclass - BatchProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest").msgclass - BatchProcessRequest::BatchInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig").msgclass - BatchProcessRequest::BatchOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig").msgclass - BatchProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessResponse").msgclass - BatchProcessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata").msgclass - BatchProcessMetadata::IndividualProcessStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus").msgclass - BatchProcessMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.State").enummodule - FetchProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesRequest").msgclass - FetchProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesResponse").msgclass - ListProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesRequest").msgclass - ListProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesResponse").msgclass - ListProcessorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsRequest").msgclass - ListProcessorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsResponse").msgclass - GetProcessorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorTypeRequest").msgclass - GetProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorRequest").msgclass - GetProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorVersionRequest").msgclass - ListProcessorVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsRequest").msgclass - ListProcessorVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsResponse").msgclass - DeleteProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest").msgclass - DeleteProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata").msgclass - DeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionRequest").msgclass - DeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionResponse").msgclass - DeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata").msgclass - UndeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest").msgclass - UndeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse").msgclass - UndeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata").msgclass - CreateProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CreateProcessorRequest").msgclass - DeleteProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorRequest").msgclass - DeleteProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorMetadata").msgclass - EnableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorRequest").msgclass - EnableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorResponse").msgclass - EnableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorMetadata").msgclass - DisableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorRequest").msgclass - DisableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorResponse").msgclass - DisableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorMetadata").msgclass - SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest").msgclass - SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse").msgclass - SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata").msgclass - TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest").msgclass - TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData").msgclass - TrainProcessorVersionRequest::CustomDocumentExtractionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions").msgclass - TrainProcessorVersionRequest::CustomDocumentExtractionOptions::TrainingMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod").enummodule - TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionResponse").msgclass - TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata").msgclass - TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation").msgclass - ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest").msgclass - ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority").enummodule - ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse").msgclass - ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse.State").enummodule - ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata").msgclass - ReviewDocumentOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State").enummodule - EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest").msgclass - EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata").msgclass - EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse").msgclass - GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetEvaluationRequest").msgclass - ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsRequest").msgclass - ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsResponse").msgclass - ImportProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionRequest").msgclass - ImportProcessorVersionRequest::ExternalProcessorVersionSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource").msgclass - ImportProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionResponse").msgclass - ImportProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb deleted file mode 100644 index 5f62ae9281f0..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +++ /dev/null @@ -1,107 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/documentai/v1beta3/document_processor_service.proto for package 'Google.Cloud.DocumentAI.V1beta3' -# Original file comments: -# 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. -# - -require 'grpc' -require 'google/cloud/documentai/v1beta3/document_processor_service_pb' - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Service to call Document AI to process documents according to the - # processor's definition. Processors are built using state-of-the-art Google - # AI such as natural language, computer vision, and translation to extract - # structured information from unstructured or semi-structured documents. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.documentai.v1beta3.DocumentProcessorService' - - # Processes a single document. - rpc :ProcessDocument, ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse - # LRO endpoint to batch process many documents. The output is written - # to Cloud Storage as JSON in the [Document] format. - rpc :BatchProcessDocuments, ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Google::Longrunning::Operation - # Fetches processor types. Note that we don't use - # [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes] - # here, because it isn't paginated. - rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse - # Lists the processor types that exist. - rpc :ListProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse - # Gets a processor type detail. - rpc :GetProcessorType, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorType - # Lists all processors which belong to this project. - rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse - # Gets a processor detail. - rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor - # Trains a new processor version. - # Operation metadata is returned as - # [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata]. - rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Google::Longrunning::Operation - # Gets a processor version detail. - rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion - # Lists all versions of a processor. - rpc :ListProcessorVersions, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse - # Deletes the processor version, all artifacts under the processor version - # will be deleted. - rpc :DeleteProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Google::Longrunning::Operation - # Deploys the processor version. - rpc :DeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Google::Longrunning::Operation - # Undeploys the processor version. - rpc :UndeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Google::Longrunning::Operation - # 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, ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor - # Deletes the processor, unloads all deployed model artifacts if it was - # enabled and then deletes all artifacts associated with this processor. - rpc :DeleteProcessor, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Google::Longrunning::Operation - # Enables a processor - rpc :EnableProcessor, ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Google::Longrunning::Operation - # Disables a processor - rpc :DisableProcessor, ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Google::Longrunning::Operation - # Set the default (active) version of a - # [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in - # [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] - # and - # [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. - rpc :SetDefaultProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Google::Longrunning::Operation - # Send a document for Human Review. The input document should be processed by - # the specified processor. - rpc :ReviewDocument, ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Google::Longrunning::Operation - # Evaluates a ProcessorVersion against annotated documents, producing an - # Evaluation. - rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation - # Retrieves a specific evaluation. - rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1beta3::Evaluation - # Retrieves a set of evaluations for a given processor version. - rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse - # Imports a processor version from source processor version. - rpc :ImportProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb deleted file mode 100644 index 3d9ca5e0b5d5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document_schema.proto - -require 'google/protobuf' - - -descriptor_data = "\n5google/cloud/documentai/v1beta3/document_schema.proto\x12\x1fgoogle.cloud.documentai.v1beta3\"$\n\x10PropertyMetadata\x12\x10\n\x08inactive\x18\x03 \x01(\x08\"&\n\x12\x45ntityTypeMetadata\x12\x10\n\x08inactive\x18\x05 \x01(\x08\"\xe1\x08\n\x0e\x44ocumentSchema\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12P\n\x0c\x65ntity_types\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1beta3.DocumentSchema.EntityType\x12J\n\x08metadata\x18\x04 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.DocumentSchema.Metadata\x1a\xee\x05\n\nEntityType\x12\\\n\x0b\x65num_values\x18\x0e \x01(\x0b\x32\x45.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesH\x00\x12\x14\n\x0c\x64isplay_name\x18\r \x01(\t\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nbase_types\x18\x02 \x03(\t\x12W\n\nproperties\x18\x06 \x03(\x0b\x32\x43.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property\x12Q\n\x14\x65ntity_type_metadata\x18\x0b \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.EntityTypeMetadata\x1a\x1c\n\nEnumValues\x12\x0e\n\x06values\x18\x01 \x03(\t\x1a\xef\x02\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nvalue_type\x18\x02 \x01(\t\x12k\n\x0foccurrence_type\x18\x03 \x01(\x0e\x32R.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType\x12L\n\x11property_metadata\x18\x05 \x01(\x0b\x32\x31.google.cloud.documentai.v1beta3.PropertyMetadata\"\x85\x01\n\x0eOccurrenceType\x12\x1f\n\x1bOCCURRENCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rOPTIONAL_ONCE\x10\x01\x12\x15\n\x11OPTIONAL_MULTIPLE\x10\x02\x12\x11\n\rREQUIRED_ONCE\x10\x03\x12\x15\n\x11REQUIRED_MULTIPLE\x10\x04\x42\x0e\n\x0cvalue_source\x1a\x94\x01\n\x08Metadata\x12\x19\n\x11\x64ocument_splitter\x18\x01 \x01(\x08\x12&\n\x1e\x64ocument_allow_multiple_labels\x18\x02 \x01(\x08\x12%\n\x1dprefixed_naming_on_properties\x18\x06 \x01(\x08\x12\x1e\n\x16skip_naming_validation\x18\x07 \x01(\x08\x42\xef\x01\n#com.google.cloud.documentai.v1beta3B\x18\x44ocumentAiDocumentSchemaP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - PropertyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.PropertyMetadata").msgclass - EntityTypeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EntityTypeMetadata").msgclass - DocumentSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema").msgclass - DocumentSchema::EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType").msgclass - DocumentSchema::EntityType::EnumValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues").msgclass - DocumentSchema::EntityType::Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property").msgclass - DocumentSchema::EntityType::Property::OccurrenceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType").enummodule - DocumentSchema::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.Metadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb deleted file mode 100644 index 49054b583c7c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_pb.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/documentai/v1beta3/dataset_pb' -require 'google/cloud/documentai/v1beta3/document_pb' -require 'google/cloud/documentai/v1beta3/document_io_pb' -require 'google/cloud/documentai/v1beta3/operation_metadata_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n6google/cloud/documentai/v1beta3/document_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/documentai/v1beta3/dataset.proto\x1a.google/cloud/documentai/v1beta3/document.proto\x1a\x31google/cloud/documentai/v1beta3/document_io.proto\x1a\x38google/cloud/documentai/v1beta3/operation_metadata.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x87\x01\n\x14UpdateDatasetRequest\x12>\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32(.google.cloud.documentai.v1beta3.DatasetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"s\n\x1eUpdateDatasetOperationMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\"\xdf\x04\n\x16ImportDocumentsRequest\x12:\n\x07\x64\x61taset\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!documentai.googleapis.com/Dataset\x12\x7f\n\x1e\x62\x61tch_documents_import_configs\x18\x04 \x03(\x0b\x32R.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfigB\x03\xe0\x41\x02\x1a\x87\x03\n\x1a\x42\x61tchDocumentsImportConfig\x12J\n\rdataset_split\x18\x02 \x01(\x0e\x32\x31.google.cloud.documentai.v1beta3.DatasetSplitTypeH\x00\x12\x7f\n\x11\x61uto_split_config\x18\x03 \x01(\x0b\x32\x62.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfigH\x00\x12V\n\x12\x62\x61tch_input_config\x18\x01 \x01(\x0b\x32:.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig\x1a/\n\x0f\x41utoSplitConfig\x12\x1c\n\x14training_split_ratio\x18\x01 \x01(\x02\x42\x13\n\x11split_type_config\"\x19\n\x17ImportDocumentsResponse\"\x80\x05\n\x17ImportDocumentsMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12s\n\x1aindividual_import_statuses\x18\x02 \x03(\x0b\x32O.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus\x12\x7f\n import_config_validation_results\x18\x04 \x03(\x0b\x32U.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult\x12\x1c\n\x14total_document_count\x18\x03 \x01(\x05\x1a\x9f\x01\n\x16IndividualImportStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12G\n\x12output_document_id\x18\x04 \x01(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentId\x1a\\\n\x1cImportConfigValidationResult\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\x8e\x02\n\x12GetDocumentRequest\x12:\n\x07\x64\x61taset\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!documentai.googleapis.com/Dataset\x12\x45\n\x0b\x64ocument_id\x18\x02 \x01(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentIdB\x03\xe0\x41\x02\x12-\n\tread_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x46\n\npage_range\x18\x04 \x01(\x0b\x32\x32.google.cloud.documentai.v1beta3.DocumentPageRange\"R\n\x13GetDocumentResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\"\x8b\x01\n\x1b\x42\x61tchDeleteDocumentsRequest\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12V\n\x11\x64\x61taset_documents\x18\x03 \x01(\x0b\x32\x36.google.cloud.documentai.v1beta3.BatchDatasetDocumentsB\x03\xe0\x41\x02\"\x1e\n\x1c\x42\x61tchDeleteDocumentsResponse\"\xb9\x03\n\x1c\x42\x61tchDeleteDocumentsMetadata\x12Q\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.CommonOperationMetadata\x12\x83\x01\n individual_batch_delete_statuses\x18\x02 \x03(\x0b\x32Y.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus\x12\x1c\n\x14total_document_count\x18\x03 \x01(\x05\x12\x1c\n\x14\x65rror_document_count\x18\x04 \x01(\x05\x1a\x83\x01\n\x1bIndividualBatchDeleteStatus\x12@\n\x0b\x64ocument_id\x18\x01 \x01(\x0b\x32+.google.cloud.documentai.v1beta3.DocumentId\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"u\n\x17GetDatasetSchemaRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'documentai.googleapis.com/DatasetSchema\x12\x1b\n\x13visible_fields_only\x18\x02 \x01(\x08\"\x9a\x01\n\x1aUpdateDatasetSchemaRequest\x12K\n\x0e\x64\x61taset_schema\x18\x01 \x01(\x0b\x32..google.cloud.documentai.v1beta3.DatasetSchemaB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"/\n\x11\x44ocumentPageRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05*\x85\x01\n\x10\x44\x61tasetSplitType\x12\"\n\x1e\x44\x41TASET_SPLIT_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44\x41TASET_SPLIT_TRAIN\x10\x01\x12\x16\n\x12\x44\x41TASET_SPLIT_TEST\x10\x02\x12\x1c\n\x18\x44\x41TASET_SPLIT_UNASSIGNED\x10\x03\x32\xcf\x0c\n\x0f\x44ocumentService\x12\xfe\x01\n\rUpdateDataset\x12\x35.google.cloud.documentai.v1beta3.UpdateDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\x82\xd3\xe4\x93\x02N2C/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}:\x07\x64\x61taset\xda\x41\x13\x64\x61taset,update_mask\xca\x41)\n\x07\x44\x61taset\x12\x1eUpdateDatasetOperationMetadata\x12\x84\x02\n\x0fImportDocuments\x12\x37.google.cloud.documentai.v1beta3.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\x82\xd3\xe4\x93\x02S\"N/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments:\x01*\xda\x41\x07\x64\x61taset\xca\x41\x32\n\x17ImportDocumentsResponse\x12\x17ImportDocumentsMetadata\x12\xd6\x01\n\x0bGetDocument\x12\x33.google.cloud.documentai.v1beta3.GetDocumentRequest\x1a\x34.google.cloud.documentai.v1beta3.GetDocumentResponse\"\\\x82\xd3\xe4\x93\x02L\x12J/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument\xda\x41\x07\x64\x61taset\x12\x9d\x02\n\x14\x42\x61tchDeleteDocuments\x12<.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xa7\x01\x82\xd3\xe4\x93\x02X\"S/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments:\x01*\xda\x41\x07\x64\x61taset\xca\x41<\n\x1c\x42\x61tchDeleteDocumentsResponse\x12\x1c\x42\x61tchDeleteDocumentsMetadata\x12\xd6\x01\n\x10GetDatasetSchema\x12\x38.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest\x1a..google.cloud.documentai.v1beta3.DatasetSchema\"X\x82\xd3\xe4\x93\x02K\x12I/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}\xda\x41\x04name\x12\x92\x02\n\x13UpdateDatasetSchema\x12;.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest\x1a..google.cloud.documentai.v1beta3.DatasetSchema\"\x8d\x01\x82\xd3\xe4\x93\x02j2X/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}:\x0e\x64\x61taset_schema\xda\x41\x1a\x64\x61taset_schema,update_mask\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf0\x01\n#com.google.cloud.documentai.v1beta3B\x19\x44ocumentAiDocumentServiceP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.documentai.v1beta3.Dataset", "google/cloud/documentai/v1beta3/dataset.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.documentai.v1beta3.CommonOperationMetadata", "google/cloud/documentai/v1beta3/operation_metadata.proto"], - ["google.cloud.documentai.v1beta3.BatchDocumentsInputConfig", "google/cloud/documentai/v1beta3/document_io.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.cloud.documentai.v1beta3.Document", "google/cloud/documentai/v1beta3/document.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - UpdateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UpdateDatasetRequest").msgclass - UpdateDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata").msgclass - ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsRequest").msgclass - ImportDocumentsRequest::BatchDocumentsImportConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig").msgclass - ImportDocumentsRequest::BatchDocumentsImportConfig::AutoSplitConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig").msgclass - ImportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsResponse").msgclass - ImportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsMetadata").msgclass - ImportDocumentsMetadata::IndividualImportStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus").msgclass - ImportDocumentsMetadata::ImportConfigValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult").msgclass - GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetDocumentRequest").msgclass - GetDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetDocumentResponse").msgclass - BatchDeleteDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest").msgclass - BatchDeleteDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse").msgclass - BatchDeleteDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata").msgclass - BatchDeleteDocumentsMetadata::IndividualBatchDeleteStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus").msgclass - GetDatasetSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetDatasetSchemaRequest").msgclass - UpdateDatasetSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest").msgclass - DocumentPageRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentPageRange").msgclass - DatasetSplitType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DatasetSplitType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb deleted file mode 100644 index d508fce05f18..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_service_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/documentai/v1beta3/document_service.proto for package 'Google.Cloud.DocumentAI.V1beta3' -# Original file comments: -# 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. -# - -require 'grpc' -require 'google/cloud/documentai/v1beta3/document_service_pb' - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentService - # Service to call Cloud DocumentAI to manage document collection (dataset). - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.documentai.v1beta3.DocumentService' - - # Updates metadata associated with a dataset. - rpc :UpdateDataset, ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, ::Google::Longrunning::Operation - # Import documents into a dataset. - rpc :ImportDocuments, ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, ::Google::Longrunning::Operation - # Returns relevant fields present in the requested document. - rpc :GetDocument, ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse - # Deletes a set of documents. - rpc :BatchDeleteDocuments, ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, ::Google::Longrunning::Operation - # Gets the `DatasetSchema` of a `Dataset`. - rpc :GetDatasetSchema, ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema - # Updates a `DatasetSchema`. - rpc :UpdateDatasetSchema, ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb deleted file mode 100644 index cb06ac86b892..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/evaluation.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/documentai/v1beta3/evaluation.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8d\x02\n\x13\x45valuationReference\x12\x11\n\toperation\x18\x01 \x01(\t\x12=\n\nevaluation\x18\x02 \x01(\tB)\xfa\x41&\n$documentai.googleapis.com/Evaluation\x12N\n\x11\x61ggregate_metrics\x18\x04 \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Evaluation.Metrics\x12T\n\x17\x61ggregate_metrics_exact\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Evaluation.Metrics\"\x8d\x0e\n\nEvaluation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12O\n\x11\x64ocument_counters\x18\x05 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Evaluation.Counters\x12`\n\x14\x61ll_entities_metrics\x18\x03 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics\x12V\n\x0e\x65ntity_metrics\x18\x04 \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Evaluation.EntityMetricsEntry\x12\x14\n\x0ckms_key_name\x18\x06 \x01(\t\x12\x1c\n\x14kms_key_version_name\x18\x07 \x01(\t\x1a\x8d\x01\n\x08\x43ounters\x12\x1d\n\x15input_documents_count\x18\x01 \x01(\x05\x12\x1f\n\x17invalid_documents_count\x18\x02 \x01(\x05\x12\x1e\n\x16\x66\x61iled_documents_count\x18\x03 \x01(\x05\x12!\n\x19\x65valuated_documents_count\x18\x04 \x01(\x05\x1a\xcd\x02\n\x07Metrics\x12\x11\n\tprecision\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x03 \x01(\x02\x12#\n\x1bpredicted_occurrences_count\x18\x04 \x01(\x05\x12&\n\x1eground_truth_occurrences_count\x18\x05 \x01(\x05\x12 \n\x18predicted_document_count\x18\n \x01(\x05\x12#\n\x1bground_truth_document_count\x18\x0b \x01(\x05\x12\x1c\n\x14true_positives_count\x18\x06 \x01(\x05\x12\x1d\n\x15\x66\x61lse_positives_count\x18\x07 \x01(\x05\x12\x1d\n\x15\x66\x61lse_negatives_count\x18\x08 \x01(\x05\x12\x1d\n\x15total_documents_count\x18\t \x01(\x05\x1ax\n\x16\x43onfidenceLevelMetrics\x12\x18\n\x10\x63onfidence_level\x18\x01 \x01(\x02\x12\x44\n\x07metrics\x18\x02 \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Evaluation.Metrics\x1a\x80\x04\n\x16MultiConfidenceMetrics\x12\x64\n\x18\x63onfidence_level_metrics\x18\x01 \x03(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics\x12j\n\x1e\x63onfidence_level_metrics_exact\x18\x04 \x03(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics\x12\r\n\x05\x61uprc\x18\x02 \x01(\x02\x12#\n\x1b\x65stimated_calibration_error\x18\x03 \x01(\x02\x12\x13\n\x0b\x61uprc_exact\x18\x05 \x01(\x02\x12)\n!estimated_calibration_error_exact\x18\x06 \x01(\x02\x12\x64\n\x0cmetrics_type\x18\x07 \x01(\x0e\x32N.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType\":\n\x0bMetricsType\x12\x1c\n\x18METRICS_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tAGGREGATE\x10\x01\x1ax\n\x12\x45ntityMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12Q\n\x05value\x18\x02 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics:\x02\x38\x01:\xa9\x01\xea\x41\xa5\x01\n$documentai.googleapis.com/Evaluation\x12}projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}B\xeb\x01\n#com.google.cloud.documentai.v1beta3B\x14\x44ocumentAiEvaluationP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - EvaluationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluationReference").msgclass - Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation").msgclass - Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Counters").msgclass - Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Metrics").msgclass - Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics").msgclass - Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics").msgclass - Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb deleted file mode 100644 index a220e24f987e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/geometry.proto - -require 'google/protobuf' - - -descriptor_data = "\n.google/cloud/documentai/v1beta3/geometry.proto\x12\x1fgoogle.cloud.documentai.v1beta3\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x99\x01\n\x0c\x42oundingPoly\x12\x39\n\x08vertices\x18\x01 \x03(\x0b\x32\'.google.cloud.documentai.v1beta3.Vertex\x12N\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.NormalizedVertexB\xe4\x01\n#com.google.cloud.documentai.v1beta3B\rGeometryProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Vertex").msgclass - NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.NormalizedVertex").msgclass - BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BoundingPoly").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb deleted file mode 100644 index 3f89fcba9e65..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/operation_metadata.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n8google/cloud/documentai/v1beta3/operation_metadata.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/protobuf/timestamp.proto\"\xda\x02\n\x17\x43ommonOperationMetadata\x12M\n\x05state\x18\x01 \x01(\x0e\x32>.google.cloud.documentai.v1beta3.CommonOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12\x10\n\x08resource\x18\x05 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x42\xed\x01\n#com.google.cloud.documentai.v1beta3B\x16OperationMetadataProtoP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - CommonOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata").msgclass - CommonOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb deleted file mode 100644 index 06bb50b707ec..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/processor.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/documentai/v1beta3/document_schema_pb' -require 'google/cloud/documentai/v1beta3/evaluation_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/cloud/documentai/v1beta3/processor.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/documentai/v1beta3/document_schema.proto\x1a\x30google/cloud/documentai/v1beta3/evaluation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc9\x07\n\x10ProcessorVersion\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12H\n\x0f\x64ocument_schema\x18\x0c \x01(\x0b\x32/.google.cloud.documentai.v1beta3.DocumentSchema\x12\x46\n\x05state\x18\x06 \x01(\x0e\x32\x37.google.cloud.documentai.v1beta3.ProcessorVersion.State\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12O\n\x11latest_evaluation\x18\x08 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.EvaluationReference\x12\x14\n\x0ckms_key_name\x18\t \x01(\t\x12\x1c\n\x14kms_key_version_name\x18\n \x01(\t\x12\x1b\n\x0egoogle_managed\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x12[\n\x10\x64\x65precation_info\x18\r \x01(\x0b\x32\x41.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo\x1a\x9f\x01\n\x0f\x44\x65precationInfo\x12\x34\n\x10\x64\x65precation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12V\n\x1dreplacement_processor_version\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x93\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x45PLOYED\x10\x01\x12\r\n\tDEPLOYING\x10\x02\x12\x0e\n\nUNDEPLOYED\x10\x03\x12\x0f\n\x0bUNDEPLOYING\x10\x04\x12\x0c\n\x08\x43REATING\x10\x05\x12\x0c\n\x08\x44\x45LETING\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07\x12\r\n\tIMPORTING\x10\x08:\x96\x01\xea\x41\x92\x01\n*documentai.googleapis.com/ProcessorVersion\x12\x64projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}\"\xb2\x04\n\tProcessor\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x44\n\x05state\x18\x04 \x01(\x0e\x32\x30.google.cloud.documentai.v1beta3.Processor.StateB\x03\xe0\x41\x03\x12R\n\x19\x64\x65\x66\x61ult_processor_version\x18\t \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12 \n\x10process_endpoint\x18\x06 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x05\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0ckms_key_name\x18\x08 \x01(\t\"~\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08\x45NABLING\x10\x03\x12\r\n\tDISABLING\x10\x04\x12\x0c\n\x08\x43REATING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x0c\n\x08\x44\x45LETING\x10\x07:h\xea\x41\x65\n#documentai.googleapis.com/Processor\x12>projects/{project}/locations/{location}/processors/{processor}B\xea\x01\n#com.google.cloud.documentai.v1beta3B\x13\x44ocumentAiProcessorP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.documentai.v1beta3.DocumentSchema", "google/cloud/documentai/v1beta3/document_schema.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.documentai.v1beta3.EvaluationReference", "google/cloud/documentai/v1beta3/evaluation.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - ProcessorVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion").msgclass - ProcessorVersion::DeprecationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo").msgclass - ProcessorVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.State").enummodule - Processor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor").msgclass - Processor::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb deleted file mode 100644 index 10180e3ecd4a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/processor_type.proto - -require 'google/protobuf' - -require 'google/api/launch_stage_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n4google/cloud/documentai/v1beta3/processor_type.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1dgoogle/api/launch_stage.proto\x1a\x19google/api/resource.proto\"\x98\x03\n\rProcessorType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x03 \x01(\t\x12X\n\x13\x61vailable_locations\x18\x04 \x03(\x0b\x32;.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo\x12\x16\n\x0e\x61llow_creation\x18\x06 \x01(\x08\x12-\n\x0claunch_stage\x18\x08 \x01(\x0e\x32\x17.google.api.LaunchStage\x12\x1c\n\x14sample_document_uris\x18\t \x03(\t\x1a#\n\x0cLocationInfo\x12\x13\n\x0blocation_id\x18\x01 \x01(\t:u\xea\x41r\n\'documentai.googleapis.com/ProcessorType\x12Gprojects/{project}/locations/{location}/processorTypes/{processor_type}B\xee\x01\n#com.google.cloud.documentai.v1beta3B\x17\x44ocumentAiProcessorTypeP\x01ZCcloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb\xaa\x02\x1fGoogle.Cloud.DocumentAI.V1Beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAI\\V1beta3\xea\x02\"Google::Cloud::DocumentAI::V1beta3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - ProcessorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType").msgclass - ProcessorType::LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType.LocationInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md deleted file mode 100644 index 9445d5bb62be..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Document AI V1beta3 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb deleted file mode 100644 index 77056d6d22a8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,381 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 843c8e9deea2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 173c5c85f5dc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb deleted file mode 100644 index 522e181c4702..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same - # concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb deleted file mode 100644 index 1d305e47d2b8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Encodes the detailed information of a barcode. - # @!attribute [rw] format - # @return [::String] - # Format of a barcode. - # The supported formats are: - # - # - `CODE_128`: Code 128 type. - # - `CODE_39`: Code 39 type. - # - `CODE_93`: Code 93 type. - # - `CODABAR`: Codabar type. - # - `DATA_MATRIX`: 2D Data Matrix type. - # - `ITF`: ITF type. - # - `EAN_13`: EAN-13 type. - # - `EAN_8`: EAN-8 type. - # - `QR_CODE`: 2D QR code type. - # - `UPC_A`: UPC-A type. - # - `UPC_E`: UPC-E type. - # - `PDF417`: PDF417 type. - # - `AZTEC`: 2D Aztec code type. - # - `DATABAR`: GS1 DataBar code type. - # @!attribute [rw] value_format - # @return [::String] - # Value format describes the format of the value that a barcode - # encodes. - # The supported formats are: - # - # - `CONTACT_INFO`: Contact information. - # - `EMAIL`: Email address. - # - `ISBN`: ISBN identifier. - # - `PHONE`: Phone number. - # - `PRODUCT`: Product. - # - `SMS`: SMS message. - # - `TEXT`: Text string. - # - `URL`: URL address. - # - `WIFI`: Wifi information. - # - `GEO`: Geo-localization. - # - `CALENDAR_EVENT`: Calendar event. - # - `DRIVER_LICENSE`: Driver's license. - # @!attribute [rw] raw_value - # @return [::String] - # Raw value encoded in the barcode. - # For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - class Barcode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb deleted file mode 100644 index 502d16f4ed3f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/dataset.rb +++ /dev/null @@ -1,187 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # A singleton resource under a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} which configures a - # collection of documents. - # @!attribute [rw] gcs_managed_config - # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::GCSManagedConfig] - # Optional. User-managed Cloud Storage dataset configuration. Use this - # configuration if the dataset documents are stored under a user-managed - # Cloud Storage location. - # @!attribute [rw] document_warehouse_config - # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::DocumentWarehouseConfig] - # Optional. Document AI Warehouse-based dataset configuration. - # @!attribute [rw] unmanaged_dataset_config - # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::UnmanagedDatasetConfig] - # Optional. Unmanaged dataset configuration. Use this configuration if the - # dataset documents are managed by the document service internally (not - # user-managed). - # @!attribute [rw] spanner_indexing_config - # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::SpannerIndexingConfig] - # Optional. A lightweight indexing source with low latency and high - # reliability, but lacking advanced features like CMEK and content-based - # search. - # @!attribute [rw] name - # @return [::String] - # Dataset resource name. - # Format: - # `projects/{project}/locations/{location}/processors/{processor}/dataset` - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset::State] - # Required. State of the dataset. Ignored when updating dataset. - class Dataset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration specific to the Cloud Storage-based implementation. - # @!attribute [rw] gcs_prefix - # @return [::Google::Cloud::DocumentAI::V1beta3::GcsPrefix] - # Required. The Cloud Storage URI (a directory) where the documents - # belonging to the dataset must be stored. - class GCSManagedConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration specific to the Document AI Warehouse-based implementation. - # @!attribute [r] collection - # @return [::String] - # Output only. The collection in Document AI Warehouse associated with the - # dataset. - # @!attribute [r] schema - # @return [::String] - # Output only. The schema in Document AI Warehouse associated with the - # dataset. - class DocumentWarehouseConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration specific to an unmanaged dataset. - class UnmanagedDatasetConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration specific to spanner-based indexing. - class SpannerIndexingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Different states of a dataset. - module 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 - end - end - - # Document Identifier. - # @!attribute [rw] gcs_managed_doc_id - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId::GCSManagedDocumentId] - # A document id within user-managed Cloud Storage. - # @!attribute [rw] unmanaged_doc_id - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId::UnmanagedDocumentId] - # A document id within unmanaged dataset. - # @!attribute [rw] revision_ref - # @return [::Google::Cloud::DocumentAI::V1beta3::RevisionRef] - # Points to a specific revision of the document if set. - class DocumentId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Identifies a document uniquely within the scope of a dataset in the - # user-managed Cloud Storage option. - # @!attribute [rw] gcs_uri - # @return [::String] - # Required. The Cloud Storage URI where the actual document is stored. - # @!attribute [rw] cw_doc_id - # @return [::String] - # Id of the document (indexed) managed by Content Warehouse. - class GCSManagedDocumentId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Identifies a document uniquely within the scope of a dataset in unmanaged - # option. - # @!attribute [rw] doc_id - # @return [::String] - # Required. The id of the document. - class UnmanagedDocumentId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Dataset Schema. - # @!attribute [rw] name - # @return [::String] - # Dataset schema resource name. - # Format: - # `projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema` - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] - # Optional. Schema of the dataset. - class DatasetSchema - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dataset documents that the batch operation will be applied to. - # @!attribute [rw] individual_document_ids - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments::IndividualDocumentIds] - # Document identifiers. - # @!attribute [rw] filter - # @return [::String] - # A filter matching the documents. - # Follows the same format and restriction as - # [google.cloud.documentai.master.ListDocumentsRequest.filter]. - class BatchDatasetDocuments - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # List of individual DocumentIds. - # @!attribute [rw] document_ids - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentId>] - # Required. List of Document IDs indicating where the actual documents are - # stored. - class IndividualDocumentIds - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb deleted file mode 100644 index a32d8be140ad..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb +++ /dev/null @@ -1,1071 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Document represents the canonical document resource in Document AI. It is an - # interchange format that provides insights into documents and allows for - # collaboration between users and Document AI to iterate and optimize for - # quality. - # @!attribute [rw] uri - # @return [::String] - # Optional. Currently supports Google Cloud Storage URI of the form - # `gs://bucket_name/object_name`. Object versioning is not supported. - # For more information, refer to [Google Cloud Storage Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # @!attribute [rw] content - # @return [::String] - # Optional. Inline document content, represented as a stream of bytes. - # Note: As with all `bytes` fields, protobuffers use a pure binary - # representation, whereas JSON representations use base64. - # @!attribute [rw] mime_type - # @return [::String] - # An IANA published [media type (MIME - # type)](https://www.iana.org/assignments/media-types/media-types.xhtml). - # @!attribute [rw] text - # @return [::String] - # Optional. UTF-8 encoded text in reading order from the document. - # @!attribute [rw] text_styles - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Style>] - # Styles for the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] pages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page>] - # Visual page layout for the - # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] - # A list of entities detected on - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. For - # document shards, entities in this list may cross shard boundaries. - # @!attribute [rw] entity_relations - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::EntityRelation>] - # Placeholder. Relationship among - # {::Google::Cloud::DocumentAI::V1beta3::Document#entities Document.entities}. - # @!attribute [rw] text_changes - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextChange>] - # Placeholder. A list of text corrections made to - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. This is - # usually used for annotating corrections to OCR mistakes. Text changes for - # a given revision may not overlap with each other. - # @!attribute [rw] shard_info - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo] - # Information about the sharding if this document is sharded part of a larger - # document. If the document is not sharded, this message is not specified. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Any error that occurred while processing this document. - # @!attribute [rw] revisions - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Revision>] - # Placeholder. Revision history of this document. - class Document - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # For a large document, sharding may be performed to produce several - # document shards. Each document shard contains this field to detail which - # shard it is. - # @!attribute [rw] shard_index - # @return [::Integer] - # The 0-based index of this shard. - # @!attribute [rw] shard_count - # @return [::Integer] - # Total number of shards. - # @!attribute [rw] text_offset - # @return [::Integer] - # The index of the first character in - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text} in the - # overall document global text. - class ShardInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Annotation for common text style attributes. This adheres to CSS - # conventions as much as possible. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] color - # @return [::Google::Type::Color] - # Text color. - # @!attribute [rw] background_color - # @return [::Google::Type::Color] - # Text background color. - # @!attribute [rw] font_weight - # @return [::String] - # [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). - # Possible values are `normal`, `bold`, `bolder`, and `lighter`. - # @!attribute [rw] text_style - # @return [::String] - # [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). - # Possible values are `normal`, `italic`, and `oblique`. - # @!attribute [rw] text_decoration - # @return [::String] - # [Text - # decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). - # Follows CSS standard. - # - # @!attribute [rw] font_size - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Style::FontSize] - # Font size. - # @!attribute [rw] font_family - # @return [::String] - # Font family such as `Arial`, `Times New Roman`. - # https://www.w3schools.com/cssref/pr_font_font-family.asp - class Style - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Font size with unit. - # @!attribute [rw] size - # @return [::Float] - # Font size for the text. - # @!attribute [rw] unit - # @return [::String] - # Unit for the font size. Follows CSS naming (such as `in`, `px`, and - # `pt`). - class FontSize - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A page in a {::Google::Cloud::DocumentAI::V1beta3::Document Document}. - # @!attribute [rw] page_number - # @return [::Integer] - # 1-based index for current - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page Page} in a parent - # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. Useful when a page - # is taken out of a {::Google::Cloud::DocumentAI::V1beta3::Document Document} - # for individual processing. - # @!attribute [rw] image - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Image] - # Rendered image for this page. This image is preprocessed to remove any - # skew, rotation, and distortions such that the annotation bounding boxes - # can be upright and axis-aligned. - # @!attribute [rw] transforms - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Matrix>] - # Transformation matrices that were applied to the original document image - # to produce - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#image Page.image}. - # @!attribute [rw] dimension - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Dimension] - # Physical dimension of the page. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the - # page. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] blocks - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block>] - # A list of visually detected text blocks on the page. - # A block has a set of lines (collected into paragraphs) that have a common - # line-spacing and orientation. - # @!attribute [rw] paragraphs - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph>] - # A list of visually detected text paragraphs on the page. - # A collection of lines that a human would perceive as a paragraph. - # @!attribute [rw] lines - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line>] - # A list of visually detected text lines on the page. - # A collection of tokens that a human would perceive as a line. - # @!attribute [rw] tokens - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token>] - # A list of visually detected tokens on the page. - # @!attribute [rw] visual_elements - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement>] - # A list of detected non-text visual elements e.g. checkbox, - # signature etc. on the page. - # @!attribute [rw] tables - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table>] - # A list of visually detected tables on the page. - # @!attribute [rw] form_fields - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField>] - # A list of visually detected form fields on the page. - # @!attribute [rw] symbols - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol>] - # A list of visually detected symbols on the page. - # @!attribute [rw] detected_barcodes - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode>] - # A list of detected barcodes. - # @!attribute [rw] image_quality_scores - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores] - # Image quality scores. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this page. - class Page - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Dimension for the page. - # @!attribute [rw] width - # @return [::Float] - # Page width. - # @!attribute [rw] height - # @return [::Float] - # Page height. - # @!attribute [rw] unit - # @return [::String] - # Dimension unit. - class Dimension - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Rendered image contents for this page. - # @!attribute [rw] content - # @return [::String] - # Raw byte content of the image. - # @!attribute [rw] mime_type - # @return [::String] - # Encoding [media type (MIME - # type)](https://www.iana.org/assignments/media-types/media-types.xhtml) - # for the image. - # @!attribute [rw] width - # @return [::Integer] - # Width of the image in pixels. - # @!attribute [rw] height - # @return [::Integer] - # Height of the image in pixels. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Representation for transformation matrix, intended to be compatible and - # used with OpenCV format for image manipulation. - # @!attribute [rw] rows - # @return [::Integer] - # Number of rows in the matrix. - # @!attribute [rw] cols - # @return [::Integer] - # Number of columns in the matrix. - # @!attribute [rw] type - # @return [::Integer] - # This encodes information about what data type the matrix uses. - # For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - # of OpenCV primitive data types, please refer to - # https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - # @!attribute [rw] data - # @return [::String] - # The matrix data. - class Matrix - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Visual element describing a layout unit on a page. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the current - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} within - # context of the object this layout is for. e.g. confidence can be for a - # single token, a table, a visual element, etc. depending on context. - # Range `[0, 1]`. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] - # The bounding polygon for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. - # @!attribute [rw] orientation - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout::Orientation] - # Detected orientation for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. - class Layout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Detected human reading orientation. - module Orientation - # Unspecified orientation. - ORIENTATION_UNSPECIFIED = 0 - - # Orientation is aligned with page up. - PAGE_UP = 1 - - # Orientation is aligned with page right. - # Turn the head 90 degrees clockwise from upright to read. - PAGE_RIGHT = 2 - - # Orientation is aligned with page down. - # Turn the head 180 degrees from upright to read. - PAGE_DOWN = 3 - - # Orientation is aligned with page left. - # Turn the head 90 degrees counterclockwise from upright to read. - PAGE_LEFT = 4 - end - end - - # A block has a set of lines (collected into paragraphs) that have a - # common line-spacing and orientation. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block Block}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class Block - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of lines that a human would perceive as a paragraph. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph Paragraph}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class Paragraph - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of tokens that a human would perceive as a line. - # Does not cross column boundaries, can be horizontal, vertical, etc. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line Line}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class Line - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A detected token. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. - # @!attribute [rw] detected_break - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak] - # Detected break at the end of a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - # @!attribute [rw] style_info - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::StyleInfo] - # Text style attributes. - class Token - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Detected break at the end of a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. - # @!attribute [rw] type - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak::Type] - # Detected break type. - class DetectedBreak - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to denote the type of break found. - module Type - # Unspecified break type. - TYPE_UNSPECIFIED = 0 - - # A single whitespace. - SPACE = 1 - - # A wider whitespace. - WIDE_SPACE = 2 - - # A hyphen that indicates that a token has been split across lines. - HYPHEN = 3 - end - end - - # Font and other text style attributes. - # @!attribute [rw] font_size - # @return [::Integer] - # Font size in points (`1` point is `¹⁄₇₂` inches). - # @!attribute [rw] pixel_font_size - # @return [::Float] - # Font size in pixels, equal to _unrounded - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::StyleInfo#font_size font_size}_ - # * _resolution_ ÷ `72.0`. - # @!attribute [rw] letter_spacing - # @return [::Float] - # Letter spacing in points. - # @!attribute [rw] font_type - # @return [::String] - # Name or style of the font. - # @!attribute [rw] bold - # @return [::Boolean] - # Whether the text is bold (equivalent to - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::StyleInfo#font_weight font_weight} - # is at least `700`). - # @!attribute [rw] italic - # @return [::Boolean] - # Whether the text is italic. - # @!attribute [rw] underlined - # @return [::Boolean] - # Whether the text is underlined. - # @!attribute [rw] strikeout - # @return [::Boolean] - # Whether the text is strikethrough. - # @!attribute [rw] subscript - # @return [::Boolean] - # Whether the text is a subscript. - # @!attribute [rw] superscript - # @return [::Boolean] - # Whether the text is a superscript. - # @!attribute [rw] smallcaps - # @return [::Boolean] - # Whether the text is in small caps. - # @!attribute [rw] font_weight - # @return [::Integer] - # TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). - # Normal is `400`, bold is `700`. - # @!attribute [rw] handwritten - # @return [::Boolean] - # Whether the text is handwritten. - # @!attribute [rw] text_color - # @return [::Google::Type::Color] - # Color of the text. - # @!attribute [rw] background_color - # @return [::Google::Type::Color] - # Color of the background. - class StyleInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A detected symbol. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol Symbol}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - class Symbol - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detected non-text visual elements e.g. checkbox, signature etc. on the - # page. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. - # @!attribute [rw] type - # @return [::String] - # Type of the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - class VisualElement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A table representation similar to HTML table structure. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table Table}. - # @!attribute [rw] header_rows - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] - # Header rows of the table. - # @!attribute [rw] body_rows - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] - # Body rows of the table. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this table. - class Table - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A row of table cells. - # @!attribute [rw] cells - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell>] - # Cells that make up this row. - class TableRow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A cell representation inside the table. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell TableCell}. - # @!attribute [rw] row_span - # @return [::Integer] - # How many rows this cell spans. - # @!attribute [rw] col_span - # @return [::Integer] - # How many columns this cell spans. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - class TableCell - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A form field detected on the page. - # @!attribute [rw] field_name - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} - # name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - # @!attribute [rw] field_value - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} - # value. - # @!attribute [rw] name_detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages for name together with confidence. - # @!attribute [rw] value_detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages for value together with confidence. - # @!attribute [rw] value_type - # @return [::String] - # If the value is non-textual, this field represents the type. Current - # valid values are: - # - # - blank (this indicates the `field_value` is normal text) - # - `unfilled_checkbox` - # - `filled_checkbox` - # @!attribute [rw] corrected_key_text - # @return [::String] - # Created for Labeling UI to export key text. - # If corrections were made to the text identified by the - # `field_name.text_anchor`, this field will contain the correction. - # @!attribute [rw] corrected_value_text - # @return [::String] - # Created for Labeling UI to export value text. - # If corrections were made to the text identified by the - # `field_value.text_anchor`, this field will contain the correction. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class FormField - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A detected barcode. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. - # @!attribute [rw] barcode - # @return [::Google::Cloud::DocumentAI::V1beta3::Barcode] - # Detailed barcode information of the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. - class DetectedBarcode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detected language for a structural component. - # @!attribute [rw] language_code - # @return [::String] - # The [BCP-47 language - # code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), - # such as `en-US` or `sr-Latn`. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of detected language. Range `[0, 1]`. - class DetectedLanguage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Image quality scores for the page image. - # @!attribute [rw] quality_score - # @return [::Float] - # The overall quality score. Range `[0, 1]` where `1` is perfect quality. - # @!attribute [rw] detected_defects - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores::DetectedDefect>] - # A list of detected defects. - class ImageQualityScores - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Image Quality Defects - # @!attribute [rw] type - # @return [::String] - # Name of the defect type. Supported values are: - # - # - `quality/defect_blurry` - # - `quality/defect_noisy` - # - `quality/defect_dark` - # - `quality/defect_faint` - # - `quality/defect_text_too_small` - # - `quality/defect_document_cutoff` - # - `quality/defect_text_cutoff` - # - `quality/defect_glare` - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of detected defect. Range `[0, 1]` where `1` indicates - # strong confidence that the defect exists. - class DetectedDefect - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # An entity that could be a phrase in the text or a property that belongs to - # the document. It is a known entity type, such as a person, an organization, - # or location. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Optional. Provenance of the entity. - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] type - # @return [::String] - # Required. Entity type from a schema e.g. `Address`. - # @!attribute [rw] mention_text - # @return [::String] - # Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. - # @!attribute [rw] mention_id - # @return [::String] - # Optional. Deprecated. Use `id` field instead. - # @!attribute [rw] confidence - # @return [::Float] - # Optional. Confidence of detected Schema entity. Range `[0, 1]`. - # @!attribute [rw] page_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor] - # Optional. Represents the provenance of this entity wrt. the location on - # the page where it was found. - # @!attribute [rw] id - # @return [::String] - # Optional. Canonical id. This will be a unique value in the entity list - # for this document. - # @!attribute [rw] normalized_value - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Entity::NormalizedValue] - # Optional. Normalized entity value. Absent if the extracted value could - # not be converted or the type (e.g. address) is not supported for certain - # parsers. This field is also only populated for certain supported document - # types. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] - # Optional. Entities can be nested to form a hierarchical data structure - # representing the content in the document. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # Optional. The history of this annotation. - # @!attribute [rw] redacted - # @return [::Boolean] - # Optional. Whether the entity will be redacted for de-identification - # purposes. - class Entity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Parsed and normalized entity value. - # @!attribute [rw] money_value - # @return [::Google::Type::Money] - # Money value. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - # @!attribute [rw] date_value - # @return [::Google::Type::Date] - # Date value. Includes year, month, day. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - # @!attribute [rw] datetime_value - # @return [::Google::Type::DateTime] - # DateTime value. Includes date, time, and timezone. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - # @!attribute [rw] address_value - # @return [::Google::Type::PostalAddress] - # Postal address. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - # @!attribute [rw] boolean_value - # @return [::Boolean] - # Boolean value. Can be used for entities with binary values, or for - # checkboxes. - # @!attribute [rw] integer_value - # @return [::Integer] - # Integer value. - # @!attribute [rw] float_value - # @return [::Float] - # Float value. - # @!attribute [rw] text - # @return [::String] - # Optional. An optional field to store a normalized string. - # For some entity types, one of respective `structured_value` fields may - # also be populated. Also not all the types of `structured_value` will be - # normalized. For example, some processors may not generate `float` - # or `integer` normalized text by default. - # - # Below are sample formats mapped to structured values. - # - # - Money/Currency type (`money_value`) is in the ISO 4217 text format. - # - Date type (`date_value`) is in the ISO 8601 text format. - # - Datetime type (`datetime_value`) is in the ISO 8601 text format. - class NormalizedValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Relationship between - # {::Google::Cloud::DocumentAI::V1beta3::Document::Entity Entities}. - # @!attribute [rw] subject_id - # @return [::String] - # Subject entity id. - # @!attribute [rw] object_id - # @return [::String] - # Object entity id. - # @!attribute [rw] relation - # @return [::String] - # Relationship description. - class EntityRelation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Text reference indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] text_segments - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment>] - # The text segments from the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] content - # @return [::String] - # Contains the content of the text span so that users do - # not have to look it up in the text_segments. It is always - # populated for formFields. - class TextAnchor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A text segment in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. The - # indices may be out of bounds which indicate that the text extends into - # another document shard for large sharded documents. See - # {::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo#text_offset ShardInfo.text_offset} - # @!attribute [rw] start_index - # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} - # start UTF-8 char index in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] end_index - # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} - # half open end UTF-8 char index in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - class TextSegment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Referencing the visual context of the entity in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages}. Page - # anchors can be cross-page, consist of multiple bounding polygons and - # optionally reference specific layout element types. - # @!attribute [rw] page_refs - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef>] - # One or more references to visual page elements - class PageAnchor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a weak reference to a page element within a document. - # @!attribute [rw] page - # @return [::Integer] - # Required. Index into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages} - # element, for example using - # `[Document.pages][page_refs.page]` to locate the related page element. - # This field is skipped when its value is the default `0`. See - # https://developers.google.com/protocol-buffers/docs/proto3#json. - # @!attribute [rw] layout_type - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef::LayoutType] - # Optional. The type of the layout element that is being referenced if - # any. - # @!attribute [rw] layout_id - # @return [::String] - # Optional. Deprecated. Use - # {::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} - # instead. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] - # Optional. Identifies the bounding polygon of a layout element on the - # page. - # @!attribute [rw] confidence - # @return [::Float] - # Optional. Confidence of detected page element, if applicable. Range - # `[0, 1]`. - class PageRef - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of layout that is being referenced. - module LayoutType - # Layout Unspecified. - LAYOUT_TYPE_UNSPECIFIED = 0 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#blocks Page.blocks} - # element. - BLOCK = 1 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#paragraphs Page.paragraphs} - # element. - PARAGRAPH = 2 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#lines Page.lines} - # element. - LINE = 3 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tokens Page.tokens} - # element. - TOKEN = 4 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#visual_elements Page.visual_elements} - # element. - VISUAL_ELEMENT = 5 - - # Refrrences a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tables Page.tables} - # element. - TABLE = 6 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#form_fields Page.form_fields} - # element. - FORM_FIELD = 7 - end - end - end - - # Structure to identify provenance relationships between annotations in - # different revisions. - # @!attribute [rw] revision - # @return [::Integer] - # The index of the revision that produced this element. - # @!attribute [rw] id - # @return [::Integer] - # The Id of this operation. Needs to be unique within the scope of the - # revision. - # @!attribute [rw] parents - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::Parent>] - # References to the original elements that are replaced. - # @!attribute [rw] type - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::OperationType] - # The type of provenance operation. - class Provenance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The parent element the current element is based on. Used for - # referencing/aligning, removal and replacement operations. - # @!attribute [rw] revision - # @return [::Integer] - # The index of the index into current revision's parent_ids list. - # @!attribute [rw] index - # @return [::Integer] - # The index of the parent item in the corresponding item list (eg. list - # of entities, properties within entities, etc.) in the parent revision. - # @!attribute [rw] id - # @return [::Integer] - # The id of the parent provenance. - class Parent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # If a processor or agent does an explicit operation on existing elements. - module OperationType - # Operation type unspecified. If no operation is specified a provenance - # entry is simply used to match against a `parent`. - OPERATION_TYPE_UNSPECIFIED = 0 - - # Add an element. - ADD = 1 - - # Remove an element identified by `parent`. - REMOVE = 2 - - # Updates any fields within the given provenance scope of the message. It - # overwrites the fields rather than replacing them. Use this when you - # want to update a field value of an entity without also updating all the - # child properties. - UPDATE = 7 - - # Currently unused. Replace an element identified by `parent`. - REPLACE = 3 - - # Deprecated. Request human review for the element identified by - # `parent`. - EVAL_REQUESTED = 4 - - # Deprecated. Element is reviewed and approved at human review, - # confidence will be set to 1.0. - EVAL_APPROVED = 5 - - # Deprecated. Element is skipped in the validation process. - EVAL_SKIPPED = 6 - end - end - - # Contains past or forward revisions of this document. - # @!attribute [rw] agent - # @return [::String] - # If the change was made by a person specify the name or id of that - # person. - # @!attribute [rw] processor - # @return [::String] - # If the annotation was made by processor identify the processor by its - # resource name. - # @!attribute [rw] id - # @return [::String] - # Id of the revision, internally generated by doc proto storage. - # Unique within the context of the document. - # @!attribute [rw] parent - # @return [::Array<::Integer>] - # The revisions that this revision is based on. This can include one or - # more parent (when documents are merged.) This field represents the - # index into the `revisions` field. - # @!attribute [rw] parent_ids - # @return [::Array<::String>] - # The revisions that this revision is based on. Must include all the ids - # that have anything to do with this revision - eg. there are - # `provenance.parent.revision` fields that index into this field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time that the revision was created, internally generated by - # doc proto storage at the time of create. - # @!attribute [rw] human_review - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Revision::HumanReview] - # Human Review information of this revision. - class Revision - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Human Review information of the document. - # @!attribute [rw] state - # @return [::String] - # Human review state. e.g. `requested`, `succeeded`, `rejected`. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # For example, the rejection reason when the state is `rejected`. - class HumanReview - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used for text changes aka. OCR corrections. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Provenance of the correction. - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. There - # can only be a single `TextAnchor.text_segments` element. If the start - # and end index of the text segment are the same, the text change is - # inserted before that index. - # @!attribute [rw] changed_text - # @return [::String] - # The text that replaces the text identified in the `text_anchor`. - # @!attribute [rw] provenance - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>] - # The history of this annotation. - class TextChange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The revision reference specifies which revision on the document to read. - # @!attribute [rw] revision_case - # @return [::Google::Cloud::DocumentAI::V1beta3::RevisionRef::RevisionCase] - # Reads the revision by the predefined case. - # @!attribute [rw] revision_id - # @return [::String] - # Reads the revision given by the id. - # @!attribute [rw] latest_processor_version - # @return [::String] - # Reads the revision generated by the processor version. - # The format takes the full resource name of processor version. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - class RevisionRef - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Some predefined revision cases. - module RevisionCase - # Unspecified case, fallback to read the LATEST_HUMAN_REVIEW. - REVISION_CASE_UNSPECIFIED = 0 - - # The latest revision made by a human. - LATEST_HUMAN_REVIEW = 1 - - # The latest revision based on timestamp. - LATEST_TIMESTAMP = 2 - - # The first (OCR) revision. - BASE_OCR_REVISION = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb deleted file mode 100644 index 0ba8e20d4dc3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +++ /dev/null @@ -1,193 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Payload message of raw document content (bytes). - # @!attribute [rw] content - # @return [::String] - # Inline document content. - # @!attribute [rw] mime_type - # @return [::String] - # An IANA MIME type (RFC6838) indicating the nature and format of the - # {::Google::Cloud::DocumentAI::V1beta3::RawDocument#content content}. - class RawDocument - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a document stored on Cloud Storage. - # @!attribute [rw] gcs_uri - # @return [::String] - # The Cloud Storage object uri. - # @!attribute [rw] mime_type - # @return [::String] - # An IANA MIME type (RFC6838) of the content. - class GcsDocument - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a set of documents on Cloud Storage. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::GcsDocument>] - # The list of documents. - class GcsDocuments - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies all documents on Cloud Storage with a common prefix. - # @!attribute [rw] gcs_uri_prefix - # @return [::String] - # The URI prefix. - class GcsPrefix - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The common config to specify a set of documents used as input. - # @!attribute [rw] gcs_prefix - # @return [::Google::Cloud::DocumentAI::V1beta3::GcsPrefix] - # The set of documents that match the specified Cloud Storage `gcs_prefix`. - # @!attribute [rw] gcs_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::GcsDocuments] - # The set of documents individually specified on Cloud Storage. - class BatchDocumentsInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Config that controls the output of documents. All documents will be written - # as a JSON file. - # @!attribute [rw] gcs_output_config - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig] - # Output config to write the results to Cloud Storage. - class DocumentOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The configuration used when outputting documents. - # @!attribute [rw] gcs_uri - # @return [::String] - # The Cloud Storage uri (a directory) of the output. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Specifies which fields to include in the output documents. - # Only supports top level document and pages field so it must be in the - # form of `{document_field_name}` or `pages.{page_field_name}`. - # @!attribute [rw] sharding_config - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig::ShardingConfig] - # Specifies the sharding config for the output document. - class GcsOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The sharding config for the output document. - # @!attribute [rw] pages_per_shard - # @return [::Integer] - # The number of pages per shard. - # @!attribute [rw] pages_overlap - # @return [::Integer] - # The number of overlapping pages between consecutive shards. - class ShardingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Config for Document OCR. - # @!attribute [rw] hints - # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig::Hints] - # Hints for the OCR model. - # @!attribute [rw] enable_native_pdf_parsing - # @return [::Boolean] - # Enables special handling for PDFs with existing text information. Results - # in better text extraction quality in such PDF inputs. - # @!attribute [rw] enable_image_quality_scores - # @return [::Boolean] - # Enables intelligent document quality scores after OCR. Can help with - # diagnosing why OCR responses are of poor quality for a given input. - # Adds additional latency comparable to regular OCR to the process call. - # @!attribute [rw] advanced_ocr_options - # @return [::Array<::String>] - # 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. - # @!attribute [rw] enable_symbol - # @return [::Boolean] - # Includes symbol level OCR information if set to true. - # @!attribute [rw] compute_style_info - # @return [::Boolean] - # Turn on font identification model and return font style information. - # Deprecated, use - # {::Google::Cloud::DocumentAI::V1beta3::OcrConfig::PremiumFeatures#compute_style_info PremiumFeatures.compute_style_info} - # instead. - # @!attribute [rw] disable_character_boxes_detection - # @return [::Boolean] - # Turn off character box detector in OCR engine. Character box detection is - # enabled by default in OCR 2.0+ processors. - # @!attribute [rw] premium_features - # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig::PremiumFeatures] - # Configurations for premium OCR features. - class OcrConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Hints for OCR Engine - # @!attribute [rw] language_hints - # @return [::Array<::String>] - # List of BCP-47 language codes to use for OCR. In most cases, not - # specifying it yields the best results since it enables automatic language - # detection. For languages based on the Latin alphabet, setting hints is - # not needed. In rare cases, when the language of the text in the - # image is known, setting a hint will help get better results (although it - # will be a significant hindrance if the hint is wrong). - class Hints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configurations for premium OCR features. - # @!attribute [rw] enable_selection_mark_detection - # @return [::Boolean] - # Turn on selection mark detector in OCR engine. Only available in OCR 2.0+ - # processors. - # @!attribute [rw] compute_style_info - # @return [::Boolean] - # Turn on font identification model and return font style information. - # @!attribute [rw] enable_math_ocr - # @return [::Boolean] - # Turn on the model that can extract LaTeX math formulas. - class PremiumFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb deleted file mode 100644 index 27a1bdb4aa13..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +++ /dev/null @@ -1,1082 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Options for Process API - # @!attribute [rw] individual_page_selector - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions::IndividualPageSelector] - # Which pages to process (1-indexed). - # @!attribute [rw] from_start - # @return [::Integer] - # Only process certain pages from the start, process all if the document - # has less pages. - # @!attribute [rw] from_end - # @return [::Integer] - # Only process certain pages from the end, same as above. - # @!attribute [rw] ocr_config - # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig] - # Only applicable to `OCR_PROCESSOR`. Returns error if set on other - # processor types. - class ProcessOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A list of individual page numbers. - # @!attribute [rw] pages - # @return [::Array<::Integer>] - # Optional. Indices of the pages (starting from 1). - class IndividualPageSelector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} - # method. - # @!attribute [rw] inline_document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # An inline document proto. - # @!attribute [rw] raw_document - # @return [::Google::Cloud::DocumentAI::V1beta3::RawDocument] - # A raw document content (bytes). - # @!attribute [rw] gcs_document - # @return [::Google::Cloud::DocumentAI::V1beta3::GcsDocument] - # A raw document on Google Cloud Storage. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the - # server will use its [default - # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # The document payload, the - # {::Google::Cloud::DocumentAI::V1beta3::Document#content content} and - # {::Google::Cloud::DocumentAI::V1beta3::Document#mime_type mime_type} fields must - # be set. - # @!attribute [rw] skip_human_review - # @return [::Boolean] - # Whether human review should be skipped for this request. Default to - # `false`. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Specifies which fields to include in the - # {::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}`. - # @!attribute [rw] process_options - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] - # Inference-time options for the process API - class ProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The status of human review on a processed document. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus::State] - # The state of human review on the processing request. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the human review state. - # @!attribute [rw] human_review_operation - # @return [::String] - # The name of the operation triggered by the processed document. This field - # is populated only when the - # {::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus#state state} is - # `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as - # the long-running operation returned by - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument}. - class HumanReviewStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The final state of human review on a processed document. - module State - # Human review state is unspecified. Most likely due to an internal error. - STATE_UNSPECIFIED = 0 - - # Human review is skipped for the document. This can happen because human - # review isn't enabled on the processor or the processing request has - # been set to skip this document. - SKIPPED = 1 - - # Human review validation is triggered and passed, so no review is needed. - VALIDATION_PASSED = 2 - - # Human review validation is triggered and the document is under review. - IN_PROGRESS = 3 - - # Some error happened during triggering human review, see the - # {::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus#state_message state_message} - # for details. - ERROR = 4 - end - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} - # method. - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # The document payload, will populate fields based on the processor's - # behavior. - # @!attribute [rw] human_review_operation - # @return [::String] - # The name of the operation triggered by the processed document. If the human - # review process isn't triggered, this field is empty. It has the same - # response type and metadata as the long-running operation returned by - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument}. - # @!attribute [rw] human_review_status - # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] - # The status of human review on the processed document. - class ProcessResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] input_configs - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig>] - # The input config for each single document in the batch process. - # @!attribute [rw] output_config - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig] - # The overall output config for batch process. - # @!attribute [rw] input_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # The input documents for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} - # method. - # @!attribute [rw] document_output_config - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig] - # The output configuration for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} - # method. - # @!attribute [rw] skip_human_review - # @return [::Boolean] - # Whether human review should be skipped for this request. Default to - # `false`. - # @!attribute [rw] process_options - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] - # Inference-time options for the process API - class BatchProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The message for input config in batch process. - # @!attribute [rw] gcs_source - # @return [::String] - # The Cloud Storage location as the source of the document. - # @!attribute [rw] mime_type - # @return [::String] - # 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 - # {::Google::Cloud::DocumentAI::V1beta3::Document Document}, the type should be - # `application/json`. - class BatchInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The output configuration in the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} - # method. - # @!attribute [rw] gcs_destination - # @return [::String] - # The output Cloud Storage directory to put the processed documents. - class BatchOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. - class BatchProcessResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::State] - # The state of the current batch processing. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # For example, the error message if the operation is failed. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] individual_process_statuses - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::IndividualProcessStatus>] - # The list of response details of each document. - class BatchProcessMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of a each individual document in the batch process. - # @!attribute [rw] input_gcs_source - # @return [::String] - # The source of the document, same as the - # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::IndividualProcessStatus#input_gcs_source input_gcs_source} - # field in the request when the batch process started. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status processing the document. - # @!attribute [rw] output_gcs_destination - # @return [::String] - # The Cloud Storage output destination (in the request as - # {::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig#gcs_uri DocumentOutputConfig.GcsOutputConfig.gcs_uri}) - # of the processed document if it was successful, otherwise empty. - # @!attribute [rw] human_review_operation - # @return [::String] - # The name of the operation triggered by the processed document. If the - # human review process isn't triggered, this field will be empty. It has - # the same response type and metadata as the long-running operation - # returned by the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} - # method. - # @!attribute [rw] human_review_status - # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] - # The status of human review on the processed document. - class IndividualProcessStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible states of the batch processing operation. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # Request operation is waiting for scheduling. - WAITING = 1 - - # Request is being processed. - RUNNING = 2 - - # The batch processing completed successfully. - SUCCEEDED = 3 - - # The batch processing was being cancelled. - CANCELLING = 4 - - # The batch processing was cancelled. - CANCELLED = 5 - - # The batch processing has failed. - FAILED = 6 - end - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} - # method. Some processor types may require the project be added to an - # allowlist. - # @!attribute [rw] parent - # @return [::String] - # Required. The location of processor types to list. - # Format: `projects/{project}/locations/{location}`. - class FetchProcessorTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} - # method. - # @!attribute [rw] processor_types - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # The list of processor types. - class FetchProcessorTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} - # method. Some processor types may require the project be added to an - # allowlist. - # @!attribute [rw] parent - # @return [::String] - # Required. The location of processor types to list. - # Format: `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # 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`. - # @!attribute [rw] page_token - # @return [::String] - # Used to retrieve the next page of results, empty if at the end of the list. - class ListProcessorTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} - # method. - # @!attribute [rw] processor_types - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # The processor types. - # @!attribute [rw] next_page_token - # @return [::String] - # Points to the next page, otherwise empty. - class ListProcessorTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for list all processors belongs to a project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent (project and location) which owns this collection of - # Processors. Format: `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # 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`. - # @!attribute [rw] page_token - # @return [::String] - # We will return the processors sorted by creation time. The page token - # will point to the next processor. - class ListProcessorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors ListProcessors} - # method. - # @!attribute [rw] processors - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # The list of processors. - # @!attribute [rw] next_page_token - # @return [::String] - # Points to the next processor, otherwise empty. - class ListProcessorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type GetProcessorType} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor type resource name. - class GetProcessorTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor GetProcessor} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor resource name. - class GetProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version GetProcessorVersion} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor resource name. - class GetProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for list all processor versions belongs to a processor. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent (project, location and processor) to list all - # versions. Format: - # `projects/{project}/locations/{location}/processors/{processor}` - # @!attribute [rw] page_size - # @return [::Integer] - # 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`. - # @!attribute [rw] page_token - # @return [::String] - # We will return the processor versions sorted by creation time. The page - # token will point to the next processor version. - class ListProcessorVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions ListProcessorVersions} - # method. - # @!attribute [rw] processor_versions - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # The list of processors. - # @!attribute [rw] next_page_token - # @return [::String] - # Points to the next processor, otherwise empty. - class ListProcessorVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version DeleteProcessorVersion} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor version resource name to be deleted. - class DeleteProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version DeleteProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class DeleteProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor version resource name to be deployed. - class DeployProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} - # method. - class DeployProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class DeployProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor version resource name to be undeployed. - class UndeployProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} - # method. - class UndeployProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class UndeployProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor CreateProcessor} - # method. Notice this request is sent to a regionalized backend service. If the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorType ProcessorType} isn't - # available in that region, the creation fails. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent (project and location) under which to create the - # processor. Format: `projects/{project}/locations/{location}` - # @!attribute [rw] processor - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # Required. The processor to be created, requires - # {::Google::Cloud::DocumentAI::V1beta3::Processor#type Processor.type} and - # [Processor.display_name]][] to be set. Also, the - # {::Google::Cloud::DocumentAI::V1beta3::Processor#kms_key_name Processor.kms_key_name} - # field must be set if the processor is under CMEK. - class CreateProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor DeleteProcessor} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor resource name to be deleted. - class DeleteProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor DeleteProcessor} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class DeleteProcessorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor EnableProcessor} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor resource name to be enabled. - class EnableProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor EnableProcessor} - # method. Intentionally empty proto for adding fields in future. - class EnableProcessorResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor EnableProcessor} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class EnableProcessorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor DisableProcessor} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The processor resource name to be disabled. - class DisableProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor DisableProcessor} - # method. Intentionally empty proto for adding fields in future. - class DisableProcessorResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor DisableProcessor} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class DisableProcessorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} - # method. - # @!attribute [rw] processor - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default - # version. - # @!attribute [rw] default_processor_version - # @return [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use - # as default. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - class SetDefaultProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} - # method. - class SetDefaultProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class SetDefaultProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version TrainProcessorVersion} - # method. - # @!attribute [rw] custom_document_extraction_options - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions] - # Options to control Custom Document Extraction (CDE) Processor. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent (project, location and processor) to create the new - # version for. Format: - # `projects/{project}/locations/{location}/processors/{processor}`. - # @!attribute [rw] processor_version - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # Required. The processor version to be created. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] - # Optional. The schema the processor version will be trained with. - # @!attribute [rw] input_data - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData] - # Optional. The input data used to train the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # @!attribute [rw] base_processor_version - # @return [::String] - # Optional. The processor version to use as a base for training. This - # processor version must be a child of `parent`. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - class TrainProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The input data used to train a new - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # @!attribute [rw] training_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # The documents used for training the new version. - # @!attribute [rw] test_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # The documents used for testing the trained version. - class InputData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options to control the training of the Custom Document Extraction (CDE) - # Processor. - # @!attribute [rw] training_method - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions::TrainingMethod] - # Training method to use for CDE training. - class CustomDocumentExtractionOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Training Method for CDE. TRAINING_METHOD_UNSPECIFIED will fallback to - # MODEL_BASED. - module TrainingMethod - TRAINING_METHOD_UNSPECIFIED = 0 - - MODEL_BASED = 1 - - TEMPLATE_BASED = 2 - end - end - end - - # The response for - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version TrainProcessorVersion}. - # @!attribute [rw] processor_version - # @return [::String] - # The resource name of the processor version produced by training. - class TrainProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metadata that represents a processor version being created. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - # @!attribute [rw] training_dataset_validation - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] - # The training dataset validation information. - # @!attribute [rw] test_dataset_validation - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] - # The test dataset validation information. - class TrainProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The dataset validation information. - # This includes any and all errors with documents and the dataset. - # @!attribute [rw] document_error_count - # @return [::Integer] - # The total number of document errors. - # @!attribute [rw] dataset_error_count - # @return [::Integer] - # The total number of dataset errors. - # @!attribute [rw] document_errors - # @return [::Array<::Google::Rpc::Status>] - # Error information pertaining to specific documents. A maximum of 10 - # document errors will be returned. - # Any document with errors will not be used throughout training. - # @!attribute [rw] dataset_errors - # @return [::Array<::Google::Rpc::Status>] - # Error information for the dataset as a whole. A maximum of 10 dataset - # errors will be returned. - # A single dataset error is terminal for training. - class DatasetValidation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} - # method. - # @!attribute [rw] inline_document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # An inline document proto. - # @!attribute [rw] human_review_config - # @return [::String] - # Required. The resource name of the - # [HumanReviewConfig][google.cloud.documentai.v1beta3.HumanReviewConfig] that - # the document will be reviewed with. - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # The document that needs human review. - # @!attribute [rw] enable_schema_validation - # @return [::Boolean] - # Whether the validation should be performed on the ad-hoc review request. - # @!attribute [rw] priority - # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] - # The document schema of the human review task. - class ReviewDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The priority level of the human review task. - module Priority - # The default priority level. - DEFAULT = 0 - - # The urgent priority level. The labeling manager should allocate labeler - # resource to the urgent task queue to respect this priority level. - URGENT = 1 - end - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} - # method. - # @!attribute [rw] gcs_destination - # @return [::String] - # The Cloud Storage uri for the human reviewed document if the review is - # succeeded. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentResponse::State] - # The state of the review operation. - # @!attribute [rw] rejection_reason - # @return [::String] - # The reason why the review is rejected by reviewer. - class ReviewDocumentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of the review operation. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # The review operation is rejected by the reviewer. - REJECTED = 1 - - # The review operation is succeeded. - SUCCEEDED = 2 - end - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document ReviewDocument} - # method. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentOperationMetadata::State] - # Used only when Operation.done is false. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # For example, the error message if the operation is failed. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - # @!attribute [rw] question_id - # @return [::String] - # The Crowd Compute question ID. - class ReviewDocumentOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the long-running operation. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # Operation is still running. - RUNNING = 1 - - # Operation is being cancelled. - CANCELLING = 2 - - # Operation succeeded. - SUCCEEDED = 3 - - # Operation failed. - FAILED = 4 - - # Operation is cancelled. - CANCELLED = 5 - end - end - - # Evaluates the given - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} against - # the supplied documents. - # @!attribute [rw] processor_version - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] evaluation_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # Optional. The documents used in the evaluation. If unspecified, use the - # processor's dataset as evaluation input. - class EvaluateProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version EvaluateProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long-running operation. - class EvaluateProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version EvaluateProcessorVersion} - # method. - # @!attribute [rw] evaluation - # @return [::String] - # The resource name of the created evaluation. - class EvaluateProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retrieves a specific Evaluation. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - class GetEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retrieves a list of evaluations for a given - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # list evaluations for. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # If unspecified, at most `5` evaluations are returned. - # The maximum value is `100`. Values above `100` are coerced to `100`. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListEvaluations` call. - # Provide this to retrieve the subsequent page. - class ListEvaluationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response from `ListEvaluations`. - # @!attribute [rw] evaluations - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # The evaluations requested. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListEvaluationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version ImportProcessorVersion} - # method. Requirements: - # - # - The Document AI [Service - # Agent](https://cloud.google.com/iam/docs/service-agents) of the destination - # project must have [Document AI Editor - # role](https://cloud.google.com/document-ai/docs/access-control/iam-roles) on - # the source project. - # - # The destination project is specified as part of the - # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest#parent parent} - # field. The source project is specified as part of the - # [source][ImportProcessorVersionRequest.processor_version_source or - # ImportProcessorVersionRequest.external_processor_version_source] field. - # @!attribute [rw] processor_version_source - # @return [::String] - # The source processor version to import from. The source processor version - # and destination processor need to be in the same environment and region. - # @!attribute [rw] external_processor_version_source - # @return [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource] - # The source processor version to import from, and can be from different - # environment and region than the destination processor. - # @!attribute [rw] parent - # @return [::String] - # Required. The destination processor name to create the processor version - # in. Format: - # `projects/{project}/locations/{location}/processors/{processor}` - class ImportProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The external source processor version. - # @!attribute [rw] processor_version - # @return [::String] - # Required. The processor version name. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] service_endpoint - # @return [::String] - # Optional. The Document AI service endpoint. For example, - # 'https://us-documentai.googleapis.com' - class ExternalProcessorVersionSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response message for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version ImportProcessorVersion} - # method. - # @!attribute [rw] processor_version - # @return [::String] - # The destination processor version name. - class ImportProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version ImportProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata for the long-running operation. - class ImportProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb deleted file mode 100644 index c16c2916787f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb +++ /dev/null @@ -1,186 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Metadata about a property. - # @!attribute [rw] inactive - # @return [::Boolean] - # Whether the property should be considered as "inactive". - class PropertyMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about an entity type. - # @!attribute [rw] inactive - # @return [::Boolean] - # Whether the entity type should be considered inactive. - class EntityTypeMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The schema defines the output of the processed document by a processor. - # @!attribute [rw] display_name - # @return [::String] - # Display name to show to users. - # @!attribute [rw] description - # @return [::String] - # Description of the schema. - # @!attribute [rw] entity_types - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType>] - # Entity types of the schema. - # @!attribute [rw] metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::Metadata] - # Metadata of the schema. - class DocumentSchema - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # EntityType is the wrapper of a label of the corresponding model with - # detailed attributes and limitations for entity-based processors. Multiple - # types can also compose a dependency tree to represent nested types. - # @!attribute [rw] enum_values - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::EnumValues] - # If specified, lists all the possible values for this entity. This - # should not be more than a handful of values. If the number of values - # is >10 or could change frequently use the `EntityType.value_ontology` - # field and specify a list of all possible values in a value ontology - # file. - # @!attribute [rw] display_name - # @return [::String] - # User defined name for the type. - # @!attribute [rw] name - # @return [::String] - # Name of the type. It must be unique within the schema file and - # cannot be a "Common Type". The following naming conventions are used: - # - # - Use `snake_casing`. - # - Name matching is case-sensitive. - # - Maximum 64 characters. - # - Must start with a letter. - # - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward - # compatibility internal infrastructure and tooling can handle any ascii - # character.) - # - The `/` is sometimes used to denote a property of a type. For example - # `line_item/amount`. This convention is deprecated, but will still be - # honored for backward compatibility. - # @!attribute [rw] base_types - # @return [::Array<::String>] - # The entity type that this type is derived from. For now, one and only - # one should be set. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property>] - # Description the nested structure, or composition of an entity. - # @!attribute [rw] entity_type_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::EntityTypeMetadata] - # Metadata for the entity type. - class EntityType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines the a list of enum values. - # @!attribute [rw] values - # @return [::Array<::String>] - # The individual values that this enum values type can include. - class EnumValues - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines properties that can be part of the entity type. - # @!attribute [rw] name - # @return [::String] - # The name of the property. Follows the same guidelines as the - # EntityType name. - # @!attribute [rw] value_type - # @return [::String] - # A reference to the value type of the property. This type is subject - # to the same conventions as the `Entity.base_types` field. - # @!attribute [rw] occurrence_type - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType] - # Occurrence type limits the number of instances an entity type appears - # in the document. - # @!attribute [rw] property_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata] - # Any additional metadata about the property can be added here. - class Property - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # 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`. - module OccurrenceType - # Unspecified occurrence type. - OCCURRENCE_TYPE_UNSPECIFIED = 0 - - # There will be zero or one instance of this entity type. The same - # entity instance may be mentioned multiple times. - OPTIONAL_ONCE = 1 - - # The entity type will appear zero or multiple times. - OPTIONAL_MULTIPLE = 2 - - # The entity type will only appear exactly once. The same - # entity instance may be mentioned multiple times. - REQUIRED_ONCE = 3 - - # The entity type will appear once or more times. - REQUIRED_MULTIPLE = 4 - end - end - end - - # Metadata for global schema behavior. - # @!attribute [rw] document_splitter - # @return [::Boolean] - # If true, a `document` entity type can be applied to subdocument - # (splitting). Otherwise, it can only be applied to the entire document - # (classification). - # @!attribute [rw] document_allow_multiple_labels - # @return [::Boolean] - # If true, on a given page, there can be multiple `document` annotations - # covering it. - # @!attribute [rw] prefixed_naming_on_properties - # @return [::Boolean] - # If set, all the nested entities must be prefixed with the parents. - # @!attribute [rw] skip_naming_validation - # @return [::Boolean] - # If set, we will skip the naming format validation in the schema. So the - # string values in `DocumentSchema.EntityType.name` and - # `DocumentSchema.EntityType.Property.name` will not be checked. - class Metadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb deleted file mode 100644 index d1750d2b9e5a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_service.rb +++ /dev/null @@ -1,275 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # @!attribute [rw] dataset - # @return [::Google::Cloud::DocumentAI::V1beta3::Dataset] - # Required. The `name` field of the `Dataset` is used to identify the - # resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The update mask applies to the resource. - class UpdateDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class UpdateDatasetOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] dataset - # @return [::String] - # Required. The dataset resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @!attribute [rw] batch_documents_import_configs - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig>] - # Required. The Cloud Storage uri containing raw documents that must be - # imported. - class ImportDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Config for importing documents. - # Each batch can have its own dataset split type. - # @!attribute [rw] dataset_split - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSplitType] - # Target dataset split where the documents must be stored. - # @!attribute [rw] auto_split_config - # @return [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig::AutoSplitConfig] - # If set, documents will be automatically split into training and test - # split category with the specified ratio. - # @!attribute [rw] batch_input_config - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # The common config to specify a set of documents used as input. - class BatchDocumentsImportConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The config for auto-split. - # @!attribute [rw] training_split_ratio - # @return [::Float] - # Ratio of training dataset split. - class AutoSplitConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Response of the import document operation. - class ImportDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of the import document operation. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - # @!attribute [rw] individual_import_statuses - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsMetadata::IndividualImportStatus>] - # The list of response details of each document. - # @!attribute [rw] import_config_validation_results - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsMetadata::ImportConfigValidationResult>] - # Validation statuses of the batch documents import config. - # @!attribute [rw] total_document_count - # @return [::Integer] - # Total number of the documents that are qualified for importing. - class ImportDocumentsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of each individual document in the import process. - # @!attribute [rw] input_gcs_source - # @return [::String] - # The source Cloud Storage URI of the document. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status of the importing of the document. - # @!attribute [rw] output_document_id - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId] - # The document id of imported document if it was successful, otherwise - # empty. - class IndividualImportStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The validation status of each import config. Status is set to errors if - # there is no documents to import in the import_config, or OK if the - # operation will try to proceed at least one document. - # @!attribute [rw] input_gcs_source - # @return [::String] - # The source Cloud Storage URI specified in the import config. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The validation status of import config. - class ImportConfigValidationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] dataset - # @return [::String] - # Required. The resource name of the dataset that the document belongs to . - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @!attribute [rw] document_id - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId] - # Required. Document identifier. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # If set, only fields listed here will be returned. Otherwise, all fields - # will be returned by default. - # @!attribute [rw] page_range - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange] - # List of pages for which the fields specified in the `read_mask` must - # be served. - class GetDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - class GetDocumentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] dataset - # @return [::String] - # Required. The dataset resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset - # @!attribute [rw] dataset_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments] - # Required. Dataset documents input. If given `filter`, all documents - # satisfying the filter will be deleted. If given documentIds, a maximum of - # 50 documents can be deleted in a batch. The request will be rejected if - # more than 50 document_ids are provided. - class BatchDeleteDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the delete documents operation. - class BatchDeleteDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - # @!attribute [rw] individual_batch_delete_statuses - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsMetadata::IndividualBatchDeleteStatus>] - # The list of response details of each document. - # @!attribute [rw] total_document_count - # @return [::Integer] - # Total number of documents deleting from dataset. - # @!attribute [rw] error_document_count - # @return [::Integer] - # Total number of documents that failed to be deleted in storage. - class BatchDeleteDocumentsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of each individual document in the batch delete process. - # @!attribute [rw] document_id - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentId] - # The document id of the document. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status of deleting the document in storage. - class IndividualBatchDeleteStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request for `GetDatasetSchema`. - # @!attribute [rw] name - # @return [::String] - # Required. The dataset schema resource name. - # Format: - # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset/datasetSchema - # @!attribute [rw] visible_fields_only - # @return [::Boolean] - # If set, only returns the visible fields of the schema. - class GetDatasetSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for `UpdateDatasetSchema`. - # @!attribute [rw] dataset_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] - # Required. The name field of the `DatasetSchema` is used to identify the - # resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The update mask applies to the resource. - class UpdateDatasetSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Range of pages present in a document. - # @!attribute [rw] start - # @return [::Integer] - # First page number (one-based index) to be returned. - # @!attribute [rw] end - # @return [::Integer] - # Last page number (one-based index) to be returned. - class DocumentPageRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Documents belonging to a dataset will be split into different groups - # referred to as splits: train, test. - module DatasetSplitType - # Default value if the enum is not set. - # go/protodosdonts#do-include-an-unspecified-value-in-an-enum - DATASET_SPLIT_TYPE_UNSPECIFIED = 0 - - # Identifies the train documents. - DATASET_SPLIT_TRAIN = 1 - - # Identifies the test documents. - DATASET_SPLIT_TEST = 2 - - # Identifies the unassigned documents. - DATASET_SPLIT_UNASSIGNED = 3 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb deleted file mode 100644 index 95fe6e3ce601..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb +++ /dev/null @@ -1,199 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Gives a short summary of an evaluation, and links to the evaluation itself. - # @!attribute [rw] operation - # @return [::String] - # The resource name of the Long Running Operation for the evaluation. - # @!attribute [rw] evaluation - # @return [::String] - # The resource name of the evaluation. - # @!attribute [rw] aggregate_metrics - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] - # An aggregate of the statistics for the evaluation with fuzzy matching on. - # @!attribute [rw] aggregate_metrics_exact - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] - # An aggregate of the statistics for the evaluation with fuzzy matching off. - class EvaluationReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An evaluation of a ProcessorVersion's performance. - # @!attribute [rw] name - # @return [::String] - # The resource name of the evaluation. - # Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time that the evaluation was created. - # @!attribute [rw] document_counters - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Counters] - # Counters for the documents used in the evaluation. - # @!attribute [rw] all_entities_metrics - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] - # Metrics for all the entities in aggregate. - # @!attribute [rw] entity_metrics - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics}] - # Metrics across confidence levels, for different entities. - # @!attribute [rw] kms_key_name - # @return [::String] - # The KMS key name used for encryption. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # The KMS key version with which data is encrypted. - class Evaluation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Evaluation counters for the documents that were used. - # @!attribute [rw] input_documents_count - # @return [::Integer] - # How many documents were sent for evaluation. - # @!attribute [rw] invalid_documents_count - # @return [::Integer] - # How many documents were not included in the evaluation as they didn't - # pass validation. - # @!attribute [rw] failed_documents_count - # @return [::Integer] - # How many documents were not included in the evaluation as Document AI - # failed to process them. - # @!attribute [rw] evaluated_documents_count - # @return [::Integer] - # How many documents were used in the evaluation. - class Counters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluation metrics, either in aggregate or about a specific entity. - # @!attribute [rw] precision - # @return [::Float] - # The calculated precision. - # @!attribute [rw] recall - # @return [::Float] - # The calculated recall. - # @!attribute [rw] f1_score - # @return [::Float] - # The calculated f1 score. - # @!attribute [rw] predicted_occurrences_count - # @return [::Integer] - # The amount of occurrences in predicted documents. - # @!attribute [rw] ground_truth_occurrences_count - # @return [::Integer] - # The amount of occurrences in ground truth documents. - # @!attribute [rw] predicted_document_count - # @return [::Integer] - # The amount of documents with a predicted occurrence. - # @!attribute [rw] ground_truth_document_count - # @return [::Integer] - # The amount of documents with a ground truth occurrence. - # @!attribute [rw] true_positives_count - # @return [::Integer] - # The amount of true positives. - # @!attribute [rw] false_positives_count - # @return [::Integer] - # The amount of false positives. - # @!attribute [rw] false_negatives_count - # @return [::Integer] - # The amount of false negatives. - # @!attribute [rw] total_documents_count - # @return [::Integer] - # The amount of documents that had an occurrence of this label. - class Metrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluations metrics, at a specific confidence level. - # @!attribute [rw] confidence_level - # @return [::Float] - # The confidence level. - # @!attribute [rw] metrics - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] - # The metrics at the specific confidence level. - class ConfidenceLevelMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metrics across multiple confidence levels. - # @!attribute [rw] confidence_level_metrics - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] - # Metrics across confidence levels with fuzzy matching enabled. - # @!attribute [rw] confidence_level_metrics_exact - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] - # Metrics across confidence levels with only exact matching. - # @!attribute [rw] auprc - # @return [::Float] - # The calculated area under the precision recall curve (AUPRC), computed by - # integrating over all confidence thresholds. - # @!attribute [rw] estimated_calibration_error - # @return [::Float] - # The Estimated Calibration Error (ECE) of the confidence of the predicted - # entities. - # @!attribute [rw] auprc_exact - # @return [::Float] - # The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching - # only. - # @!attribute [rw] estimated_calibration_error_exact - # @return [::Float] - # The ECE for the predicted entities with fuzzy matching disabled, i.e., - # exact matching only. - # @!attribute [rw] metrics_type - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics::MetricsType] - # The metrics type for the label. - class MultiConfidenceMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A type that determines how metrics should be interpreted. - module MetricsType - # The metrics type is unspecified. By default, metrics without a - # particular specification are for leaf entity types (i.e., top-level - # entity types without child types, or child types which are not - # parent types themselves). - METRICS_TYPE_UNSPECIFIED = 0 - - # Indicates whether metrics for this particular label type represent an - # aggregate of metrics for other types instead of being based on actual - # TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) - # entity types are an aggregate of metrics for their children. - AGGREGATE = 1 - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] - class EntityMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb deleted file mode 100644 index 6beba3a11eb1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # A vertex represents a 2D point in the image. - # NOTE: the vertex coordinates are in the same scale as the original image. - # @!attribute [rw] x - # @return [::Integer] - # X coordinate. - # @!attribute [rw] y - # @return [::Integer] - # Y coordinate (starts from the top of the image). - class Vertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A vertex represents a 2D point in the image. - # NOTE: the normalized vertex coordinates are relative to the original image - # and range from 0 to 1. - # @!attribute [rw] x - # @return [::Float] - # X coordinate. - # @!attribute [rw] y - # @return [::Float] - # Y coordinate (starts from the top of the image). - class NormalizedVertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A bounding polygon for the detected image annotation. - # @!attribute [rw] vertices - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Vertex>] - # The bounding polygon vertices. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::NormalizedVertex>] - # The bounding polygon normalized vertices. - class BoundingPoly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb deleted file mode 100644 index 663e5b3fa6b1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # The common metadata for long running operations. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State] - # The state of the operation. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # @!attribute [rw] resource - # @return [::String] - # A related resource to this operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - class CommonOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the longrunning operation. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # Operation is still running. - RUNNING = 1 - - # Operation is being cancelled. - CANCELLING = 2 - - # Operation succeeded. - SUCCEEDED = 3 - - # Operation failed. - FAILED = 4 - - # Operation is cancelled. - CANCELLED = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb deleted file mode 100644 index f3e2e0c5ee49..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb +++ /dev/null @@ -1,180 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # A processor version is an implementation of a processor. Each processor - # can have multiple versions, pretrained by Google internally or uptrained - # by the customer. A processor can only have one default version at a time. - # Its document-processing behavior is defined by that version. - # @!attribute [rw] name - # @return [::String] - # The resource name of the processor version. - # Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - # @!attribute [rw] display_name - # @return [::String] - # The display name of the processor version. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] - # The schema of the processor version. Describes the output. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::State] - # The state of the processor version. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the processor version was created. - # @!attribute [rw] latest_evaluation - # @return [::Google::Cloud::DocumentAI::V1beta3::EvaluationReference] - # The most recently invoked evaluation for the processor version. - # @!attribute [rw] kms_key_name - # @return [::String] - # The KMS key name used for encryption. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # The KMS key version with which data is encrypted. - # @!attribute [r] google_managed - # @return [::Boolean] - # Output only. Denotes that this `ProcessorVersion` is managed by Google. - # @!attribute [rw] deprecation_info - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::DeprecationInfo] - # If set, information about the eventual deprecation of this version. - class ProcessorVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about the upcoming deprecation of this processor version. - # @!attribute [rw] deprecation_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this processor version will be deprecated. - # @!attribute [rw] replacement_processor_version - # @return [::String] - # If set, the processor version that will be used as a replacement. - class DeprecationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The possible states of the processor version. - module State - # The processor version is in an unspecified state. - STATE_UNSPECIFIED = 0 - - # The processor version is deployed and can be used for processing. - DEPLOYED = 1 - - # The processor version is being deployed. - DEPLOYING = 2 - - # The processor version is not deployed and cannot be used for processing. - UNDEPLOYED = 3 - - # The processor version is being undeployed. - UNDEPLOYING = 4 - - # The processor version is being created. - CREATING = 5 - - # The processor version is being deleted. - DELETING = 6 - - # The processor version failed and is in an indeterminate state. - FAILED = 7 - - # The processor version is being imported. - IMPORTING = 8 - end - end - - # The first-class citizen for Document AI. Each processor defines how to - # extract structural information from a document. - # @!attribute [r] name - # @return [::String] - # Output only. Immutable. The resource name of the processor. - # Format: `projects/{project}/locations/{location}/processors/{processor}` - # @!attribute [rw] type - # @return [::String] - # The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - # To get a list of processor types, see - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes}. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the processor. - # @!attribute [r] state - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor::State] - # Output only. The state of the processor. - # @!attribute [rw] default_processor_version - # @return [::String] - # The default processor version. - # @!attribute [r] process_endpoint - # @return [::String] - # Output only. Immutable. The http endpoint that can be called to invoke - # processing. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the processor was created. - # @!attribute [rw] kms_key_name - # @return [::String] - # The [KMS key](https://cloud.google.com/security-key-management) used for - # encryption and decryption in CMEK scenarios. - class Processor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible states of the processor. - module State - # The processor is in an unspecified state. - STATE_UNSPECIFIED = 0 - - # The processor is enabled, i.e., has an enabled version which can - # currently serve processing requests and all the feature dependencies have - # been successfully initialized. - ENABLED = 1 - - # The processor is disabled. - DISABLED = 2 - - # The processor is being enabled, will become `ENABLED` if successful. - ENABLING = 3 - - # The processor is being disabled, will become `DISABLED` if successful. - DISABLING = 4 - - # The processor is being created, will become either `ENABLED` (for - # successful creation) or `FAILED` (for failed ones). - # Once a processor is in this state, it can then be used for document - # processing, but the feature dependencies of the processor might not be - # fully created yet. - CREATING = 5 - - # The processor failed during creation or initialization of feature - # dependencies. The user should delete the processor and recreate one as - # all the functionalities of the processor are disabled. - FAILED = 6 - - # The processor is being deleted, will be removed if successful. - DELETING = 7 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb deleted file mode 100644 index d0ea070d91fa..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # A processor type is responsible for performing a certain document - # understanding task on a certain type of document. - # @!attribute [rw] name - # @return [::String] - # The resource name of the processor type. - # Format: `projects/{project}/processorTypes/{processor_type}` - # @!attribute [rw] type - # @return [::String] - # The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - # @!attribute [rw] category - # @return [::String] - # The processor category, used by UI to group processor types. - # @!attribute [rw] available_locations - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType::LocationInfo>] - # The locations in which this processor is available. - # @!attribute [rw] allow_creation - # @return [::Boolean] - # Whether the processor type allows creation. If true, users can create a - # processor of this processor type. Otherwise, users need to request access. - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of the processor type - # @!attribute [rw] sample_document_uris - # @return [::Array<::String>] - # A set of Cloud Storage URIs of sample documents for this processor. - class ProcessorType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The location information about where the processor is available. - # @!attribute [rw] location_id - # @return [::String] - # The location ID. For supported locations, refer to [regional and - # multi-regional support](/document-ai/docs/regions). - class LocationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 08ab43c84ae9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 629894f93777..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b4a53d0ac67f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 4c0ad96e8eb9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index c437e42a7581..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index b7de80e5ed7f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 3f28f1fb18f6..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb deleted file mode 100644 index 6f72e88c418d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb deleted file mode 100644 index 139261bdf919..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb +++ /dev/null @@ -1,173 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a color in the RGBA color space. This representation is designed - # for simplicity of conversion to/from color representations in various - # languages over compactness. For example, the fields of this representation - # can be trivially provided to the constructor of `java.awt.Color` in Java; it - # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` - # method in iOS; and, with just a little work, it can be easily formatted into - # a CSS `rgba()` string in JavaScript. - # - # This reference page doesn't carry information about the absolute color - # space - # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, - # DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color - # space. - # - # When color equality needs to be decided, implementations, unless - # documented otherwise, treat two colors as equal if all their red, - # green, blue, and alpha values each differ by at most 1e-5. - # - # Example (Java): - # - # import com.google.type.Color; - # - # // ... - # public static java.awt.Color fromProto(Color protocolor) { - # float alpha = protocolor.hasAlpha() - # ? protocolor.getAlpha().getValue() - # : 1.0; - # - # return new java.awt.Color( - # protocolor.getRed(), - # protocolor.getGreen(), - # protocolor.getBlue(), - # alpha); - # } - # - # public static Color toProto(java.awt.Color color) { - # float red = (float) color.getRed(); - # float green = (float) color.getGreen(); - # float blue = (float) color.getBlue(); - # float denominator = 255.0; - # Color.Builder resultBuilder = - # Color - # .newBuilder() - # .setRed(red / denominator) - # .setGreen(green / denominator) - # .setBlue(blue / denominator); - # int alpha = color.getAlpha(); - # if (alpha != 255) { - # result.setAlpha( - # FloatValue - # .newBuilder() - # .setValue(((float) alpha) / denominator) - # .build()); - # } - # return resultBuilder.build(); - # } - # // ... - # - # Example (iOS / Obj-C): - # - # // ... - # static UIColor* fromProto(Color* protocolor) { - # float red = [protocolor red]; - # float green = [protocolor green]; - # float blue = [protocolor blue]; - # FloatValue* alpha_wrapper = [protocolor alpha]; - # float alpha = 1.0; - # if (alpha_wrapper != nil) { - # alpha = [alpha_wrapper value]; - # } - # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; - # } - # - # static Color* toProto(UIColor* color) { - # CGFloat red, green, blue, alpha; - # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - # return nil; - # } - # Color* result = [[Color alloc] init]; - # [result setRed:red]; - # [result setGreen:green]; - # [result setBlue:blue]; - # if (alpha <= 0.9999) { - # [result setAlpha:floatWrapperWithValue(alpha)]; - # } - # [result autorelease]; - # return result; - # } - # // ... - # - # Example (JavaScript): - # - # // ... - # - # var protoToCssColor = function(rgb_color) { - # var redFrac = rgb_color.red || 0.0; - # var greenFrac = rgb_color.green || 0.0; - # var blueFrac = rgb_color.blue || 0.0; - # var red = Math.floor(redFrac * 255); - # var green = Math.floor(greenFrac * 255); - # var blue = Math.floor(blueFrac * 255); - # - # if (!('alpha' in rgb_color)) { - # return rgbToCssColor(red, green, blue); - # } - # - # var alphaFrac = rgb_color.alpha.value || 0.0; - # var rgbParams = [red, green, blue].join(','); - # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); - # }; - # - # var rgbToCssColor = function(red, green, blue) { - # var rgbNumber = new Number((red << 16) | (green << 8) | blue); - # var hexString = rgbNumber.toString(16); - # var missingZeros = 6 - hexString.length; - # var resultBuilder = ['#']; - # for (var i = 0; i < missingZeros; i++) { - # resultBuilder.push('0'); - # } - # resultBuilder.push(hexString); - # return resultBuilder.join(''); - # }; - # - # // ... - # @!attribute [rw] red - # @return [::Float] - # The amount of red in the color as a value in the interval [0, 1]. - # @!attribute [rw] green - # @return [::Float] - # The amount of green in the color as a value in the interval [0, 1]. - # @!attribute [rw] blue - # @return [::Float] - # The amount of blue in the color as a value in the interval [0, 1]. - # @!attribute [rw] alpha - # @return [::Google::Protobuf::FloatValue] - # The fraction of this color that should be applied to the pixel. That is, - # the final pixel color is defined by the equation: - # - # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` - # - # This means that a value of 1.0 corresponds to a solid color, whereas - # a value of 0.0 corresponds to a completely transparent color. This - # uses a wrapper message rather than a simple float scalar so that it is - # possible to distinguish between a default value and the value being unset. - # If omitted, this color object is rendered as a solid color - # (as if the alpha value had been explicitly given a value of 1.0). - class Color - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb deleted file mode 100644 index 086a71b4869a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a whole or partial calendar date, such as a birthday. The time of - # day and time zone are either specified elsewhere or are insignificant. The - # date is relative to the Gregorian Calendar. This can represent one of the - # following: - # - # * A full date, with non-zero year, month, and day values - # * A month and day value, with a zero year, such as an anniversary - # * A year on its own, with zero month and day values - # * A year and month value, with a zero day, such as a credit card expiration - # date - # - # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] year - # @return [::Integer] - # Year of the date. Must be from 1 to 9999, or 0 to specify a date without - # a year. - # @!attribute [rw] month - # @return [::Integer] - # Month of a year. Must be from 1 to 12, or 0 to specify a year without a - # month and day. - # @!attribute [rw] day - # @return [::Integer] - # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 - # to specify a year by itself or a year and month where the day isn't - # significant. - class Date - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb deleted file mode 100644 index 2d8961edc217..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents civil time (or occasionally physical time). - # - # This type can represent a civil time in one of a few possible ways: - # - # * When utc_offset is set and time_zone is unset: a civil time on a calendar - # day with a particular offset from UTC. - # * When time_zone is set and utc_offset is unset: a civil time on a calendar - # day in a particular time zone. - # * When neither time_zone nor utc_offset is set: a civil time on a calendar - # day in local time. - # - # The date is relative to the Proleptic Gregorian Calendar. - # - # If year is 0, the DateTime is considered not to have a specific year. month - # and day must have valid, non-zero values. - # - # This type may also be used to represent a physical time if all the date and - # time fields are set and either case of the `time_offset` oneof is set. - # Consider using `Timestamp` message for physical time instead. If your use - # case also would like to store the user's timezone, that can be done in - # another field. - # - # This type is more flexible than some applications may want. Make sure to - # document and validate your application's limitations. - # @!attribute [rw] year - # @return [::Integer] - # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a - # datetime without a year. - # @!attribute [rw] month - # @return [::Integer] - # Required. Month of year. Must be from 1 to 12. - # @!attribute [rw] day - # @return [::Integer] - # Required. Day of month. Must be from 1 to 31 and valid for the year and - # month. - # @!attribute [rw] hours - # @return [::Integer] - # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API - # may choose to allow the value "24:00:00" for scenarios like business - # closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Required. Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An - # API may allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Required. Fractions of seconds in nanoseconds. Must be from 0 to - # 999,999,999. - # @!attribute [rw] utc_offset - # @return [::Google::Protobuf::Duration] - # UTC offset. Must be whole seconds, between -18 hours and +18 hours. - # For example, a UTC offset of -4:00 would be represented as - # { seconds: -14400 }. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone. - class DateTime - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a time zone from the - # [IANA Time Zone Database](https://www.iana.org/time-zones). - # @!attribute [rw] id - # @return [::String] - # IANA Time Zone Database time zone, e.g. "America/New_York". - # @!attribute [rw] version - # @return [::String] - # Optional. IANA Time Zone Database version number, e.g. "2019a". - class TimeZone - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb deleted file mode 100644 index 800ef43f01cb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents an amount of money with its currency type. - # @!attribute [rw] currency_code - # @return [::String] - # The three-letter currency code defined in ISO 4217. - # @!attribute [rw] units - # @return [::Integer] - # The whole units of the amount. - # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - # @!attribute [rw] nanos - # @return [::Integer] - # Number of nano (10^-9) units of the amount. - # The value must be between -999,999,999 and +999,999,999 inclusive. - # If `units` is positive, `nanos` must be positive or zero. - # If `units` is zero, `nanos` can be positive, zero, or negative. - # If `units` is negative, `nanos` must be negative or zero. - # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - class Money - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb deleted file mode 100644 index cd58486c563e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a postal address, e.g. for postal delivery or payments addresses. - # Given a postal address, a postal service can deliver items to a premise, P.O. - # Box or similar. - # It is not intended to model geographical locations (roads, towns, - # mountains). - # - # In typical usage an address would be created via user input or from importing - # existing data, depending on the type of process. - # - # Advice on address input / editing: - # - Use an i18n-ready address widget such as - # https://github.com/google/libaddressinput) - # - Users should not be presented with UI elements for input or editing of - # fields outside countries where that field is used. - # - # For more guidance on how to use this schema, please see: - # https://support.google.com/business/answer/6397478 - # @!attribute [rw] revision - # @return [::Integer] - # The schema revision of the `PostalAddress`. This must be set to 0, which is - # the latest revision. - # - # All new revisions **must** be backward compatible with old revisions. - # @!attribute [rw] region_code - # @return [::String] - # Required. CLDR region code of the country/region of the address. This - # is never inferred and it is up to the user to ensure the value is - # correct. See http://cldr.unicode.org/ and - # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] language_code - # @return [::String] - # Optional. BCP-47 language code of the contents of this address (if - # known). This is often the UI language of the input form or is expected - # to match one of the languages used in the address' country/region, or their - # transliterated equivalents. - # This can affect formatting in certain countries, but is not critical - # to the correctness of the data and will never affect any validation or - # other non-formatting related operations. - # - # If this value is not known, it should be omitted (rather than specifying a - # possibly incorrect default). - # - # Examples: "zh-Hant", "ja", "ja-Latn", "en". - # @!attribute [rw] postal_code - # @return [::String] - # Optional. Postal code of the address. Not all countries use or require - # postal codes to be present, but where they are used, they may trigger - # additional validation with other parts of the address (e.g. state/zip - # validation in the U.S.A.). - # @!attribute [rw] sorting_code - # @return [::String] - # Optional. Additional, country-specific, sorting code. This is not used - # in most regions. Where it is used, the value is either a string like - # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number - # alone, representing the "sector code" (Jamaica), "delivery area indicator" - # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). - # @!attribute [rw] administrative_area - # @return [::String] - # Optional. Highest administrative subdivision which is used for postal - # addresses of a country or region. - # For example, this can be a state, a province, an oblast, or a prefecture. - # Specifically, for Spain this is the province and not the autonomous - # community (e.g. "Barcelona" and not "Catalonia"). - # Many countries don't use an administrative area in postal addresses. E.g. - # in Switzerland this should be left unpopulated. - # @!attribute [rw] locality - # @return [::String] - # Optional. Generally refers to the city/town portion of the address. - # Examples: US city, IT comune, UK post town. - # In regions of the world where localities are not well defined or do not fit - # into this structure well, leave locality empty and use address_lines. - # @!attribute [rw] sublocality - # @return [::String] - # Optional. Sublocality of the address. - # For example, this can be neighborhoods, boroughs, districts. - # @!attribute [rw] address_lines - # @return [::Array<::String>] - # Unstructured address lines describing the lower levels of an address. - # - # Because values in address_lines do not have type information and may - # sometimes contain multiple values in a single field (e.g. - # "Austin, TX"), it is important that the line order is clear. The order of - # address lines should be "envelope order" for the country/region of the - # address. In places where this can vary (e.g. Japan), address_language is - # used to make it explicit (e.g. "ja" for large-to-small ordering and - # "ja-Latn" or "en" for small-to-large). This way, the most specific line of - # an address can be selected based on the language. - # - # The minimum permitted structural representation of an address consists - # of a region_code with all remaining information placed in the - # address_lines. It would be possible to format such an address very - # approximately without geocoding, but no semantic reasoning could be - # made about any of the address components until it was at least - # partially resolved. - # - # Creating an address only containing a region_code and address_lines, and - # then geocoding is the recommended way to handle completely unstructured - # addresses (as opposed to guessing which parts of the address should be - # localities or administrative areas). - # @!attribute [rw] recipients - # @return [::Array<::String>] - # Optional. The recipient at the address. - # This field may, under certain circumstances, contain multiline information. - # For example, it might contain "care of" information. - # @!attribute [rw] organization - # @return [::String] - # Optional. The name of the organization at the address. - class PostalAddress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile deleted file mode 100644 index 83a1cdf1d4f1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-document_ai-v1beta3", path: "../" -else - gem "google-cloud-document_ai-v1beta3" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb deleted file mode 100644 index fa3a60379df8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the batch_process_documents call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents. -# It may require modification in order to execute successfully. -# -def batch_process_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new - - # Call the batch_process_documents method. - result = client.batch_process_documents request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb deleted file mode 100644 index defc60d73542..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the create_processor call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor. -# It may require modification in order to execute successfully. -# -def create_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new - - # Call the create_processor method. - result = client.create_processor request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb deleted file mode 100644 index 2a1145291dee..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the delete_processor call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor. -# It may require modification in order to execute successfully. -# -def delete_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new - - # Call the delete_processor method. - result = client.delete_processor request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb deleted file mode 100644 index c897494ffc8b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the delete_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version. -# It may require modification in order to execute successfully. -# -def delete_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new - - # Call the delete_processor_version method. - result = client.delete_processor_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb deleted file mode 100644 index 0170c85c4c1d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the deploy_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version. -# It may require modification in order to execute successfully. -# -def deploy_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new - - # Call the deploy_processor_version method. - result = client.deploy_processor_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb deleted file mode 100644 index 8a5bd99db3a1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the disable_processor call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor. -# It may require modification in order to execute successfully. -# -def disable_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new - - # Call the disable_processor method. - result = client.disable_processor request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb deleted file mode 100644 index 2ba25bf182c3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the enable_processor call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor. -# It may require modification in order to execute successfully. -# -def enable_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new - - # Call the enable_processor method. - result = client.enable_processor request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb deleted file mode 100644 index 28e5ab341f8d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the evaluate_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version. -# It may require modification in order to execute successfully. -# -def evaluate_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new - - # Call the evaluate_processor_version method. - result = client.evaluate_processor_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb deleted file mode 100644 index 9e863b30ff58..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the fetch_processor_types call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types. -# It may require modification in order to execute successfully. -# -def fetch_processor_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new - - # Call the fetch_processor_types method. - result = client.fetch_processor_types request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb deleted file mode 100644 index 1c31420e55d3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the get_evaluation call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation. -# It may require modification in order to execute successfully. -# -def get_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new - - # Call the get_evaluation method. - result = client.get_evaluation request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb deleted file mode 100644 index 75a79fcc7db4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the get_processor call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor. -# It may require modification in order to execute successfully. -# -def get_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new - - # Call the get_processor method. - result = client.get_processor request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb deleted file mode 100644 index ea4ac6aaa00d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the get_processor_type call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type. -# It may require modification in order to execute successfully. -# -def get_processor_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new - - # Call the get_processor_type method. - result = client.get_processor_type request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb deleted file mode 100644 index fc2447d64cc3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the get_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version. -# It may require modification in order to execute successfully. -# -def get_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new - - # Call the get_processor_version method. - result = client.get_processor_version request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb deleted file mode 100644 index 162b8eeb4f8e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/import_processor_version.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the import_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version. -# It may require modification in order to execute successfully. -# -def import_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new - - # Call the import_processor_version method. - result = client.import_processor_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb deleted file mode 100644 index efa06cf7b855..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the list_evaluations call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations. -# It may require modification in order to execute successfully. -# -def list_evaluations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new - - # Call the list_evaluations method. - result = client.list_evaluations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. - p item - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb deleted file mode 100644 index eb6ab8a5ad6a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the list_processor_types call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types. -# It may require modification in order to execute successfully. -# -def list_processor_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new - - # Call the list_processor_types method. - result = client.list_processor_types request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. - p item - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb deleted file mode 100644 index a159efcb88eb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the list_processor_versions call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions. -# It may require modification in order to execute successfully. -# -def list_processor_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new - - # Call the list_processor_versions method. - result = client.list_processor_versions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - p item - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb deleted file mode 100644 index ccb002bb2b36..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the list_processors call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors. -# It may require modification in order to execute successfully. -# -def list_processors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new - - # Call the list_processors method. - result = client.list_processors request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. - p item - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb deleted file mode 100644 index bec241717ea4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the process_document call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document. -# It may require modification in order to execute successfully. -# -def process_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new - - # Call the process_document method. - result = client.process_document request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb deleted file mode 100644 index 0327a3f4c18d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the review_document call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document. -# It may require modification in order to execute successfully. -# -def review_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new - - # Call the review_document method. - result = client.review_document request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb deleted file mode 100644 index fd64302ce285..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the set_default_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version. -# It may require modification in order to execute successfully. -# -def set_default_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new - - # Call the set_default_processor_version method. - result = client.set_default_processor_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb deleted file mode 100644 index 0b788c5f9e3f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the train_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version. -# It may require modification in order to execute successfully. -# -def train_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new - - # Call the train_processor_version method. - result = client.train_processor_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb deleted file mode 100644 index d847773d49b3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the undeploy_processor_version call in the DocumentProcessorService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version. -# It may require modification in order to execute successfully. -# -def undeploy_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new - - # Call the undeploy_processor_version method. - result = client.undeploy_processor_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb deleted file mode 100644 index b643a881aef7..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/batch_delete_documents.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the batch_delete_documents call in the DocumentService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#batch_delete_documents. -# It may require modification in order to execute successfully. -# -def batch_delete_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new - - # Call the batch_delete_documents method. - result = client.batch_delete_documents request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb deleted file mode 100644 index 9ef2f0aaf4ab..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_dataset_schema.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentService_GetDatasetSchema_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the get_dataset_schema call in the DocumentService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_dataset_schema. -# It may require modification in order to execute successfully. -# -def get_dataset_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new - - # Call the get_dataset_schema method. - result = client.get_dataset_schema request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. - p result -end -# [END documentai_v1beta3_generated_DocumentService_GetDatasetSchema_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb deleted file mode 100644 index 171affa9ffec..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/get_document.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentService_GetDocument_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the get_document call in the DocumentService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_document. It -# may require modification in order to execute successfully. -# -def get_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new - - # Call the get_document method. - result = client.get_document request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse. - p result -end -# [END documentai_v1beta3_generated_DocumentService_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb deleted file mode 100644 index 18f8df9efb64..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/import_documents.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentService_ImportDocuments_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the import_documents call in the DocumentService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#import_documents. -# It may require modification in order to execute successfully. -# -def import_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new - - # Call the import_documents method. - result = client.import_documents request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentService_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb deleted file mode 100644 index c7fd118cac31..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentService_UpdateDataset_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the update_dataset call in the DocumentService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset. It -# may require modification in order to execute successfully. -# -def update_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new - - # Call the update_dataset method. - result = client.update_dataset request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END documentai_v1beta3_generated_DocumentService_UpdateDataset_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb deleted file mode 100644 index e1fe019bdad5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_service/update_dataset_schema.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Snippet for the update_dataset_schema call in the DocumentService service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset_schema. -# It may require modification in order to execute successfully. -# -def update_dataset_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new - - # Call the update_dataset_schema method. - result = client.update_dataset_schema request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. - p result -end -# [END documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json deleted file mode 100644 index e5668ebe3210..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json +++ /dev/null @@ -1,1175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-document_ai-v1beta3", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.documentai.v1beta3", - "version": "v1beta3" - } - ] - }, - "snippets": [ - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync", - "title": "Snippet for the process_document call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document. It may require modification in order to execute successfully.", - "file": "document_processor_service/process_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "process_document", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ProcessDocument", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync", - "title": "Snippet for the batch_process_documents call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents. It may require modification in order to execute successfully.", - "file": "document_processor_service/batch_process_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_process_documents", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "BatchProcessDocuments", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync", - "title": "Snippet for the fetch_processor_types call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types. It may require modification in order to execute successfully.", - "file": "document_processor_service/fetch_processor_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_processor_types", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "FetchProcessorTypes", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync", - "title": "Snippet for the list_processor_types call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types. It may require modification in order to execute successfully.", - "file": "document_processor_service/list_processor_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processor_types", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessorTypes", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync", - "title": "Snippet for the get_processor_type call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type. It may require modification in order to execute successfully.", - "file": "document_processor_service/get_processor_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor_type", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorType", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessorType", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync", - "title": "Snippet for the list_processors call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors. It may require modification in order to execute successfully.", - "file": "document_processor_service/list_processors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processors", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessors", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync", - "title": "Snippet for the get_processor call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor. It may require modification in order to execute successfully.", - "file": "document_processor_service/get_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync", - "title": "Snippet for the train_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/train_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "train_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "TrainProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync", - "title": "Snippet for the get_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/get_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync", - "title": "Snippet for the list_processor_versions call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions. It may require modification in order to execute successfully.", - "file": "document_processor_service/list_processor_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processor_versions", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessorVersions", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync", - "title": "Snippet for the delete_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/delete_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeleteProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync", - "title": "Snippet for the deploy_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/deploy_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeployProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync", - "title": "Snippet for the undeploy_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/undeploy_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "undeploy_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "UndeployProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync", - "title": "Snippet for the create_processor call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor. It may require modification in order to execute successfully.", - "file": "document_processor_service/create_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "CreateProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync", - "title": "Snippet for the delete_processor call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor. It may require modification in order to execute successfully.", - "file": "document_processor_service/delete_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeleteProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync", - "title": "Snippet for the enable_processor call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor. It may require modification in order to execute successfully.", - "file": "document_processor_service/enable_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "EnableProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync", - "title": "Snippet for the disable_processor call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor. It may require modification in order to execute successfully.", - "file": "document_processor_service/disable_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DisableProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync", - "title": "Snippet for the set_default_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/set_default_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_default_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "SetDefaultProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync", - "title": "Snippet for the review_document call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document. It may require modification in order to execute successfully.", - "file": "document_processor_service/review_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "review_document", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ReviewDocument", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync", - "title": "Snippet for the evaluate_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/evaluate_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "evaluate_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "EvaluateProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync", - "title": "Snippet for the get_evaluation call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation. It may require modification in order to execute successfully.", - "file": "document_processor_service/get_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_evaluation", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::Evaluation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetEvaluation", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync", - "title": "Snippet for the list_evaluations call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations. It may require modification in order to execute successfully.", - "file": "document_processor_service/list_evaluations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_evaluations", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListEvaluations", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_sync", - "title": "Snippet for the import_processor_version call in the DocumentProcessorService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version. It may require modification in order to execute successfully.", - "file": "document_processor_service/import_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#import_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ImportProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentService_UpdateDataset_sync", - "title": "Snippet for the update_dataset call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset. It may require modification in order to execute successfully.", - "file": "document_service/update_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_dataset", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" - }, - "method": { - "short_name": "UpdateDataset", - "full_name": "google.cloud.documentai.v1beta3.DocumentService.UpdateDataset", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.documentai.v1beta3.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentService_ImportDocuments_sync", - "title": "Snippet for the import_documents call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#import_documents. It may require modification in order to execute successfully.", - "file": "document_service/import_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_documents", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#import_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" - }, - "method": { - "short_name": "ImportDocuments", - "full_name": "google.cloud.documentai.v1beta3.DocumentService.ImportDocuments", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.documentai.v1beta3.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentService_GetDocument_sync", - "title": "Snippet for the get_document call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_document. It may require modification in order to execute successfully.", - "file": "document_service/get_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_document", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" - }, - "method": { - "short_name": "GetDocument", - "full_name": "google.cloud.documentai.v1beta3.DocumentService.GetDocument", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.documentai.v1beta3.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_sync", - "title": "Snippet for the batch_delete_documents call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#batch_delete_documents. It may require modification in order to execute successfully.", - "file": "document_service/batch_delete_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_documents", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#batch_delete_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" - }, - "method": { - "short_name": "BatchDeleteDocuments", - "full_name": "google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocuments", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.documentai.v1beta3.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 48, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentService_GetDatasetSchema_sync", - "title": "Snippet for the get_dataset_schema call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_dataset_schema. It may require modification in order to execute successfully.", - "file": "document_service/get_dataset_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_dataset_schema", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#get_dataset_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::DatasetSchema", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" - }, - "method": { - "short_name": "GetDatasetSchema", - "full_name": "google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchema", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.documentai.v1beta3.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_sync", - "title": "Snippet for the update_dataset_schema call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset_schema. It may require modification in order to execute successfully.", - "file": "document_service/update_dataset_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_dataset_schema", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client#update_dataset_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::DatasetSchema", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client" - }, - "method": { - "short_name": "UpdateDatasetSchema", - "full_name": "google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchema", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.documentai.v1beta3.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb deleted file mode 100644 index fef6ec26facd..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" -require "google/cloud/document_ai/v1beta3/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb deleted file mode 100644 index 7caf5491ec9c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/document_ai/v1beta3/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientPathsTest < Minitest::Test - def test_evaluation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.evaluation_path project: "value0", location: "value1", processor: "value2", processor_version: "value3", evaluation: "value4" - assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3/evaluations/value4", path - end - end - - def test_human_review_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.human_review_config_path project: "value0", location: "value1", processor: "value2" - assert_equal "projects/value0/locations/value1/processors/value2/humanReviewConfig", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_processor_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.processor_path project: "value0", location: "value1", processor: "value2" - assert_equal "projects/value0/locations/value1/processors/value2", path - end - end - - def test_processor_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.processor_type_path project: "value0", location: "value1", processor_type: "value2" - assert_equal "projects/value0/locations/value1/processorTypes/value2", path - end - end - - def test_processor_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.processor_version_path project: "value0", location: "value1", processor: "value2", processor_version: "value3" - assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb deleted file mode 100644 index 1dceb202a6d3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb +++ /dev/null @@ -1,1357 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/document_ai/v1beta3/document_processor_service/rest" - - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - end - - def test_process_document - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_document = {} - name = "hello world" - document = {} - skip_human_review = true - field_mask = {} - process_options = {} - - process_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_process_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, process_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.process_document inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.process_document ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.process_document(::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, process_document_client_stub.call_count - end - end - end - - def test_batch_process_documents - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - input_configs = [{}] - output_config = {} - input_documents = {} - document_output_config = {} - skip_human_review = true - process_options = {} - - batch_process_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_batch_process_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_process_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_process_documents name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_process_documents ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_process_documents(::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_process_documents_client_stub.call_count - end - end - end - - def test_fetch_processor_types - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - fetch_processor_types_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_fetch_processor_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_processor_types_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_processor_types({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_processor_types parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_processor_types ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_processor_types({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_processor_types(::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_processor_types_client_stub.call_count - end - end - end - - def test_list_processor_types - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processor_types_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_processor_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_processor_types_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_processor_types parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_processor_types ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_processor_types(::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_processor_types_client_stub.call_count - end - end - end - - def test_get_processor_type - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_type_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_processor_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_processor_type_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_processor_type({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_processor_type name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_processor_type ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_processor_type({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_processor_type(::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_processor_type_client_stub.call_count - end - end - end - - def test_list_processors - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processors_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_processors_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_processors_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_processors parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_processors ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_processors(::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_processors_client_stub.call_count - end - end - end - - def test_get_processor - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::Processor.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_processor({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_processor name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_processor ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_processor({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_processor(::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_processor_client_stub.call_count - end - end - end - - def test_train_processor_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_document_extraction_options = {} - parent = "hello world" - processor_version = {} - document_schema = {} - input_data = {} - base_processor_version = "hello world" - - train_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_train_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, train_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.train_processor_version custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.train_processor_version ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.train_processor_version(::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, train_processor_version_client_stub.call_count - end - end - end - - def test_get_processor_version - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_processor_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_processor_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_processor_version ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_processor_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_processor_version(::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_processor_version_client_stub.call_count - end - end - end - - def test_list_processor_versions - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processor_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_processor_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_processor_versions_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_processor_versions parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_processor_versions ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_processor_versions(::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_processor_versions_client_stub.call_count - end - end - end - - def test_delete_processor_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_delete_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_processor_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_processor_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_processor_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_processor_version_client_stub.call_count - end - end - end - - def test_deploy_processor_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - deploy_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_deploy_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, deploy_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.deploy_processor_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.deploy_processor_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.deploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.deploy_processor_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.deploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, deploy_processor_version_client_stub.call_count - end - end - end - - def test_undeploy_processor_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - undeploy_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_undeploy_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undeploy_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undeploy_processor_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undeploy_processor_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undeploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undeploy_processor_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undeploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undeploy_processor_version_client_stub.call_count - end - end - end - - def test_create_processor - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::Processor.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - processor = {} - - create_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_create_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_processor({ parent: parent, processor: processor }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_processor parent: parent, processor: processor do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_processor ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_processor({ parent: parent, processor: processor }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_processor(::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_processor_client_stub.call_count - end - end - end - - def test_delete_processor - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_delete_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_processor({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_processor name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_processor ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_processor({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_processor(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_processor_client_stub.call_count - end - end - end - - def test_enable_processor - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - enable_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_enable_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_processor({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_processor name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_processor ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_processor({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_processor(::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_processor_client_stub.call_count - end - end - end - - def test_disable_processor - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - disable_processor_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_disable_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_processor({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_processor name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_processor ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_processor({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_processor(::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_processor_client_stub.call_count - end - end - end - - def test_set_default_processor_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - processor = "hello world" - default_processor_version = "hello world" - - set_default_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_set_default_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_default_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_default_processor_version processor: processor, default_processor_version: default_processor_version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_default_processor_version ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_default_processor_version(::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_default_processor_version_client_stub.call_count - end - end - end - - def test_review_document - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_document = {} - human_review_config = "hello world" - document = {} - enable_schema_validation = true - priority = :DEFAULT - document_schema = {} - - review_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_review_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, review_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.review_document inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.review_document ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.review_document(::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, review_document_client_stub.call_count - end - end - end - - def test_evaluate_processor_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - processor_version = "hello world" - evaluation_documents = {} - - evaluate_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_evaluate_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, evaluate_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.evaluate_processor_version processor_version: processor_version, evaluation_documents: evaluation_documents do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.evaluate_processor_version ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.evaluate_processor_version(::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, evaluate_processor_version_client_stub.call_count - end - end - end - - def test_get_evaluation - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_evaluation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_get_evaluation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_evaluation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_evaluation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_evaluation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_evaluation ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_evaluation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_evaluation(::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_evaluation_client_stub.call_count - end - end - end - - def test_list_evaluations - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_evaluations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_list_evaluations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_evaluations_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_evaluations parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_evaluations ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_evaluations(::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_evaluations_client_stub.call_count - end - end - end - - def test_import_processor_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - processor_version_source = "hello world" - parent = "hello world" - - import_processor_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.stub :transcode_import_processor_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_processor_version processor_version_source: processor_version_source, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_processor_version ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_processor_version(::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_processor_version_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb deleted file mode 100644 index 9617be12841f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb +++ /dev/null @@ -1,1564 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" -require "google/cloud/document_ai/v1beta3/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - end - - def test_process_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_document = {} - name = "hello world" - document = {} - skip_human_review = true - field_mask = {} - process_options = {} - - process_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :process_document, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] - assert_equal :inline_document, request.source - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] - assert_equal true, request["skip_human_review"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, process_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.process_document inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.process_document ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.process_document(::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, process_document_client_stub.call_rpc_count - end - end - - def test_batch_process_documents - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - input_configs = [{}] - output_config = {} - input_documents = {} - document_output_config = {} - skip_human_review = true - process_options = {} - - batch_process_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_process_documents, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, request["input_configs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig), request["output_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["input_documents"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig), request["document_output_config"] - assert_equal true, request["skip_human_review"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_process_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_process_documents name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_process_documents ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_process_documents(::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_process_documents_client_stub.call_rpc_count - end - end - - def test_fetch_processor_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - fetch_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_processor_types, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_processor_types_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_processor_types({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_processor_types parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_processor_types ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_processor_types({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_processor_types(::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fetch_processor_types_client_stub.call_rpc_count - end - end - - def test_list_processor_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processor_types, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_processor_types_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_processor_types parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_processor_types ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_processor_types(::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_processor_types_client_stub.call_rpc_count - end - end - - def test_get_processor_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_processor_type, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_processor_type_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_processor_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_processor_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_processor_type ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_processor_type({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_processor_type(::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_processor_type_client_stub.call_rpc_count - end - end - - def test_list_processors - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processors, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_processors_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_processors parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_processors ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_processors(::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_processors_client_stub.call_rpc_count - end - end - - def test_get_processor - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_processor({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_processor name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_processor ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_processor({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_processor(::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_processor_client_stub.call_rpc_count - end - end - - def test_train_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - custom_document_extraction_options = {} - parent = "hello world" - processor_version = {} - document_schema = {} - input_data = {} - base_processor_version = "hello world" - - train_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :train_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions), request["custom_document_extraction_options"] - assert_equal :custom_document_extraction_options, request.processor_flags - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion), request["processor_version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData), request["input_data"] - assert_equal "hello world", request["base_processor_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, train_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.train_processor_version custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.train_processor_version ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.train_processor_version({ custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.train_processor_version(::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(custom_document_extraction_options: custom_document_extraction_options, parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, train_processor_version_client_stub.call_rpc_count - end - end - - def test_get_processor_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_processor_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_processor_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_processor_version ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_processor_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_processor_version(::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_processor_version_client_stub.call_rpc_count - end - end - - def test_list_processor_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processor_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processor_versions, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_processor_versions_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_processor_versions parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_processor_versions ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_processor_versions(::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_processor_versions_client_stub.call_rpc_count - end - end - - def test_delete_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_processor_version({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_processor_version name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_processor_version({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_processor_version_client_stub.call_rpc_count - end - end - - def test_deploy_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - deploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deploy_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deploy_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.deploy_processor_version({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.deploy_processor_version name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.deploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.deploy_processor_version({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.deploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, deploy_processor_version_client_stub.call_rpc_count - end - end - - def test_undeploy_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - undeploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undeploy_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undeploy_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undeploy_processor_version({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undeploy_processor_version name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undeploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undeploy_processor_version({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undeploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, undeploy_processor_version_client_stub.call_rpc_count - end - end - - def test_create_processor - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - processor = {} - - create_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Processor), request["processor"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_processor({ parent: parent, processor: processor }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_processor parent: parent, processor: processor do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_processor ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_processor({ parent: parent, processor: processor }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_processor(::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_processor_client_stub.call_rpc_count - end - end - - def test_delete_processor - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_processor({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_processor name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_processor ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_processor({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_processor(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_processor_client_stub.call_rpc_count - end - end - - def test_enable_processor - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - enable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_processor({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_processor name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_processor ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_processor({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_processor(::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_processor_client_stub.call_rpc_count - end - end - - def test_disable_processor - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - disable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_processor({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_processor name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_processor ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_processor({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_processor(::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_processor_client_stub.call_rpc_count - end - end - - def test_set_default_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - processor = "hello world" - default_processor_version = "hello world" - - set_default_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_default_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, request - assert_equal "hello world", request["processor"] - assert_equal "hello world", request["default_processor_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_default_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_default_processor_version processor: processor, default_processor_version: default_processor_version do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_default_processor_version ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_default_processor_version(::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_default_processor_version_client_stub.call_rpc_count - end - end - - def test_review_document - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_document = {} - human_review_config = "hello world" - document = {} - enable_schema_validation = true - priority = :DEFAULT - document_schema = {} - - review_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :review_document, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] - assert_equal :inline_document, request.source - assert_equal "hello world", request["human_review_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] - assert_equal true, request["enable_schema_validation"] - assert_equal :DEFAULT, request["priority"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, review_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.review_document inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.review_document ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.review_document(::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, review_document_client_stub.call_rpc_count - end - end - - def test_evaluate_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - processor_version = "hello world" - evaluation_documents = {} - - evaluate_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :evaluate_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, request - assert_equal "hello world", request["processor_version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["evaluation_documents"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, evaluate_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.evaluate_processor_version processor_version: processor_version, evaluation_documents: evaluation_documents do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.evaluate_processor_version ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.evaluate_processor_version(::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, evaluate_processor_version_client_stub.call_rpc_count - end - end - - def test_get_evaluation - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_evaluation, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_evaluation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_evaluation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_evaluation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_evaluation ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_evaluation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_evaluation(::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_evaluation_client_stub.call_rpc_count - end - end - - def test_list_evaluations - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_evaluations, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_evaluations_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_evaluations parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_evaluations ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_evaluations(::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_evaluations_client_stub.call_rpc_count - end - end - - def test_import_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - processor_version_source = "hello world" - parent = "hello world" - - import_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, request - assert_equal "hello world", request["processor_version_source"] - assert_equal :processor_version_source, request.source - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_processor_version processor_version_source: processor_version_source, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_processor_version ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_processor_version({ processor_version_source: processor_version_source, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_processor_version(::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new(processor_version_source: processor_version_source, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_processor_version_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb deleted file mode 100644 index 13f8919a8b71..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/documentai/v1beta3/document_service_pb" -require "google/cloud/documentai/v1beta3/document_service_services_pb" -require "google/cloud/document_ai/v1beta3/document_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb deleted file mode 100644 index b3f13eaeef7b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/document_ai/v1beta3/document_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::ClientPathsTest < Minitest::Test - def test_dataset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dataset_path project: "value0", location: "value1", processor: "value2" - assert_equal "projects/value0/locations/value1/processors/value2/dataset", path - end - end - - def test_dataset_schema_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dataset_schema_path project: "value0", location: "value1", processor: "value2" - assert_equal "projects/value0/locations/value1/processors/value2/dataset/datasetSchema", path - end - end - - def test_schema_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.schema_path project: "value0", location: "value1", schema: "value2" - assert_equal "projects/value0/locations/value1/schemas/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb deleted file mode 100644 index b3360e7a5b20..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb +++ /dev/null @@ -1,414 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/documentai/v1beta3/document_service_pb" -require "google/cloud/document_ai/v1beta3/document_service/rest" - - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - end - - def test_update_dataset - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - dataset = {} - update_mask = {} - - update_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_update_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_dataset_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_dataset({ dataset: dataset, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_dataset dataset: dataset, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_dataset ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_dataset({ dataset: dataset, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_dataset(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_dataset_client_stub.call_count - end - end - end - - def test_import_documents - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - dataset = "hello world" - batch_documents_import_configs = [{}] - - import_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_documents dataset: dataset, batch_documents_import_configs: batch_documents_import_configs do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_documents ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_documents(::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_documents_client_stub.call_count - end - end - end - - def test_get_document - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - dataset = "hello world" - document_id = {} - read_mask = {} - page_range = {} - - get_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_document dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_document ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_document(::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_document_client_stub.call_count - end - end - end - - def test_batch_delete_documents - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - dataset = "hello world" - dataset_documents = {} - - batch_delete_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_batch_delete_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_delete_documents dataset: dataset, dataset_documents: dataset_documents do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_delete_documents ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_delete_documents(::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_documents_client_stub.call_count - end - end - end - - def test_get_dataset_schema - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - visible_fields_only = true - - get_dataset_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_get_dataset_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_dataset_schema_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_dataset_schema name: name, visible_fields_only: visible_fields_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_dataset_schema_client_stub.call_count - end - end - end - - def test_update_dataset_schema - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - dataset_schema = {} - update_mask = {} - - update_dataset_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.stub :transcode_update_dataset_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_dataset_schema_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_dataset_schema dataset_schema: dataset_schema, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_dataset_schema_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb deleted file mode 100644 index 0029b1f48f2f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb +++ /dev/null @@ -1,459 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/documentai/v1beta3/document_service_pb" -require "google/cloud/documentai/v1beta3/document_service_services_pb" -require "google/cloud/document_ai/v1beta3/document_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - end - - def test_update_dataset - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - dataset = {} - update_mask = {} - - update_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_dataset, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Dataset), request["dataset"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_dataset_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_dataset({ dataset: dataset, update_mask: update_mask }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_dataset dataset: dataset, update_mask: update_mask do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_dataset ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_dataset({ dataset: dataset, update_mask: update_mask }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_dataset(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_dataset_client_stub.call_rpc_count - end - end - - def test_import_documents - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - dataset = "hello world" - batch_documents_import_configs = [{}] - - import_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_documents, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, request - assert_equal "hello world", request["dataset"] - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig, request["batch_documents_import_configs"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_documents dataset: dataset, batch_documents_import_configs: batch_documents_import_configs do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_documents ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_documents({ dataset: dataset, batch_documents_import_configs: batch_documents_import_configs }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_documents(::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new(dataset: dataset, batch_documents_import_configs: batch_documents_import_configs), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_documents_client_stub.call_rpc_count - end - end - - def test_get_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - dataset = "hello world" - document_id = {} - read_mask = {} - page_range = {} - - get_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_document, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, request - assert_equal "hello world", request["dataset"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentId), request["document_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange), request["page_range"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_document dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_document ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_document({ dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_document(::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new(dataset: dataset, document_id: document_id, read_mask: read_mask, page_range: page_range), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_document_client_stub.call_rpc_count - end - end - - def test_batch_delete_documents - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - dataset = "hello world" - dataset_documents = {} - - batch_delete_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_documents, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, request - assert_equal "hello world", request["dataset"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments), request["dataset_documents"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_delete_documents dataset: dataset, dataset_documents: dataset_documents do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_delete_documents ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_delete_documents({ dataset: dataset, dataset_documents: dataset_documents }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_delete_documents(::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new(dataset: dataset, dataset_documents: dataset_documents), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_delete_documents_client_stub.call_rpc_count - end - end - - def test_get_dataset_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - visible_fields_only = true - - get_dataset_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_dataset_schema, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["visible_fields_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_dataset_schema_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_dataset_schema name: name, visible_fields_only: visible_fields_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_dataset_schema({ name: name, visible_fields_only: visible_fields_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new(name: name, visible_fields_only: visible_fields_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_dataset_schema_client_stub.call_rpc_count - end - end - - def test_update_dataset_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - dataset_schema = {} - update_mask = {} - - update_dataset_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_dataset_schema, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DatasetSchema), request["dataset_schema"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_dataset_schema_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_dataset_schema dataset_schema: dataset_schema, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_dataset_schema ::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_dataset_schema({ dataset_schema: dataset_schema, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_dataset_schema(::Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new(dataset_schema: dataset_schema, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_dataset_schema_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb deleted file mode 100644 index 8f4f6cf3de22..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc"