From d3434ed20da1ec1817790891c0b465cf47ccd561 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 8 May 2024 20:55:47 +0000 Subject: [PATCH 1/2] docs: updated comments PiperOrigin-RevId: 631869949 Source-Link: https://github.com/googleapis/googleapis/commit/a5dcade547ddb42bfe0f1538bd81a6302cdf3217 Source-Link: https://github.com/googleapis/googleapis-gen/commit/697b6d88f0eb77bcba4cc864b6a8524490d49917 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRvY3VtZW50X2FpLXYxLy5Pd2xCb3QueWFtbCIsImgiOiI2OTdiNmQ4OGYwZWI3N2JjYmE0Y2M4NjRiNmE4NTI0NDkwZDQ5OTE3In0= --- .../google-cloud-document_ai-v1/.gitignore | 22 + .../.repo-metadata.json | 19 + .../google-cloud-document_ai-v1/.rubocop.yml | 33 + .../google-cloud-document_ai-v1/.toys.rb | 28 + .../google-cloud-document_ai-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-document_ai-v1/CHANGELOG.md | 2 + .../google-cloud-document_ai-v1/Gemfile | 11 + .../google-cloud-document_ai-v1/LICENSE.md | 201 ++ .../google-cloud-document_ai-v1/README.md | 144 + .../google-cloud-document_ai-v1/Rakefile | 169 ++ .../gapic_metadata.json | 128 + .../google-cloud-document_ai-v1.gemspec | 29 + .../lib/google-cloud-document_ai-v1.rb | 21 + .../lib/google/cloud/document_ai/v1.rb | 45 + .../cloud/document_ai/v1/bindings_override.rb | 118 + .../v1/document_processor_service.rb | 59 + .../v1/document_processor_service/client.rb | 2665 +++++++++++++++++ .../document_processor_service/credentials.rb | 51 + .../document_processor_service/operations.rb | 801 +++++ .../v1/document_processor_service/paths.rb | 151 + .../v1/document_processor_service/rest.rb | 57 + .../document_processor_service/rest/client.rb | 2493 +++++++++++++++ .../rest/operations.rb | 922 ++++++ .../rest/service_stub.rb | 1394 +++++++++ .../lib/google/cloud/document_ai/v1/rest.rb | 38 + .../google/cloud/document_ai/v1/version.rb | 28 + .../google/cloud/documentai/v1/barcode_pb.rb | 42 + .../cloud/documentai/v1/document_io_pb.rb | 55 + .../google/cloud/documentai/v1/document_pb.rb | 102 + .../v1/document_processor_service_pb.rb | 129 + .../document_processor_service_services_pb.rb | 105 + .../cloud/documentai/v1/document_schema_pb.rb | 47 + .../cloud/documentai/v1/evaluation_pb.rb | 52 + .../google/cloud/documentai/v1/geometry_pb.rb | 44 + .../documentai/v1/operation_metadata_pb.rb | 46 + .../cloud/documentai/v1/processor_pb.rb | 57 + .../cloud/documentai/v1/processor_type_pb.rb | 46 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 399 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 ++ .../google/cloud/documentai/v1/barcode.rb | 73 + .../google/cloud/documentai/v1/document.rb | 1047 +++++++ .../google/cloud/documentai/v1/document_io.rb | 201 ++ .../v1/document_processor_service.rb | 981 ++++++ .../cloud/documentai/v1/document_schema.rb | 165 + .../google/cloud/documentai/v1/evaluation.rb | 199 ++ .../google/cloud/documentai/v1/geometry.rb | 65 + .../cloud/documentai/v1/operation_metadata.rb | 68 + .../google/cloud/documentai/v1/processor.rb | 210 ++ .../cloud/documentai/v1/processor_type.rb | 66 + .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 145 + .../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 | 54 + .../create_processor.rb | 47 + .../delete_processor.rb | 54 + .../delete_processor_version.rb | 54 + .../deploy_processor_version.rb | 54 + .../disable_processor.rb | 54 + .../enable_processor.rb | 54 + .../evaluate_processor_version.rb | 54 + .../fetch_processor_types.rb | 47 + .../get_evaluation.rb | 47 + .../get_processor.rb | 47 + .../get_processor_type.rb | 47 + .../get_processor_version.rb | 47 + .../list_evaluations.rb | 51 + .../list_processor_types.rb | 51 + .../list_processor_versions.rb | 51 + .../list_processors.rb | 51 + .../process_document.rb | 47 + .../review_document.rb | 54 + .../set_default_processor_version.rb | 54 + .../train_processor_version.rb | 54 + .../undeploy_processor_version.rb | 54 + ...t_metadata_google.cloud.documentai.v1.json | 895 ++++++ ...ument_processor_service_operations_test.rb | 389 +++ .../document_processor_service_paths_test.rb | 107 + .../document_processor_service_rest_test.rb | 1309 ++++++++ .../v1/document_processor_service_test.rb | 1504 ++++++++++ .../test/helper.rb | 25 + 95 files changed, 21201 insertions(+) create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/README.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/barcode_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/evaluation_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/geometry_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/operation_metadata_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/geometry.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/color.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/datetime.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/postal_address.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-document_ai-v1/.gitignore b/owl-bot-staging/google-cloud-document_ai-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/.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-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-document_ai-v1/.repo-metadata.json new file mode 100644 index 000000000000..324701d83eda --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/.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-v1/latest", + "distribution_name": "google-cloud-document_ai-v1", + "is_cloud": true, + "language": "ruby", + "name": "documentai", + "name_pretty": "Document AI V1 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-v1 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-v1/.rubocop.yml b/owl-bot-staging/google-cloud-document_ai-v1/.rubocop.yml new file mode 100644 index 000000000000..81caad112a12 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-document_ai-v1.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-v1.rb" diff --git a/owl-bot-staging/google-cloud-document_ai-v1/.toys.rb b/owl-bot-staging/google-cloud-document_ai-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/.yardopts b/owl-bot-staging/google-cloud-document_ai-v1/.yardopts new file mode 100644 index 000000000000..d0bbaeca490b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Document AI V1 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-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-document_ai-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..3aaee31d105d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-document_ai-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-document_ai-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/document_ai/v1" + +client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/document_ai/v1" + +::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-document_ai-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/document_ai/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### 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 retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-document_ai-v1/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-document_ai-v1/LICENSE.md b/owl-bot-staging/google-cloud-document_ai-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/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-v1/README.md b/owl-bot-staging/google-cloud-document_ai-v1/README.md new file mode 100644 index 000000000000..020c75dc4768 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Document AI V1 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 V1 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-v1 +``` + +## 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/v1" + +client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +request = ::Google::Cloud::DocumentAI::V1::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-v1/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.7+. + +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-v1`. +_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-v1`. + +### 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-v1/Rakefile b/owl-bot-staging/google-cloud-document_ai-v1/Rakefile new file mode 100644 index 000000000000..f8fe7eaea0b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-document_ai-v1 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/v1/document_processor_service/credentials" + ::Google::Cloud::DocumentAI::V1::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-v1 gem has no acceptance tests." + end + 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-v1 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-v1 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-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-document_ai-v1" + header "google-cloud-document_ai-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-document_ai-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-document_ai-v1 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-v1 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-v1 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-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-document_ai-v1/gapic_metadata.json new file mode 100644 index 000000000000..03e1832bdcca --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/gapic_metadata.json @@ -0,0 +1,128 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.documentai.v1", + "libraryPackage": "::Google::Cloud::DocumentAI::V1", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DocumentAI::V1::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" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec b/owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec new file mode 100644 index 000000000000..cb96c5dfba88 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/document_ai/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-document_ai-v1" + gem.version = Google::Cloud::DocumentAI::V1::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-v1 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.7" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb new file mode 100644 index 000000000000..1c512f06d6b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1" diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb new file mode 100644 index 000000000000..8379d676883f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service" +require "google/cloud/document_ai/v1/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/v1" + # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/document_ai/v1" + # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/document_ai/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb new file mode 100644 index 000000000000..d8050b547db5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/rest" + # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + module V1 + ## + # @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: "/v1/{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: "/v1/{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.v1 package. + # + # This class contains common configuration for all services + # of the google.cloud.documentai.v1 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-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb new file mode 100644 index 000000000000..c5b330ae138b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/version" + +require "google/cloud/document_ai/v1/document_processor_service/credentials" +require "google/cloud/document_ai/v1/document_processor_service/paths" +require "google/cloud/document_ai/v1/document_processor_service/operations" +require "google/cloud/document_ai/v1/document_processor_service/client" +require "google/cloud/document_ai/v1/document_processor_service/rest" + +module Google + module Cloud + module DocumentAI + module V1 + ## + # 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/v1/document_processor_service" + # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/document_ai/v1/document_processor_service/rest" + # client = ::Google::Cloud::DocumentAI::V1::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/v1/document_processor_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb new file mode 100644 index 000000000000..524488238f74 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb @@ -0,0 +1,2665 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DocumentAI + module V1 + 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 + # @private + DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :document_processor_service_stub + + ## + # Configure the DocumentProcessorService Client class. + # + # See {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentProcessorService clients + # ::Google::Cloud::DocumentAI::V1::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", "V1"] + 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::V1::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 + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @document_processor_service_stub.universe_domain + end + + ## + # Create a new DocumentProcessorService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DocumentAI::V1::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/v1/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.nil? || + (@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 + config.universe_domain = @config.universe_domain + end + + @document_processor_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_processor_service_stub.endpoint + config.universe_domain = @document_processor_service_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::ProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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, skip_human_review: nil, field_mask: nil, process_options: nil, labels: 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::V1::Document, ::Hash] + # An inline document proto. + # @param raw_document [::Google::Cloud::DocumentAI::V1::RawDocument, ::Hash] + # A raw document content (bytes). + # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash] + # A raw document on Google Cloud Storage. + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server + # will use its [default + # version][google.cloud.documentai.v1.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param 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::V1::ProcessResponse#document ProcessResponse.document} + # output. Only supports top-level document and pages field, so it must be in + # the form of `{document_field_name}` or `pages.{page_field_name}`. + # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash] + # Inference-time options for the process API + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1::ProcessResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1::ProcessResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ProcessRequest.new + # + # # Call the process_document method. + # result = client.process_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::BatchProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil, labels: 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::V1::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param input_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash] + # The input documents for the + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} + # method. + # @param document_output_config [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig, ::Hash] + # The output configuration for the + # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessOptions, ::Hash] + # Inference-time options for the process API + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # @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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::FetchProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::FetchProcessorTypesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new + # + # # Call the fetch_processor_types method. + # result = client.fetch_processor_types request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1::ProcessorType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new + # + # # Call the get_processor_type method. + # result = client.get_processor_type request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1::Processor] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::TrainProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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, foundation_model_tuning_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::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] + # Options to control Custom Document Extraction (CDE) Processor. + # @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash] + # Options to control foundation model tuning of a 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::V1::ProcessorVersion, ::Hash] + # Required. The processor version to be created. + # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash] + # Optional. The schema the processor version will be trained with. + # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash] + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new + # + # # Call the get_processor_version method. + # result = client.get_processor_version request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::DeleteProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::UndeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::CreateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor, ::Hash] + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and + # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} + # to be set. Also, the + # {::Google::Cloud::DocumentAI::V1::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::V1::Processor] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1::Processor] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeleteProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EnableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DisableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Processor Processor} that will be used in + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} + # and + # {::Google::Cloud::DocumentAI::V1::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::V1::SetDefaultProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor Processor} to change default + # version. + # @param default_processor_version [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ReviewDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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, 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::V1::Document, ::Hash] + # An inline document proto. + # @param human_review_config [::String] + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + # document will be reviewed with. + # @param enable_schema_validation [::Boolean] + # Whether the validation should be performed on the ad-hoc review request. + # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @param document_schema [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EvaluateProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param evaluation_documents [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1::Evaluation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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 + + ## + # 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::V1::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::V1::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::V1::DocumentProcessorService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!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] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + 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 + config_attr :universe_domain, 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 + + # @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 + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb new file mode 100644 index 000000000000..d8702ac3d3b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb new file mode 100644 index 000000000000..564b6e21b521 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb @@ -0,0 +1,801 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + module DocumentProcessorService + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" + + # @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 + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + 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, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + 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::V1::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::V1::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::V1::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::V1::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::V1::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 + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!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] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + 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 + config_attr :universe_domain, 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb new file mode 100644 index 000000000000..60ea10fcaa8d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb new file mode 100644 index 000000000000..260a31c35e24 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/version" +require "google/cloud/document_ai/v1/bindings_override" + +require "google/cloud/document_ai/v1/document_processor_service/credentials" +require "google/cloud/document_ai/v1/document_processor_service/paths" +require "google/cloud/document_ai/v1/document_processor_service/rest/operations" +require "google/cloud/document_ai/v1/document_processor_service/rest/client" + +module Google + module Cloud + module DocumentAI + module V1 + ## + # 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/v1/document_processor_service/rest" + # client = ::Google::Cloud::DocumentAI::V1::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/v1/document_processor_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb new file mode 100644 index 000000000000..8f98fa7824cd --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb @@ -0,0 +1,2493 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service_pb" +require "google/cloud/document_ai/v1/document_processor_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DocumentAI + module V1 + 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 + # @private + DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :document_processor_service_stub + + ## + # Configure the DocumentProcessorService Client class. + # + # See {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentProcessorService clients + # ::Google::Cloud::DocumentAI::V1::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", "V1"] + 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::V1::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 + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @document_processor_service_stub.universe_domain + end + + ## + # Create a new DocumentProcessorService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DocumentAI::V1::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.nil? || + (@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::V1::DocumentProcessorService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @document_processor_service_stub = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_processor_service_stub.endpoint + config.universe_domain = @document_processor_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::ProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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, skip_human_review: nil, field_mask: nil, process_options: nil, labels: 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::V1::Document, ::Hash] + # An inline document proto. + # @param raw_document [::Google::Cloud::DocumentAI::V1::RawDocument, ::Hash] + # A raw document content (bytes). + # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash] + # A raw document on Google Cloud Storage. + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server + # will use its [default + # version][google.cloud.documentai.v1.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param 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::V1::ProcessResponse#document ProcessResponse.document} + # output. Only supports top-level document and pages field, so it must be in + # the form of `{document_field_name}` or `pages.{page_field_name}`. + # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash] + # Inference-time options for the process API + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DocumentAI::V1::ProcessResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::ProcessResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ProcessRequest.new + # + # # Call the process_document method. + # result = client.process_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::BatchProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil, labels: 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::V1::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param input_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash] + # The input documents for the + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments} + # method. + # @param document_output_config [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig, ::Hash] + # The output configuration for the + # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessOptions, ::Hash] + # Inference-time options for the process API + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # @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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::FetchProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::FetchProcessorTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new + # + # # Call the fetch_processor_types method. + # result = client.fetch_processor_types request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::ProcessorType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new + # + # # Call the get_processor_type method. + # result = client.get_processor_type request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::Processor] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::TrainProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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, foundation_model_tuning_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::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] + # Options to control Custom Document Extraction (CDE) Processor. + # @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash] + # Options to control foundation model tuning of a 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::V1::ProcessorVersion, ::Hash] + # Required. The processor version to be created. + # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash] + # Optional. The schema the processor version will be trained with. + # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash] + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new + # + # # Call the get_processor_version method. + # result = client.get_processor_version request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::DeleteProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::UndeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::CreateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor, ::Hash] + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and + # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} + # to be set. Also, the + # {::Google::Cloud::DocumentAI::V1::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::V1::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::Processor] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeleteProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EnableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DisableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Processor Processor} that will be used in + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#process_document ProcessDocument} + # and + # {::Google::Cloud::DocumentAI::V1::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::V1::SetDefaultProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor Processor} to change default + # version. + # @param default_processor_version [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ReviewDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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, 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::V1::Document, ::Hash] + # An inline document proto. + # @param human_review_config [::String] + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + # document will be reviewed with. + # @param enable_schema_validation [::Boolean] + # Whether the validation should be performed on the ad-hoc review request. + # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @param document_schema [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EvaluateProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param evaluation_documents [::Google::Cloud::DocumentAI::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::Evaluation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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 + + ## + # 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::V1::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::V1::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::V1::DocumentProcessorService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!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] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + 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 + config_attr :universe_domain, 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 + + # @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 + + 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb new file mode 100644 index 000000000000..5e1aae66b323 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb @@ -0,0 +1,922 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + module DocumentProcessorService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" + + # @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 + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + 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, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + 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::V1::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::V1::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::V1::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::V1::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 + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!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] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "documentai.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + 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 + config_attr :universe_domain, 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:, endpoint_template:, universe_domain:, 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, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + 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: "/v1/{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: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{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: "/v1/{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-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb new file mode 100644 index 000000000000..9f7079d6367e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb @@ -0,0 +1,1394 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service_pb" + +module Google + module Cloud + module DocumentAI + module V1 + 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:, endpoint_template:, universe_domain:, 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, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the process_document REST call + # + # @param request_pb [::Google::Cloud::DocumentAI::V1::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::V1::ProcessResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::FetchProcessorTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ProcessorType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::ProcessorVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::Evaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListEvaluationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DocumentAI::V1::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::V1::ListEvaluationsResponse.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::V1::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: "/v1/{name}:process", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{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::V1::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: "/v1/{name}:batchProcess", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{parent}/evaluations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb new file mode 100644 index 000000000000..be990e2676cc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service/rest" +require "google/cloud/document_ai/v1/bindings_override" +require "google/cloud/document_ai/v1/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/v1/rest" + # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb new file mode 100644 index 000000000000..5031cd28577a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/barcode_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/barcode_pb.rb new file mode 100644 index 000000000000..bc3418a3edbc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/barcode_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1/barcode.proto + +require 'google/protobuf' + + +descriptor_data = "\n(google/cloud/documentai/v1/barcode.proto\x12\x1agoogle.cloud.documentai.v1\"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\xca\x01\n\x1e\x63om.google.cloud.documentai.v1B\x0c\x42\x61rcodeProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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 V1 + Barcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Barcode").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb new file mode 100644 index 000000000000..9b0e59cc1db4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/document_io.proto + +require 'google/protobuf' + +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n,google/cloud/documentai/v1/document_io.proto\x12\x1agoogle.cloud.documentai.v1\x1a google/protobuf/field_mask.proto\"G\n\x0bRawDocument\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\"1\n\x0bGcsDocument\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"J\n\x0cGcsDocuments\x12:\n\tdocuments\x18\x01 \x03(\x0b\x32\'.google.cloud.documentai.v1.GcsDocument\"#\n\tGcsPrefix\x12\x16\n\x0egcs_uri_prefix\x18\x01 \x01(\t\"\xa5\x01\n\x19\x42\x61tchDocumentsInputConfig\x12;\n\ngcs_prefix\x18\x01 \x01(\x0b\x32%.google.cloud.documentai.v1.GcsPrefixH\x00\x12\x41\n\rgcs_documents\x18\x02 \x01(\x0b\x32(.google.cloud.documentai.v1.GcsDocumentsH\x00\x42\x08\n\x06source\"\x85\x03\n\x14\x44ocumentOutputConfig\x12]\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32@.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfigH\x00\x1a\xfe\x01\n\x0fGcsOutputConfig\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12h\n\x0fsharding_config\x18\x03 \x01(\x0b\x32O.google.cloud.documentai.v1.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\"\xf2\x03\n\tOcrConfig\x12:\n\x05hints\x18\x02 \x01(\x0b\x32+.google.cloud.documentai.v1.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\x12O\n\x10premium_features\x18\x0b \x01(\x0b\x32\x35.google.cloud.documentai.v1.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\xcd\x01\n\x1e\x63om.google.cloud.documentai.v1B\x0f\x44ocumentIoProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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 V1 + RawDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.RawDocument").msgclass + GcsDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GcsDocument").msgclass + GcsDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GcsDocuments").msgclass + GcsPrefix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GcsPrefix").msgclass + BatchDocumentsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchDocumentsInputConfig").msgclass + DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentOutputConfig").msgclass + DocumentOutputConfig::GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig").msgclass + DocumentOutputConfig::GcsOutputConfig::ShardingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig").msgclass + OcrConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.OcrConfig").msgclass + OcrConfig::Hints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.OcrConfig.Hints").msgclass + OcrConfig::PremiumFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.OcrConfig.PremiumFeatures").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb new file mode 100644 index 000000000000..77fe923adde2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1/document.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/documentai/v1/barcode_pb' +require 'google/cloud/documentai/v1/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/v1/document.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/documentai/v1/barcode.proto\x1a)google/cloud/documentai/v1/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\"\x87\x45\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\x12\x43\n\x0btext_styles\x18\x05 \x03(\x0b\x32*.google.cloud.documentai.v1.Document.StyleB\x02\x18\x01\x12\x38\n\x05pages\x18\x06 \x03(\x0b\x32).google.cloud.documentai.v1.Document.Page\x12=\n\x08\x65ntities\x18\x07 \x03(\x0b\x32+.google.cloud.documentai.v1.Document.Entity\x12M\n\x10\x65ntity_relations\x18\x08 \x03(\x0b\x32\x33.google.cloud.documentai.v1.Document.EntityRelation\x12\x45\n\x0ctext_changes\x18\x0e \x03(\x0b\x32/.google.cloud.documentai.v1.Document.TextChange\x12\x42\n\nshard_info\x18\t \x01(\x0b\x32..google.cloud.documentai.v1.Document.ShardInfo\x12!\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.Status\x12@\n\trevisions\x18\r \x03(\x0b\x32-.google.cloud.documentai.v1.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\xe5\x02\n\x05Style\x12\x44\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.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\x12\x46\n\tfont_size\x18\x07 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\xc2)\n\x04Page\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12>\n\x05image\x18\r \x01(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Image\x12\x44\n\ntransforms\x18\x0e \x03(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Matrix\x12\x46\n\tdimension\x18\x02 \x01(\x0b\x32\x33.google.cloud.documentai.v1.Document.Page.Dimension\x12@\n\x06layout\x18\x03 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12?\n\x06\x62locks\x18\x05 \x03(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Block\x12G\n\nparagraphs\x18\x06 \x03(\x0b\x32\x33.google.cloud.documentai.v1.Document.Page.Paragraph\x12=\n\x05lines\x18\x07 \x03(\x0b\x32..google.cloud.documentai.v1.Document.Page.Line\x12?\n\x06tokens\x18\x08 \x03(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Token\x12P\n\x0fvisual_elements\x18\t \x03(\x0b\x32\x37.google.cloud.documentai.v1.Document.Page.VisualElement\x12?\n\x06tables\x18\n \x03(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Table\x12H\n\x0b\x66orm_fields\x18\x0b \x03(\x0b\x32\x33.google.cloud.documentai.v1.Document.Page.FormField\x12\x41\n\x07symbols\x18\x0c \x03(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Symbol\x12T\n\x11\x64\x65tected_barcodes\x18\x0f \x03(\x0b\x32\x39.google.cloud.documentai.v1.Document.Page.DetectedBarcode\x12Z\n\x14image_quality_scores\x18\x11 \x01(\x0b\x32<.google.cloud.documentai.v1.Document.Page.ImageQualityScores\x12G\n\nprovenance\x18\x10 \x01(\x0b\x32/.google.cloud.documentai.v1.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\xdd\x02\n\x06Layout\x12\x44\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.TextAnchor\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12?\n\rbounding_poly\x18\x03 \x01(\x0b\x32(.google.cloud.documentai.v1.BoundingPoly\x12Q\n\x0borientation\x18\x04 \x01(\x0e\x32<.google.cloud.documentai.v1.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\xea\x01\n\x05\x42lock\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1a\xee\x01\n\tParagraph\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1a\xe9\x01\n\x04Line\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1a\x9e\x07\n\x05Token\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12U\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32=.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak\x12V\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x04 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x12M\n\nstyle_info\x18\x05 \x01(\x0b\x32\x39.google.cloud.documentai.v1.Document.Page.Token.StyleInfo\x1a\xa6\x01\n\rDetectedBreak\x12P\n\x04type\x18\x01 \x01(\x0e\x32\x42.google.cloud.documentai.v1.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\xa2\x01\n\x06Symbol\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x1a\xb7\x01\n\rVisualElement\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x0c\n\x04type\x18\x02 \x01(\t\x12V\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x1a\xa8\x05\n\x05Table\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12M\n\x0bheader_rows\x18\x02 \x03(\x0b\x32\x38.google.cloud.documentai.v1.Document.Page.Table.TableRow\x12K\n\tbody_rows\x18\x03 \x03(\x0b\x32\x38.google.cloud.documentai.v1.Document.Page.Table.TableRow\x12V\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x05 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1aT\n\x08TableRow\x12H\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32\x39.google.cloud.documentai.v1.Document.Page.Table.TableCell\x1a\xc9\x01\n\tTableCell\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x10\n\x08row_span\x18\x02 \x01(\x05\x12\x10\n\x08\x63ol_span\x18\x03 \x01(\x05\x12V\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x1a\xe6\x03\n\tFormField\x12\x44\n\nfield_name\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x45\n\x0b\x66ield_value\x18\x02 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12[\n\x17name_detected_languages\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12\\\n\x18value_detected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.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\x12\x43\n\nprovenance\x18\x08 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.Provenance\x1a\x89\x01\n\x0f\x44\x65tectedBarcode\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x34\n\x07\x62\x61rcode\x18\x02 \x01(\x0b\x32#.google.cloud.documentai.v1.Barcode\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xc6\x01\n\x12ImageQualityScores\x12\x15\n\rquality_score\x18\x01 \x01(\x02\x12\x65\n\x10\x64\x65tected_defects\x18\x02 \x03(\x0b\x32K.google.cloud.documentai.v1.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\xd0\x06\n\x06\x45ntity\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.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\x12I\n\x0bpage_anchor\x18\x06 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.PageAnchorB\x03\xe0\x41\x01\x12\x0f\n\x02id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12Z\n\x10normalized_value\x18\t \x01(\x0b\x32;.google.cloud.documentai.v1.Document.Entity.NormalizedValueB\x03\xe0\x41\x01\x12\x44\n\nproperties\x18\n \x03(\x0b\x32+.google.cloud.documentai.v1.Document.EntityB\x03\xe0\x41\x01\x12H\n\nprovenance\x18\x0b \x01(\x0b\x32/.google.cloud.documentai.v1.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\xa8\x01\n\nTextAnchor\x12R\n\rtext_segments\x18\x01 \x03(\x0b\x32;.google.cloud.documentai.v1.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\xd8\x03\n\nPageAnchor\x12J\n\tpage_refs\x18\x01 \x03(\x0b\x32\x37.google.cloud.documentai.v1.Document.PageAnchor.PageRef\x1a\xfd\x02\n\x07PageRef\x12\x11\n\x04page\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\\\n\x0blayout_type\x18\x02 \x01(\x0e\x32\x42.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutTypeB\x03\xe0\x41\x01\x12\x18\n\tlayout_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x44\n\rbounding_poly\x18\x04 \x01(\x0b\x32(.google.cloud.documentai.v1.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\xa8\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\x12G\n\x07parents\x18\x03 \x03(\x0b\x32\x36.google.cloud.documentai.v1.Document.Provenance.Parent\x12K\n\x04type\x18\x04 \x01(\x0e\x32=.google.cloud.documentai.v1.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\xa5\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\x12O\n\x0chuman_review\x18\x06 \x01(\x0b\x32\x39.google.cloud.documentai.v1.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\xb1\x01\n\nTextChange\x12\x44\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.TextAnchor\x12\x14\n\x0c\x63hanged_text\x18\x02 \x01(\t\x12G\n\nprovenance\x18\x03 \x03(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x42\x08\n\x06sourceB\xcb\x01\n\x1e\x63om.google.cloud.documentai.v1B\rDocumentProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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.v1.BoundingPoly", "google/cloud/documentai/v1/geometry.proto"], + ["google.cloud.documentai.v1.Barcode", "google/cloud/documentai/v1/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 V1 + Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document").msgclass + Document::ShardInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.ShardInfo").msgclass + Document::Style = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Style").msgclass + Document::Style::FontSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Style.FontSize").msgclass + Document::Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page").msgclass + Document::Page::Dimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Dimension").msgclass + Document::Page::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Image").msgclass + Document::Page::Matrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Matrix").msgclass + Document::Page::Layout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Layout").msgclass + Document::Page::Layout::Orientation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Layout.Orientation").enummodule + Document::Page::Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Block").msgclass + Document::Page::Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Paragraph").msgclass + Document::Page::Line = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Line").msgclass + Document::Page::Token = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token").msgclass + Document::Page::Token::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token.DetectedBreak").msgclass + Document::Page::Token::DetectedBreak::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type").enummodule + Document::Page::Token::StyleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token.StyleInfo").msgclass + Document::Page::Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Symbol").msgclass + Document::Page::VisualElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.VisualElement").msgclass + Document::Page::Table = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Table").msgclass + Document::Page::Table::TableRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Table.TableRow").msgclass + Document::Page::Table::TableCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Table.TableCell").msgclass + Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.FormField").msgclass + Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.DetectedBarcode").msgclass + Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.DetectedLanguage").msgclass + Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.ImageQualityScores").msgclass + Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect").msgclass + Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Entity").msgclass + Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Entity.NormalizedValue").msgclass + Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.EntityRelation").msgclass + Document::TextAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.TextAnchor").msgclass + Document::TextAnchor::TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.TextAnchor.TextSegment").msgclass + Document::PageAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.PageAnchor").msgclass + Document::PageAnchor::PageRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.PageAnchor.PageRef").msgclass + Document::PageAnchor::PageRef::LayoutType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType").enummodule + Document::Provenance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Provenance").msgclass + Document::Provenance::Parent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Provenance.Parent").msgclass + Document::Provenance::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Provenance.OperationType").enummodule + Document::Revision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Revision").msgclass + Document::Revision::HumanReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Revision.HumanReview").msgclass + Document::TextChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.TextChange").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb new file mode 100644 index 000000000000..28b360e79048 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1/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/v1/document_pb' +require 'google/cloud/documentai/v1/document_io_pb' +require 'google/cloud/documentai/v1/document_schema_pb' +require 'google/cloud/documentai/v1/evaluation_pb' +require 'google/cloud/documentai/v1/operation_metadata_pb' +require 'google/cloud/documentai/v1/processor_pb' +require 'google/cloud/documentai/v1/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/v1/document_processor_service.proto\x12\x1agoogle.cloud.documentai.v1\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/v1/document.proto\x1a,google/cloud/documentai/v1/document_io.proto\x1a\x30google/cloud/documentai/v1/document_schema.proto\x1a+google/cloud/documentai/v1/evaluation.proto\x1a\x33google/cloud/documentai/v1/operation_metadata.proto\x1a*google/cloud/documentai/v1/processor.proto\x1a/google/cloud/documentai/v1/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\"\xe2\x02\n\x0eProcessOptions\x12\x65\n\x18individual_page_selector\x18\x05 \x01(\x0b\x32\x41.google.cloud.documentai.v1.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\x39\n\nocr_config\x18\x01 \x01(\x0b\x32%.google.cloud.documentai.v1.OcrConfig\x12H\n\x0fschema_override\x18\x08 \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchemaB\x03\xe0\x41\x01\x1a,\n\x16IndividualPageSelector\x12\x12\n\x05pages\x18\x01 \x03(\x05\x42\x03\xe0\x41\x01\x42\x0c\n\npage_range\"\x82\x04\n\x0eProcessRequest\x12?\n\x0finline_document\x18\x04 \x01(\x0b\x32$.google.cloud.documentai.v1.DocumentH\x00\x12?\n\x0craw_document\x18\x05 \x01(\x0b\x32\'.google.cloud.documentai.v1.RawDocumentH\x00\x12?\n\x0cgcs_document\x18\x08 \x01(\x0b\x32\'.google.cloud.documentai.v1.GcsDocumentH\x00\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08\x12.\n\nfield_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x0fprocess_options\x18\x07 \x01(\x0b\x32*.google.cloud.documentai.v1.ProcessOptions\x12K\n\x06labels\x18\n \x03(\x0b\x32\x36.google.cloud.documentai.v1.ProcessRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06source\"\xee\x01\n\x11HumanReviewStatus\x12\x42\n\x05state\x18\x01 \x01(\x0e\x32\x33.google.cloud.documentai.v1.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\"\x95\x01\n\x0fProcessResponse\x12\x36\n\x08\x64ocument\x18\x01 \x01(\x0b\x32$.google.cloud.documentai.v1.Document\x12J\n\x13human_review_status\x18\x03 \x01(\x0b\x32-.google.cloud.documentai.v1.HumanReviewStatus\"\xb1\x03\n\x13\x42\x61tchProcessRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12N\n\x0finput_documents\x18\x05 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfig\x12P\n\x16\x64ocument_output_config\x18\x06 \x01(\x0b\x32\x30.google.cloud.documentai.v1.DocumentOutputConfig\x12\x19\n\x11skip_human_review\x18\x04 \x01(\x08\x12\x43\n\x0fprocess_options\x18\x07 \x01(\x0b\x32*.google.cloud.documentai.v1.ProcessOptions\x12P\n\x06labels\x18\t \x03(\x0b\x32;.google.cloud.documentai.v1.BatchProcessRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x16\n\x14\x42\x61tchProcessResponse\"\xff\x04\n\x14\x42\x61tchProcessMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.documentai.v1.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\x12m\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32H.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus\x1a\xc3\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\x12J\n\x13human_review_status\x18\x05 \x01(\x0b\x32-.google.cloud.documentai.v1.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\"a\n\x1b\x46\x65tchProcessorTypesResponse\x12\x42\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32).google.cloud.documentai.v1.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\"y\n\x1aListProcessorTypesResponse\x12\x42\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32).google.cloud.documentai.v1.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\"l\n\x16ListProcessorsResponse\x12\x39\n\nprocessors\x18\x01 \x03(\x0b\x32%.google.cloud.documentai.v1.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\"\x82\x01\n\x1dListProcessorVersionsResponse\x12H\n\x12processor_versions\x18\x01 \x03(\x0b\x32,.google.cloud.documentai.v1.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\"n\n\x1e\x44\x65leteProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"n\n\x1e\x44\x65ployProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\"c\n\x1fUndeployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\"\n UndeployProcessorVersionResponse\"p\n UndeployProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\"\x94\x01\n\x16\x43reateProcessorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12=\n\tprocessor\x18\x02 \x01(\x0b\x32%.google.cloud.documentai.v1.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\"g\n\x17\x44\x65leteProcessorMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"g\n\x17\x45nableProcessorMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"h\n\x18\x44isableProcessorMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"r\n\"SetDefaultProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\"\xa4\t\n\x1cTrainProcessorVersionRequest\x12\x86\x01\n\"custom_document_extraction_options\x18\x05 \x01(\x0b\x32X.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptionsH\x00\x12\x80\x01\n\x1f\x66oundation_model_tuning_options\x18\x0c \x01(\x0b\x32U.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptionsH\x00\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12L\n\x11processor_version\x18\x02 \x01(\x0b\x32,.google.cloud.documentai.v1.ProcessorVersionB\x03\xe0\x41\x02\x12H\n\x0f\x64ocument_schema\x18\n \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchemaB\x03\xe0\x41\x01\x12[\n\ninput_data\x18\x04 \x01(\x0b\x32\x42.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataB\x03\xe0\x41\x01\x12#\n\x16\x62\x61se_processor_version\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1a\xad\x01\n\tInputData\x12Q\n\x12training_documents\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfig\x12M\n\x0etest_documents\x18\x04 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfig\x1a\xfc\x01\n\x1f\x43ustomDocumentExtractionOptions\x12\x80\x01\n\x0ftraining_method\x18\x03 \x01(\x0e\x32g.google.cloud.documentai.v1.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\x1a_\n\x1c\x46oundationModelTuningOptions\x12\x18\n\x0btrain_steps\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x18learning_rate_multiplier\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01\x42\x11\n\x0fprocessor_flags\":\n\x1dTrainProcessorVersionResponse\x12\x19\n\x11processor_version\x18\x01 \x01(\t\"\xf7\x03\n\x1dTrainProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\x12p\n\x1btraining_dataset_validation\x18\x02 \x01(\x0b\x32K.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation\x12l\n\x17test_dataset_validation\x18\x03 \x01(\x0b\x32K.google.cloud.documentai.v1.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\"\x8e\x03\n\x15ReviewDocumentRequest\x12?\n\x0finline_document\x18\x04 \x01(\x0b\x32$.google.cloud.documentai.v1.DocumentH\x00\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12 \n\x18\x65nable_schema_validation\x18\x03 \x01(\x08\x12L\n\x08priority\x18\x05 \x01(\x0e\x32:.google.cloud.documentai.v1.ReviewDocumentRequest.Priority\x12\x43\n\x0f\x64ocument_schema\x18\x06 \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchema\"#\n\x08Priority\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\n\n\x06URGENT\x10\x01\x42\x08\n\x06source\"\xd1\x01\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t\x12G\n\x05state\x18\x02 \x01(\x0e\x32\x38.google.cloud.documentai.v1.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\"\x84\x01\n\x1fReviewDocumentOperationMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\x12\x13\n\x0bquestion_id\x18\x06 \x01(\t\"\xca\x01\n\x1f\x45valuateProcessorVersionRequest\x12M\n\x11processor_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12X\n\x14\x65valuation_documents\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfigB\x03\xe0\x41\x01\"p\n EvaluateProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"o\n\x17ListEvaluationsResponse\x12;\n\x0b\x65valuations\x18\x01 \x03(\x0b\x32&.google.cloud.documentai.v1.Evaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x9c*\n\x18\x44ocumentProcessorService\x12\x87\x02\n\x0fProcessDocument\x12*.google.cloud.documentai.v1.ProcessRequest\x1a+.google.cloud.documentai.v1.ProcessResponse\"\x9a\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8c\x01\"6/v1/{name=projects/*/locations/*/processors/*}:process:\x01*ZO\"J/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process:\x01*\x12\xbd\x02\n\x15\x42\x61tchProcessDocuments\x12/.google.cloud.documentai.v1.BatchProcessRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x96\x01\";/v1/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*ZT\"O/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess:\x01*\x12\xd0\x01\n\x13\x46\x65tchProcessorTypes\x12\x36.google.cloud.documentai.v1.FetchProcessorTypesRequest\x1a\x37.google.cloud.documentai.v1.FetchProcessorTypesResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*}:fetchProcessorTypes\x12\xc8\x01\n\x12ListProcessorTypes\x12\x35.google.cloud.documentai.v1.ListProcessorTypesRequest\x1a\x36.google.cloud.documentai.v1.ListProcessorTypesResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/processorTypes\x12\xb5\x01\n\x10GetProcessorType\x12\x33.google.cloud.documentai.v1.GetProcessorTypeRequest\x1a).google.cloud.documentai.v1.ProcessorType\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/processorTypes/*}\x12\xb8\x01\n\x0eListProcessors\x12\x31.google.cloud.documentai.v1.ListProcessorsRequest\x1a\x32.google.cloud.documentai.v1.ListProcessorsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/processors\x12\xa5\x01\n\x0cGetProcessor\x12/.google.cloud.documentai.v1.GetProcessorRequest\x1a%.google.cloud.documentai.v1.Processor\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/processors/*}\x12\xa2\x02\n\x15TrainProcessorVersion\x12\x38.google.cloud.documentai.v1.TrainProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xaf\x01\xca\x41>\n\x1dTrainProcessorVersionResponse\x12\x1dTrainProcessorVersionMetadata\xda\x41\x18parent,processor_version\x82\xd3\xe4\x93\x02M\"H/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train:\x01*\x12\xce\x01\n\x13GetProcessorVersion\x12\x36.google.cloud.documentai.v1.GetProcessorVersionRequest\x1a,.google.cloud.documentai.v1.ProcessorVersion\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}\x12\xe1\x01\n\x15ListProcessorVersions\x12\x38.google.cloud.documentai.v1.ListProcessorVersionsRequest\x1a\x39.google.cloud.documentai.v1.ListProcessorVersionsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{parent=projects/*/locations/*/processors/*}/processorVersions\x12\x80\x02\n\x16\x44\x65leteProcessorVersion\x12\x39.google.cloud.documentai.v1.DeleteProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteProcessorVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44*B/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}\x12\x93\x02\n\x16\x44\x65ployProcessorVersion\x12\x39.google.cloud.documentai.v1.DeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41@\n\x1e\x44\x65ployProcessorVersionResponse\x12\x1e\x44\x65ployProcessorVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02N\"I/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy:\x01*\x12\x9d\x02\n\x18UndeployProcessorVersion\x12;.google.cloud.documentai.v1.UndeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa4\x01\xca\x41\x44\n UndeployProcessorVersionResponse\x12 UndeployProcessorVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02P\"K/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy:\x01*\x12\xc2\x01\n\x0f\x43reateProcessor\x12\x32.google.cloud.documentai.v1.CreateProcessorRequest\x1a%.google.cloud.documentai.v1.Processor\"T\xda\x41\x10parent,processor\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/processors:\tprocessor\x12\xd6\x01\n\x0f\x44\x65leteProcessor\x12\x32.google.cloud.documentai.v1.DeleteProcessorRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteProcessorMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/processors/*}\x12\xdb\x01\n\x0f\x45nableProcessor\x12\x32.google.cloud.documentai.v1.EnableProcessorRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41\x32\n\x17\x45nableProcessorResponse\x12\x17\x45nableProcessorMetadata\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/processors/*}:enable:\x01*\x12\xe0\x01\n\x10\x44isableProcessor\x12\x33.google.cloud.documentai.v1.DisableProcessorRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x34\n\x18\x44isableProcessorResponse\x12\x18\x44isableProcessorMetadata\x82\xd3\xe4\x93\x02;\"6/v1/{name=projects/*/locations/*/processors/*}:disable:\x01*\x12\xa1\x02\n\x1aSetDefaultProcessorVersion\x12=.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa4\x01\xca\x41H\n\"SetDefaultProcessorVersionResponse\x12\"SetDefaultProcessorVersionMetadata\x82\xd3\xe4\x93\x02S\"N/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion:\x01*\x12\xa0\x02\n\x0eReviewDocument\x12\x31.google.cloud.documentai.v1.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xbb\x01\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\xda\x41\x13human_review_config\x82\xd3\xe4\x93\x02\x63\"^/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\x12\xc7\x02\n\x18\x45valuateProcessorVersion\x12;.google.cloud.documentai.v1.EvaluateProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xce\x01\xca\x41\x44\n EvaluateProcessorVersionResponse\x12 EvaluateProcessorVersionMetadata\xda\x41\x11processor_version\x82\xd3\xe4\x93\x02m\"h/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion:\x01*\x12\xca\x01\n\rGetEvaluation\x12\x30.google.cloud.documentai.v1.GetEvaluationRequest\x1a&.google.cloud.documentai.v1.Evaluation\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\x12P/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}\x12\xdd\x01\n\x0fListEvaluations\x12\x32.google.cloud.documentai.v1.ListEvaluationsRequest\x1a\x33.google.cloud.documentai.v1.ListEvaluationsResponse\"a\xda\x41\x06parent\x82\xd3\xe4\x93\x02R\x12P/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xaa\x03\n\x1e\x63om.google.cloud.documentai.v1B\x1a\x44ocumentAiProcessorServiceP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1\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 + # 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.v1.OcrConfig", "google/cloud/documentai/v1/document_io.proto"], + ["google.cloud.documentai.v1.DocumentSchema", "google/cloud/documentai/v1/document_schema.proto"], + ["google.cloud.documentai.v1.Document", "google/cloud/documentai/v1/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.v1.ProcessorType", "google/cloud/documentai/v1/processor_type.proto"], + ["google.cloud.documentai.v1.Processor", "google/cloud/documentai/v1/processor.proto"], + ["google.cloud.documentai.v1.CommonOperationMetadata", "google/cloud/documentai/v1/operation_metadata.proto"], + ["google.cloud.documentai.v1.Evaluation", "google/cloud/documentai/v1/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 V1 + ProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessOptions").msgclass + ProcessOptions::IndividualPageSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector").msgclass + ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessRequest").msgclass + HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.HumanReviewStatus").msgclass + HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.HumanReviewStatus.State").enummodule + ProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessResponse").msgclass + BatchProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessRequest").msgclass + BatchProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessResponse").msgclass + BatchProcessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessMetadata").msgclass + BatchProcessMetadata::IndividualProcessStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus").msgclass + BatchProcessMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessMetadata.State").enummodule + FetchProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.FetchProcessorTypesRequest").msgclass + FetchProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.FetchProcessorTypesResponse").msgclass + ListProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorTypesRequest").msgclass + ListProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorTypesResponse").msgclass + ListProcessorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorsRequest").msgclass + ListProcessorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorsResponse").msgclass + GetProcessorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorTypeRequest").msgclass + GetProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorRequest").msgclass + GetProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorVersionRequest").msgclass + ListProcessorVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorVersionsRequest").msgclass + ListProcessorVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorVersionsResponse").msgclass + DeleteProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorVersionRequest").msgclass + DeleteProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorVersionMetadata").msgclass + DeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeployProcessorVersionRequest").msgclass + DeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeployProcessorVersionResponse").msgclass + DeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeployProcessorVersionMetadata").msgclass + UndeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.UndeployProcessorVersionRequest").msgclass + UndeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.UndeployProcessorVersionResponse").msgclass + UndeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.UndeployProcessorVersionMetadata").msgclass + CreateProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.CreateProcessorRequest").msgclass + DeleteProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorRequest").msgclass + DeleteProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorMetadata").msgclass + EnableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EnableProcessorRequest").msgclass + EnableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EnableProcessorResponse").msgclass + EnableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EnableProcessorMetadata").msgclass + DisableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DisableProcessorRequest").msgclass + DisableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DisableProcessorResponse").msgclass + DisableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DisableProcessorMetadata").msgclass + SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionRequest").msgclass + SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionResponse").msgclass + SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata").msgclass + TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest").msgclass + TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData").msgclass + TrainProcessorVersionRequest::CustomDocumentExtractionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions").msgclass + TrainProcessorVersionRequest::CustomDocumentExtractionOptions::TrainingMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod").enummodule + TrainProcessorVersionRequest::FoundationModelTuningOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions").msgclass + TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionResponse").msgclass + TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionMetadata").msgclass + TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation").msgclass + ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest").msgclass + ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest.Priority").enummodule + ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse").msgclass + ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse.State").enummodule + ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentOperationMetadata").msgclass + EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionRequest").msgclass + EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionMetadata").msgclass + EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionResponse").msgclass + GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetEvaluationRequest").msgclass + ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListEvaluationsRequest").msgclass + ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListEvaluationsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb new file mode 100644 index 000000000000..2f38e9a847e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb @@ -0,0 +1,105 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/documentai/v1/document_processor_service.proto for package 'Google.Cloud.DocumentAI.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.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/v1/document_processor_service_pb' + +module Google + module Cloud + module DocumentAI + module V1 + 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.v1.DocumentProcessorService' + + # Processes a single document. + rpc :ProcessDocument, ::Google::Cloud::DocumentAI::V1::ProcessRequest, ::Google::Cloud::DocumentAI::V1::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::V1::BatchProcessRequest, ::Google::Longrunning::Operation + # Fetches processor types. Note that we don't use + # [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + # here, because it isn't paginated. + rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse + # Lists the processor types that exist. + rpc :ListProcessorTypes, ::Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorTypesResponse + # Gets a processor type detail. + rpc :GetProcessorType, ::Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest, ::Google::Cloud::DocumentAI::V1::ProcessorType + # Lists all processors which belong to this project. + rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorsResponse + # Gets a processor detail. + rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1::Processor + # Trains a new processor version. + # Operation metadata is returned as + # [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. + rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest, ::Google::Longrunning::Operation + # Gets a processor version detail. + rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1::ProcessorVersion + # Lists all versions of a processor. + rpc :ListProcessorVersions, ::Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorVersionsResponse + # Deletes the processor version, all artifacts under the processor version + # will be deleted. + rpc :DeleteProcessorVersion, ::Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest, ::Google::Longrunning::Operation + # Deploys the processor version. + rpc :DeployProcessorVersion, ::Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest, ::Google::Longrunning::Operation + # Undeploys the processor version. + rpc :UndeployProcessorVersion, ::Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest, ::Google::Longrunning::Operation + # Creates a processor from the + # [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + # processor will be at `ENABLED` state by default after its creation. + rpc :CreateProcessor, ::Google::Cloud::DocumentAI::V1::CreateProcessorRequest, ::Google::Cloud::DocumentAI::V1::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::V1::DeleteProcessorRequest, ::Google::Longrunning::Operation + # Enables a processor + rpc :EnableProcessor, ::Google::Cloud::DocumentAI::V1::EnableProcessorRequest, ::Google::Longrunning::Operation + # Disables a processor + rpc :DisableProcessor, ::Google::Cloud::DocumentAI::V1::DisableProcessorRequest, ::Google::Longrunning::Operation + # Set the default (active) version of a + # [Processor][google.cloud.documentai.v1.Processor] that will be used in + # [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + # and + # [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + rpc :SetDefaultProcessorVersion, ::Google::Cloud::DocumentAI::V1::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::V1::ReviewDocumentRequest, ::Google::Longrunning::Operation + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation + # Retrieves a specific evaluation. + rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1::Evaluation + # Retrieves a set of evaluations for a given processor version. + rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1::ListEvaluationsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb new file mode 100644 index 000000000000..3a5ac4ed0443 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1/document_schema.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/cloud/documentai/v1/document_schema.proto\x12\x1agoogle.cloud.documentai.v1\"\xbd\x07\n\x0e\x44ocumentSchema\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12K\n\x0c\x65ntity_types\x18\x03 \x03(\x0b\x32\x35.google.cloud.documentai.v1.DocumentSchema.EntityType\x12\x45\n\x08metadata\x18\x04 \x01(\x0b\x32\x33.google.cloud.documentai.v1.DocumentSchema.Metadata\x1a\xd4\x04\n\nEntityType\x12W\n\x0b\x65num_values\x18\x0e \x01(\x0b\x32@.google.cloud.documentai.v1.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\x12R\n\nproperties\x18\x06 \x03(\x0b\x32>.google.cloud.documentai.v1.DocumentSchema.EntityType.Property\x1a\x1c\n\nEnumValues\x12\x0e\n\x06values\x18\x01 \x03(\t\x1a\xb2\x02\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12\x12\n\nvalue_type\x18\x02 \x01(\t\x12\x66\n\x0foccurrence_type\x18\x03 \x01(\x0e\x32M.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType\"\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\xd6\x01\n\x1e\x63om.google.cloud.documentai.v1B\x18\x44ocumentAiDocumentSchemaP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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 V1 + DocumentSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema").msgclass + DocumentSchema::EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType").msgclass + DocumentSchema::EntityType::EnumValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues").msgclass + DocumentSchema::EntityType::Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType.Property").msgclass + DocumentSchema::EntityType::Property::OccurrenceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType").enummodule + DocumentSchema::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.Metadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/evaluation_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/evaluation_pb.rb new file mode 100644 index 000000000000..55093729c028 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/evaluation_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1/evaluation.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n+google/cloud/documentai/v1/evaluation.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\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\x12I\n\x11\x61ggregate_metrics\x18\x04 \x01(\x0b\x32..google.cloud.documentai.v1.Evaluation.Metrics\x12O\n\x17\x61ggregate_metrics_exact\x18\x05 \x01(\x0b\x32..google.cloud.documentai.v1.Evaluation.Metrics\"\xe5\r\n\nEvaluation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12J\n\x11\x64ocument_counters\x18\x05 \x01(\x0b\x32/.google.cloud.documentai.v1.Evaluation.Counters\x12[\n\x14\x61ll_entities_metrics\x18\x03 \x01(\x0b\x32=.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics\x12Q\n\x0e\x65ntity_metrics\x18\x04 \x03(\x0b\x32\x39.google.cloud.documentai.v1.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\x1as\n\x16\x43onfidenceLevelMetrics\x12\x18\n\x10\x63onfidence_level\x18\x01 \x01(\x02\x12?\n\x07metrics\x18\x02 \x01(\x0b\x32..google.cloud.documentai.v1.Evaluation.Metrics\x1a\xf1\x03\n\x16MultiConfidenceMetrics\x12_\n\x18\x63onfidence_level_metrics\x18\x01 \x03(\x0b\x32=.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics\x12\x65\n\x1e\x63onfidence_level_metrics_exact\x18\x04 \x03(\x0b\x32=.google.cloud.documentai.v1.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_\n\x0cmetrics_type\x18\x07 \x01(\x0e\x32I.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType\":\n\x0bMetricsType\x12\x1c\n\x18METRICS_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tAGGREGATE\x10\x01\x1as\n\x12\x45ntityMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.documentai.v1.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\xd2\x01\n\x1e\x63om.google.cloud.documentai.v1B\x14\x44ocumentAiEvaluationP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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 V1 + EvaluationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluationReference").msgclass + Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation").msgclass + Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.Counters").msgclass + Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.Metrics").msgclass + Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics").msgclass + Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics").msgclass + Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/geometry_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/geometry_pb.rb new file mode 100644 index 000000000000..d08b4e37ce9b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/geometry_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1/geometry.proto + +require 'google/protobuf' + + +descriptor_data = "\n)google/cloud/documentai/v1/geometry.proto\x12\x1agoogle.cloud.documentai.v1\"\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\"\x8f\x01\n\x0c\x42oundingPoly\x12\x34\n\x08vertices\x18\x01 \x03(\x0b\x32\".google.cloud.documentai.v1.Vertex\x12I\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32,.google.cloud.documentai.v1.NormalizedVertexB\xcb\x01\n\x1e\x63om.google.cloud.documentai.v1B\rGeometryProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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 V1 + Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Vertex").msgclass + NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.NormalizedVertex").msgclass + BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BoundingPoly").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/operation_metadata_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/operation_metadata_pb.rb new file mode 100644 index 000000000000..1207821bbfdc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/operation_metadata.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n3google/cloud/documentai/v1/operation_metadata.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd5\x02\n\x17\x43ommonOperationMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.documentai.v1.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\xd4\x01\n\x1e\x63om.google.cloud.documentai.v1B\x16OperationMetadataProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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 V1 + CommonOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.CommonOperationMetadata").msgclass + CommonOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.CommonOperationMetadata.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb new file mode 100644 index 000000000000..f7198cfee162 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1/processor.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/documentai/v1/document_schema_pb' +require 'google/cloud/documentai/v1/evaluation_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/documentai/v1/processor.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/documentai/v1/document_schema.proto\x1a+google/cloud/documentai/v1/evaluation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe1\x08\n\x10ProcessorVersion\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x43\n\x0f\x64ocument_schema\x18\x0c \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchema\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32\x32.google.cloud.documentai.v1.ProcessorVersion.State\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12J\n\x11latest_evaluation\x18\x08 \x01(\x0b\x32/.google.cloud.documentai.v1.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\x12V\n\x10\x64\x65precation_info\x18\r \x01(\x0b\x32<.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo\x12O\n\nmodel_type\x18\x0f \x01(\x0e\x32\x36.google.cloud.documentai.v1.ProcessorVersion.ModelTypeB\x03\xe0\x41\x03\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\"Y\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15MODEL_TYPE_GENERATIVE\x10\x01\x12\x15\n\x11MODEL_TYPE_CUSTOM\x10\x02:\x96\x01\xea\x41\x92\x01\n*documentai.googleapis.com/ProcessorVersion\x12\x64projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}\"r\n\x15ProcessorVersionAlias\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12J\n\x11processor_version\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x88\x05\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?\n\x05state\x18\x04 \x01(\x0e\x32+.google.cloud.documentai.v1.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\x12Y\n\x19processor_version_aliases\x18\n \x03(\x0b\x32\x31.google.cloud.documentai.v1.ProcessorVersionAliasB\x03\xe0\x41\x03\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\xd1\x01\n\x1e\x63om.google.cloud.documentai.v1B\x13\x44ocumentAiProcessorP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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.v1.DocumentSchema", "google/cloud/documentai/v1/document_schema.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.documentai.v1.EvaluationReference", "google/cloud/documentai/v1/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 V1 + ProcessorVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion").msgclass + ProcessorVersion::DeprecationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo").msgclass + ProcessorVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion.State").enummodule + ProcessorVersion::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion.ModelType").enummodule + ProcessorVersionAlias = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersionAlias").msgclass + Processor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Processor").msgclass + Processor::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Processor.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_type_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_type_pb.rb new file mode 100644 index 000000000000..e7dd565e8d9c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/processor_type.proto + +require 'google/protobuf' + +require 'google/api/launch_stage_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n/google/cloud/documentai/v1/processor_type.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1dgoogle/api/launch_stage.proto\x1a\x19google/api/resource.proto\"\x93\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\x12S\n\x13\x61vailable_locations\x18\x04 \x03(\x0b\x32\x36.google.cloud.documentai.v1.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\xd5\x01\n\x1e\x63om.google.cloud.documentai.v1B\x17\x44ocumentAiProcessorTypeP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # 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 V1 + ProcessorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorType").msgclass + ProcessorType::LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorType.LocationInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md new file mode 100644 index 000000000000..ffc8a8aaa855 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Document AI V1 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-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..934c39849a6a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/client.rb @@ -0,0 +1,399 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 + # @deprecated This field is deprecated and may be removed in the next major version update. + # @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 + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + 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 + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + 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-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/cloud/documentai/v1/barcode.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb new file mode 100644 index 000000000000..32c2fb8237b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # 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-v1/proto_docs/google/cloud/documentai/v1/document.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb new file mode 100644 index 000000000000..f27021edb071 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb @@ -0,0 +1,1047 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # Document represents the canonical document resource in Document AI. It is an + # interchange format that provides insights into documents and allows for + # collaboration between users and Document AI to iterate and optimize for + # quality. + # @!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 + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Style>] + # Styles for the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # @!attribute [rw] pages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page>] + # Visual page layout for the {::Google::Cloud::DocumentAI::V1::Document Document}. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Entity>] + # A list of entities detected on + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. For document + # shards, entities in this list may cross shard boundaries. + # @!attribute [rw] entity_relations + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::EntityRelation>] + # Placeholder. Relationship among + # {::Google::Cloud::DocumentAI::V1::Document#entities Document.entities}. + # @!attribute [rw] text_changes + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::TextChange>] + # Placeholder. A list of text corrections made to + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::Document::TextAnchor] + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document Document}. + # @!attribute [rw] page_number + # @return [::Integer] + # 1-based index for current + # {::Google::Cloud::DocumentAI::V1::Document::Page Page} in a parent + # {::Google::Cloud::DocumentAI::V1::Document Document}. Useful when a page is + # taken out of a {::Google::Cloud::DocumentAI::V1::Document Document} for + # individual processing. + # @!attribute [rw] image + # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Matrix>] + # Transformation matrices that were applied to the original document image + # to produce {::Google::Cloud::DocumentAI::V1::Document::Page#image Page.image}. + # @!attribute [rw] dimension + # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Dimension] + # Physical dimension of the page. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the page. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] blocks + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Document::Page::Token>] + # A list of visually detected tokens on the page. + # @!attribute [rw] visual_elements + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Table>] + # A list of visually detected tables on the page. + # @!attribute [rw] form_fields + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::FormField>] + # A list of visually detected form fields on the page. + # @!attribute [rw] symbols + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::Symbol>] + # A list of visually detected symbols on the page. + # @!attribute [rw] detected_barcodes + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode>] + # A list of detected barcodes. + # @!attribute [rw] image_quality_scores + # @return [::Google::Cloud::DocumentAI::V1::Document::Page::ImageQualityScores] + # Image quality scores. + # @!attribute [rw] provenance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::TextAnchor] + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the current + # {::Google::Cloud::DocumentAI::V1::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::V1::BoundingPoly] + # The bounding polygon for the + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout}. + # @!attribute [rw] orientation + # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout::Orientation] + # Detected orientation for the + # {::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Block Block}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Paragraph Paragraph}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Line Line}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. + # @!attribute [rw] detected_break + # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Token::DetectedBreak] + # Detected break at the end of a + # {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::DocumentAI::V1::Document::Provenance] + # The history of this annotation. + # @!attribute [rw] style_info + # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Token Token}. + # @!attribute [rw] type + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Symbol Symbol}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. + # @!attribute [rw] type + # @return [::String] + # Type of the + # {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Table Table}. + # @!attribute [rw] header_rows + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::Table::TableRow>] + # Header rows of the table. + # @!attribute [rw] body_rows + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::Table::TableRow>] + # Body rows of the table. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} name. + # e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + # @!attribute [rw] field_value + # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} value. + # @!attribute [rw] name_detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] + # A list of detected languages for name together with confidence. + # @!attribute [rw] value_detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode DetectedBarcode}. + # @!attribute [rw] barcode + # @return [::Google::Cloud::DocumentAI::V1::Barcode] + # Detailed barcode information of the + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::TextAnchor] + # Optional. Provenance of the entity. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::Document#text Document.text}. + # @!attribute [rw] text_segments + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment>] + # The text segments from the + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::ShardInfo#text_offset ShardInfo.text_offset} + # @!attribute [rw] start_index + # @return [::Integer] + # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} + # start UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # @!attribute [rw] end_index + # @return [::Integer] + # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} + # half open end UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::Document::PageAnchor::PageRef::LayoutType] + # Optional. The type of the layout element that is being referenced if + # any. + # @!attribute [rw] layout_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. Deprecated. Use + # {::Google::Cloud::DocumentAI::V1::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} + # instead. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::DocumentAI::V1::BoundingPoly] + # Optional. Identifies the bounding polygon of a layout element on the + # page. If `layout_type` is set, the bounding polygon must be exactly the + # same to the layout element it's referring to. + # @!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::V1::Document::Page#blocks Page.blocks} + # element. + BLOCK = 1 + + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#paragraphs Page.paragraphs} + # element. + PARAGRAPH = 2 + + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#lines Page.lines} element. + LINE = 3 + + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#tokens Page.tokens} + # element. + TOKEN = 4 + + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#visual_elements Page.visual_elements} + # element. + VISUAL_ELEMENT = 5 + + # Refrrences a + # {::Google::Cloud::DocumentAI::V1::Document::Page#tables Page.tables} + # element. + TABLE = 6 + + # References a + # {::Google::Cloud::DocumentAI::V1::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 + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # The index of the revision that produced this element. + # @!attribute [rw] id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @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::V1::Document::Provenance::Parent>] + # References to the original elements that are replaced. + # @!attribute [rw] type + # @return [::Google::Cloud::DocumentAI::V1::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 + # @deprecated This field is deprecated and may be removed in the next major version update. + # @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 + # @deprecated This field is deprecated and may be removed in the next major version update. + # @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::V1::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::V1::Document::TextAnchor] + # Provenance of the correction. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::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 + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Provenance>] + # The history of this annotation. + class TextChange + 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-v1/proto_docs/google/cloud/documentai/v1/document_io.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb new file mode 100644 index 000000000000..558ff50affef --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # 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::V1::RawDocument#content content}. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the document, it supports all Unicode characters except + # the following: + # `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` + # `~`, `=` and `:` are reserved. + # If not specified, a default ID is generated. + 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::V1::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::V1::GcsPrefix] + # The set of documents that match the specified Cloud Storage `gcs_prefix`. + # @!attribute [rw] gcs_documents + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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 + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Turn on font identification model and return font style information. + # Deprecated, use + # {::Google::Cloud::DocumentAI::V1::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 (and later) processors. + # @!attribute [rw] premium_features + # @return [::Google::Cloud::DocumentAI::V1::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 + # (and later) 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-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb new file mode 100644 index 000000000000..385f28b3da15 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb @@ -0,0 +1,981 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # Options for Process API + # @!attribute [rw] individual_page_selector + # @return [::Google::Cloud::DocumentAI::V1::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 fewer 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::V1::OcrConfig] + # Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. + # Returns error if set on other processor types. + # @!attribute [rw] schema_override + # @return [::Google::Cloud::DocumentAI::V1::DocumentSchema] + # Optional. Override the schema of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. Will + # return an Invalid Argument error if this field is set when the underlying + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} doesn't + # support schema override. + 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::V1::DocumentProcessorService::Client#process_document ProcessDocument} + # method. + # @!attribute [rw] inline_document + # @return [::Google::Cloud::DocumentAI::V1::Document] + # An inline document proto. + # @!attribute [rw] raw_document + # @return [::Google::Cloud::DocumentAI::V1::RawDocument] + # A raw document content (bytes). + # @!attribute [rw] gcs_document + # @return [::Google::Cloud::DocumentAI::V1::GcsDocument] + # A raw document on Google Cloud Storage. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server + # will use its [default + # version][google.cloud.documentai.v1.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!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::V1::ProcessResponse#document ProcessResponse.document} + # output. Only supports top-level document and pages field, so it must be in + # the form of `{document_field_name}` or `pages.{page_field_name}`. + # @!attribute [rw] process_options + # @return [::Google::Cloud::DocumentAI::V1::ProcessOptions] + # Inference-time options for the process API + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + class ProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The status of human review on a processed document. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::HumanReviewStatus#state_message state_message} + # for details. + ERROR = 4 + end + end + + # Response message for the + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} + # method. + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1::Document] + # The document payload, will populate fields based on the processor's + # behavior. + # @!attribute [rw] human_review_status + # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] input_documents + # @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig] + # The input documents for the + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} + # method. + # @!attribute [rw] document_output_config + # @return [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig] + # The output configuration for the + # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessOptions] + # Inference-time options for the process API + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + class BatchProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentOutputConfig::GcsOutputConfig#gcs_uri DocumentOutputConfig.GcsOutputConfig.gcs_uri}) + # of the processed document if it was successful, otherwise empty. + # @!attribute [rw] human_review_status + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} + # method. + # @!attribute [rw] processor_types + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} + # method. + # @!attribute [rw] processor_types + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#list_processors ListProcessors} + # method. + # @!attribute [rw] processors + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#list_processor_versions ListProcessorVersions} + # method. + # @!attribute [rw] processor_versions + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#delete_processor_version DeleteProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#create_processor CreateProcessor} + # method. Notice this request is sent to a regionalized backend service. If the + # {::Google::Cloud::DocumentAI::V1::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::V1::Processor] + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and + # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} + # to be set. Also, the + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#delete_processor DeleteProcessor} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#enable_processor EnableProcessor} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#disable_processor DisableProcessor} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} + # method. + # @!attribute [rw] processor + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} to change default + # version. + # @!attribute [rw] default_processor_version + # @return [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#train_processor_version TrainProcessorVersion} + # method. + # @!attribute [rw] custom_document_extraction_options + # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions] + # Options to control Custom Document Extraction (CDE) Processor. + # @!attribute [rw] foundation_model_tuning_options + # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions] + # Options to control foundation model tuning of a 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::V1::ProcessorVersion] + # Required. The processor version to be created. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1::DocumentSchema] + # Optional. The schema the processor version will be trained with. + # @!attribute [rw] input_data + # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData] + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion ProcessorVersion}. + # @!attribute [rw] training_documents + # @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig] + # The documents used for training the new version. + # @!attribute [rw] test_documents + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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 fall back to + # `MODEL_BASED`. + module TrainingMethod + TRAINING_METHOD_UNSPECIFIED = 0 + + MODEL_BASED = 1 + + TEMPLATE_BASED = 2 + end + end + + # Options to control foundation model tuning of the processor. + # @!attribute [rw] train_steps + # @return [::Integer] + # Optional. The number of steps to run for model tuning. Valid values are + # between 1 and 400. If not provided, recommended steps will be used. + # @!attribute [rw] learning_rate_multiplier + # @return [::Float] + # Optional. The multiplier to apply to the recommended learning rate. Valid + # values are between 0.1 and 10. If not provided, recommended learning rate + # will be used. + class FoundationModelTuningOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response for + # {::Google::Cloud::DocumentAI::V1::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::V1::CommonOperationMetadata] + # The basic metadata of the long-running operation. + # @!attribute [rw] training_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionMetadata::DatasetValidation] + # The training dataset validation information. + # @!attribute [rw] test_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#review_document ReviewDocument} + # method. + # @!attribute [rw] inline_document + # @return [::Google::Cloud::DocumentAI::V1::Document] + # An inline document proto. + # @!attribute [rw] human_review_config + # @return [::String] + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + # document will be reviewed with. + # @!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::V1::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#review_document ReviewDocument} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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 + end + + # Evaluates the given + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} against the + # supplied documents. + # @!attribute [rw] processor_version + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] evaluation_documents + # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#evaluate_processor_version EvaluateProcessorVersion} + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ProcessorVersion ProcessorVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::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::V1::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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb new file mode 100644 index 000000000000..ed857c5c91a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb @@ -0,0 +1,165 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # 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::V1::DocumentSchema::EntityType>] + # Entity types of the schema. + # @!attribute [rw] metadata + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentSchema::EntityType::Property>] + # Description the nested structure, or composition of an entity. + 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] display_name + # @return [::String] + # User defined name for the property. + # @!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::V1::DocumentSchema::EntityType::Property::OccurrenceType] + # Occurrence type limits the number of instances an entity type appears + # in the document. + 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, not mentions, of an entity. + # For example, a bank statement might only have one + # `account_number`, but this account number can be mentioned in several + # places on the document. In this case, the `account_number` is + # considered a `REQUIRED_ONCE` entity type. If, on the other hand, we + # expect a bank statement to contain the status of multiple different + # accounts for the customers, the occurrence type is set to + # `REQUIRED_MULTIPLE`. + 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-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb new file mode 100644 index 000000000000..f489ab2e00ed --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # 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::V1::Evaluation::Metrics] + # An aggregate of the statistics for the evaluation with fuzzy matching on. + # @!attribute [rw] aggregate_metrics_exact + # @return [::Google::Cloud::DocumentAI::V1::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::V1::Evaluation::Counters] + # Counters for the documents used in the evaluation. + # @!attribute [rw] all_entities_metrics + # @return [::Google::Cloud::DocumentAI::V1::Evaluation::MultiConfidenceMetrics] + # Metrics for all the entities in aggregate. + # @!attribute [rw] entity_metrics + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation::ConfidenceLevelMetrics>] + # Metrics across confidence levels with fuzzy matching enabled. + # @!attribute [rw] confidence_level_metrics_exact + # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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-v1/proto_docs/google/cloud/documentai/v1/geometry.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/geometry.rb new file mode 100644 index 000000000000..332d3c83dd67 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/geometry.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # 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::V1::Vertex>] + # The bounding polygon vertices. + # @!attribute [rw] normalized_vertices + # @return [::Array<::Google::Cloud::DocumentAI::V1::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-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb new file mode 100644 index 000000000000..39a10b864e08 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # The common metadata for long running operations. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1::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-v1/proto_docs/google/cloud/documentai/v1/processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb new file mode 100644 index 000000000000..51a4d9e7b86e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # A processor version is an implementation of a processor. Each processor + # can have multiple versions, pretrained by Google internally or uptrained + # by the customer. A processor can only have one default version at a time. + # Its document-processing behavior is defined by that version. + # @!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::V1::DocumentSchema] + # The schema of the processor version. Describes the output. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::ProcessorVersion::DeprecationInfo] + # If set, information about the eventual deprecation of this version. + # @!attribute [r] model_type + # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion::ModelType] + # Output only. The model type of this processor 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 + + # The possible model types of the processor version. + module ModelType + # The processor version has unspecified model type. + MODEL_TYPE_UNSPECIFIED = 0 + + # The processor version has generative model type. + MODEL_TYPE_GENERATIVE = 1 + + # The processor version has custom model type. + MODEL_TYPE_CUSTOM = 2 + end + end + + # Contains the alias and the aliased resource name of processor version. + # @!attribute [rw] alias + # @return [::String] + # The alias in the form of `processor_version` resource name. + # @!attribute [rw] processor_version + # @return [::String] + # The resource name of aliased processor version. + class ProcessorVersionAlias + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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::V1::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::V1::Processor::State] + # Output only. The state of the processor. + # @!attribute [rw] default_processor_version + # @return [::String] + # The default processor version. + # @!attribute [r] processor_version_aliases + # @return [::Array<::Google::Cloud::DocumentAI::V1::ProcessorVersionAlias>] + # Output only. The processor version aliases. + # @!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-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb new file mode 100644 index 000000000000..f54f7925ebf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 V1 + # 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::V1::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-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..fb4d6862eac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # 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-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..8c6b19d52e3d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..8e7abcf8f052 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..5160138862c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..09acc69b6125 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/color.rb new file mode 100644 index 000000000000..0cb4ccd2d45d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/color.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..a8b78b5e8ce4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/datetime.rb new file mode 100644 index 000000000000..7be9d37b7d84 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/datetime.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/money.rb new file mode 100644 index 000000000000..e3dfd2f9ecda --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/money.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/postal_address.rb new file mode 100644 index 000000000000..07d77c5d3183 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/postal_address.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1/snippets/Gemfile new file mode 100644 index 000000000000..fec23b9ca434 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-v1", path: "../" +else + gem "google-cloud-document_ai-v1" +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-v1/snippets/document_processor_service/batch_process_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb new file mode 100644 index 000000000000..f895352d5626 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the batch_process_documents call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents. +# +def batch_process_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb new file mode 100644 index 000000000000..5199863c22e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_CreateProcessor_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the create_processor call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#create_processor. +# +def create_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new + + # Call the create_processor method. + result = client.create_processor request + + # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. + p result +end +# [END documentai_v1_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb new file mode 100644 index 000000000000..89216091f3ef --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_DeleteProcessor_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the delete_processor call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor. +# +def delete_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb new file mode 100644 index 000000000000..96c010b088c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the delete_processor_version call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor_version. +# +def delete_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb new file mode 100644 index 000000000000..62bf6c78927d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the deploy_processor_version call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#deploy_processor_version. +# +def deploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb new file mode 100644 index 000000000000..6f9ef636641b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_DisableProcessor_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the disable_processor call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor. +# +def disable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb new file mode 100644 index 000000000000..a613a66ada79 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_EnableProcessor_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the enable_processor call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor. +# +def enable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb new file mode 100644 index 000000000000..cb12bd6c43e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the evaluate_processor_version call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#evaluate_processor_version. +# +def evaluate_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb new file mode 100644 index 000000000000..d75434431ec8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the fetch_processor_types call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types. +# +def fetch_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new + + # Call the fetch_processor_types method. + result = client.fetch_processor_types request + + # The returned object is of type Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse. + p result +end +# [END documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb new file mode 100644 index 000000000000..e73d695adc9a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_GetEvaluation_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the get_evaluation call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_evaluation. +# +def get_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new + + # Call the get_evaluation method. + result = client.get_evaluation request + + # The returned object is of type Google::Cloud::DocumentAI::V1::Evaluation. + p result +end +# [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb new file mode 100644 index 000000000000..f45403dbd9f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_GetProcessor_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the get_processor call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor. +# +def get_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new + + # Call the get_processor method. + result = client.get_processor request + + # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. + p result +end +# [END documentai_v1_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb new file mode 100644 index 000000000000..ffb136521d27 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_GetProcessorType_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the get_processor_type call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_type. +# +def get_processor_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new + + # Call the get_processor_type method. + result = client.get_processor_type request + + # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorType. + p result +end +# [END documentai_v1_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb new file mode 100644 index 000000000000..e41d8a5e6adf --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the get_processor_version call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_version. +# +def get_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new + + # Call the get_processor_version method. + result = client.get_processor_version request + + # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorVersion. + p result +end +# [END documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb new file mode 100644 index 000000000000..cdc334651fb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_ListEvaluations_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the list_evaluations call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_evaluations. +# +def list_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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::V1::Evaluation. + p item + end +end +# [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb new file mode 100644 index 000000000000..216d55f99502 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the list_processor_types call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types. +# +def list_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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::V1::ProcessorType. + p item + end +end +# [END documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb new file mode 100644 index 000000000000..319cb5382c18 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the list_processor_versions call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_versions. +# +def list_processor_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion. + p item + end +end +# [END documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb new file mode 100644 index 000000000000..6820bb27e937 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_ListProcessors_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the list_processors call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processors. +# +def list_processors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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::V1::Processor. + p item + end +end +# [END documentai_v1_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb new file mode 100644 index 000000000000..e540e93ef9a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_ProcessDocument_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the process_document call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document. +# +def process_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::ProcessRequest.new + + # Call the process_document method. + result = client.process_document request + + # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessResponse. + p result +end +# [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb new file mode 100644 index 000000000000..18c4c4dd5cc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_ReviewDocument_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the review_document call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document. +# +def review_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb new file mode 100644 index 000000000000..47b602eed327 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the set_default_processor_version call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#set_default_processor_version. +# +def set_default_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb new file mode 100644 index 000000000000..d65c94187c1c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the train_processor_version call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#train_processor_version. +# +def train_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb new file mode 100644 index 000000000000..6169b3b7d5fe --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] +require "google/cloud/document_ai/v1" + +## +# Snippet for the undeploy_processor_version call in the DocumentProcessorService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#undeploy_processor_version. +# +def undeploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json b/owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json new file mode 100644 index 000000000000..f199771089be --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json @@ -0,0 +1,895 @@ +{ + "client_library": { + "name": "google-cloud-document_ai-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.documentai.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#process_document.", + "file": "document_processor_service/process_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "process_document", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::ProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::ProcessResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ProcessDocument", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#batch_process_documents.", + "file": "document_processor_service/batch_process_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_process_documents", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::BatchProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "BatchProcessDocuments", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#fetch_processor_types.", + "file": "document_processor_service/fetch_processor_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_processor_types", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "FetchProcessorTypes", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_processor_types.", + "file": "document_processor_service/list_processor_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processor_types", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::ListProcessorTypesResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessorTypes", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_processor_type.", + "file": "document_processor_service/get_processor_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor_type", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::ProcessorType", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessorType", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_processors.", + "file": "document_processor_service/list_processors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processors", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::ListProcessorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::ListProcessorsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessors", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessors", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_processor.", + "file": "document_processor_service/get_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::GetProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::Processor", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessor", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#train_processor_version.", + "file": "document_processor_service/train_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "train_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#train_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "TrainProcessorVersion", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_processor_version.", + "file": "document_processor_service/get_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::ProcessorVersion", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessorVersion", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_processor_versions.", + "file": "document_processor_service/list_processor_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processor_versions", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::ListProcessorVersionsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessorVersions", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#delete_processor_version.", + "file": "document_processor_service/delete_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeleteProcessorVersion", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#deploy_processor_version.", + "file": "document_processor_service/deploy_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "deploy_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#deploy_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeployProcessorVersion", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#undeploy_processor_version.", + "file": "document_processor_service/undeploy_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "undeploy_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#undeploy_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "UndeployProcessorVersion", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#create_processor.", + "file": "document_processor_service/create_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_processor", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#create_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::CreateProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::Processor", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "CreateProcessor", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#delete_processor.", + "file": "document_processor_service/delete_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_processor", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::DeleteProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeleteProcessor", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#enable_processor.", + "file": "document_processor_service/enable_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_processor", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::EnableProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "EnableProcessor", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#disable_processor.", + "file": "document_processor_service/disable_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_processor", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::DisableProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DisableProcessor", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#set_default_processor_version.", + "file": "document_processor_service/set_default_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_default_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#set_default_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "SetDefaultProcessorVersion", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#review_document.", + "file": "document_processor_service/review_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "review_document", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ReviewDocument", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#evaluate_processor_version.", + "file": "document_processor_service/evaluate_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "evaluate_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#evaluate_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "EvaluateProcessorVersion", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_evaluation.", + "file": "document_processor_service/get_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_evaluation", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::GetEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::Evaluation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetEvaluation", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetEvaluation", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_evaluations.", + "file": "document_processor_service/list_evaluations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_evaluations", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_evaluations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1::ListEvaluationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1::ListEvaluationsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListEvaluations", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListEvaluations", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb new file mode 100644 index 000000000000..97e56f4baf0a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service_pb" +require "google/cloud/documentai/v1/document_processor_service_services_pb" +require "google/cloud/document_ai/v1/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1::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 + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + 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::V1::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::V1::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::V1::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::V1::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::V1::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 + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb new file mode 100644 index 000000000000..2decd66edc80 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_evaluation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do + client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do + client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do + client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do + client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do + client = ::Google::Cloud::DocumentAI::V1::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-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb new file mode 100644 index 000000000000..8a2c6645d64f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb @@ -0,0 +1,1309 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service_pb" +require "google/cloud/document_ai/v1/document_processor_service/rest" + + +class ::Google::Cloud::DocumentAI::V1::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 + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_process_document + # Create test objects. + client_result = ::Google::Cloud::DocumentAI::V1::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" + skip_human_review = true + field_mask = {} + process_options = {} + labels = {} + + 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::V1::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::V1::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.process_document({ inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.process_document inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.process_document ::Google::Cloud::DocumentAI::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels) 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, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.process_document(::Google::Cloud::DocumentAI::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels), 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_documents = {} + document_output_config = {} + skip_human_review = true + process_options = {} + labels = {} + + 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::V1::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::V1::DocumentProcessorService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_process_documents({ name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_process_documents name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_process_documents ::Google::Cloud::DocumentAI::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_process_documents({ name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }, 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::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels), 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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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" + 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::V1::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::V1::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, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb new file mode 100644 index 000000000000..d1b7febd0bbc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb @@ -0,0 +1,1504 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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/v1/document_processor_service_pb" +require "google/cloud/documentai/v1/document_processor_service_services_pb" +require "google/cloud/document_ai/v1/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1::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 + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_process_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1::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" + skip_human_review = true + field_mask = {} + process_options = {} + labels = {} + + 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::V1::ProcessRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::Document), request["inline_document"] + assert_equal :inline_document, request.source + assert_equal "hello world", request["name"] + 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::V1::ProcessOptions), request["process_options"] + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, process_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.process_document({ inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }) 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, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.process_document ::Google::Cloud::DocumentAI::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels) 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, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }, 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::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels), 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_documents = {} + document_output_config = {} + skip_human_review = true + process_options = {} + labels = {} + + 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::V1::BatchProcessRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig), request["input_documents"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::DocumentOutputConfig), request["document_output_config"] + assert_equal true, request["skip_human_review"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::ProcessOptions), request["process_options"] + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_process_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_process_documents({ name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }) 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_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels 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::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels) 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_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }, 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::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels), 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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::TrainProcessorVersionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion), request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::DocumentSchema), request["document_schema"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::CreateProcessorRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::Processor), request["processor"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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" + 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::V1::ReviewDocumentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::Document), request["inline_document"] + assert_equal :inline_document, request.source + assert_equal "hello world", request["human_review_config"] + assert_equal true, request["enable_schema_validation"] + assert_equal :DEFAULT, request["priority"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::DocumentSchema), request["document_schema"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, review_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1::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, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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::V1::EvaluateProcessorVersionRequest, request + assert_equal "hello world", request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig), request["evaluation_documents"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, evaluate_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb new file mode 100644 index 000000000000..48407bca7edb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 7df8552b3a93fb555d0a78ce59f110489843b6a3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 8 May 2024 20:58:24 +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 --- .../v1/document_processor_service/client.rb | 93 +- .../document_processor_service/rest/client.rb | 93 +- .../document_processor_service_services_pb.rb | 14 +- .../google/cloud/documentai/v1/document.rb | 204 +- .../google/cloud/documentai/v1/document_io.rb | 4 +- .../v1/document_processor_service.rb | 203 +- .../google/cloud/documentai/v1/processor.rb | 3 +- .../google-cloud-document_ai-v1/.gitignore | 22 - .../.repo-metadata.json | 19 - .../google-cloud-document_ai-v1/.rubocop.yml | 33 - .../google-cloud-document_ai-v1/.toys.rb | 28 - .../google-cloud-document_ai-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-document_ai-v1/CHANGELOG.md | 2 - .../google-cloud-document_ai-v1/Gemfile | 11 - .../google-cloud-document_ai-v1/LICENSE.md | 201 -- .../google-cloud-document_ai-v1/README.md | 144 - .../google-cloud-document_ai-v1/Rakefile | 169 -- .../gapic_metadata.json | 128 - .../google-cloud-document_ai-v1.gemspec | 29 - .../lib/google-cloud-document_ai-v1.rb | 21 - .../lib/google/cloud/document_ai/v1.rb | 45 - .../cloud/document_ai/v1/bindings_override.rb | 118 - .../v1/document_processor_service.rb | 59 - .../v1/document_processor_service/client.rb | 2665 ----------------- .../document_processor_service/credentials.rb | 51 - .../document_processor_service/operations.rb | 801 ----- .../v1/document_processor_service/paths.rb | 151 - .../v1/document_processor_service/rest.rb | 57 - .../document_processor_service/rest/client.rb | 2493 --------------- .../rest/operations.rb | 922 ------ .../rest/service_stub.rb | 1394 --------- .../lib/google/cloud/document_ai/v1/rest.rb | 38 - .../google/cloud/document_ai/v1/version.rb | 28 - .../google/cloud/documentai/v1/barcode_pb.rb | 42 - .../cloud/documentai/v1/document_io_pb.rb | 55 - .../google/cloud/documentai/v1/document_pb.rb | 102 - .../v1/document_processor_service_pb.rb | 129 - .../document_processor_service_services_pb.rb | 105 - .../cloud/documentai/v1/document_schema_pb.rb | 47 - .../cloud/documentai/v1/evaluation_pb.rb | 52 - .../google/cloud/documentai/v1/geometry_pb.rb | 44 - .../documentai/v1/operation_metadata_pb.rb | 46 - .../cloud/documentai/v1/processor_pb.rb | 57 - .../cloud/documentai/v1/processor_type_pb.rb | 46 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 399 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 -- .../google/cloud/documentai/v1/barcode.rb | 73 - .../google/cloud/documentai/v1/document.rb | 1047 ------- .../google/cloud/documentai/v1/document_io.rb | 201 -- .../v1/document_processor_service.rb | 981 ------ .../cloud/documentai/v1/document_schema.rb | 165 - .../google/cloud/documentai/v1/evaluation.rb | 199 -- .../google/cloud/documentai/v1/geometry.rb | 65 - .../cloud/documentai/v1/operation_metadata.rb | 68 - .../google/cloud/documentai/v1/processor.rb | 210 -- .../cloud/documentai/v1/processor_type.rb | 66 - .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 145 - .../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 | 54 - .../create_processor.rb | 47 - .../delete_processor.rb | 54 - .../delete_processor_version.rb | 54 - .../deploy_processor_version.rb | 54 - .../disable_processor.rb | 54 - .../enable_processor.rb | 54 - .../evaluate_processor_version.rb | 54 - .../fetch_processor_types.rb | 47 - .../get_evaluation.rb | 47 - .../get_processor.rb | 47 - .../get_processor_type.rb | 47 - .../get_processor_version.rb | 47 - .../list_evaluations.rb | 51 - .../list_processor_types.rb | 51 - .../list_processor_versions.rb | 51 - .../list_processors.rb | 51 - .../process_document.rb | 47 - .../review_document.rb | 54 - .../set_default_processor_version.rb | 54 - .../train_processor_version.rb | 54 - .../undeploy_processor_version.rb | 54 - ...t_metadata_google.cloud.documentai.v1.json | 895 ------ ...ument_processor_service_operations_test.rb | 389 --- .../document_processor_service_paths_test.rb | 107 - .../document_processor_service_rest_test.rb | 1309 -------- .../v1/document_processor_service_test.rb | 1504 ---------- .../test/helper.rb | 25 - 102 files changed, 391 insertions(+), 21424 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/barcode_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/evaluation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/geometry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/operation_metadata_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/geometry.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/color.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/datetime.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/money.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/postal_address.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb index 6399b717504e..289185ef08c3 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb @@ -232,17 +232,22 @@ def initialize # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash] # A raw document on Google Cloud Storage. # @param name [::String] - # Required. The resource name of the {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} - # to use for processing. If a {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server will use - # its {::Google::Cloud::DocumentAI::V1::Processor#default_processor_version default version}. Format: - # `projects/{project}/locations/{location}/processors/{processor}`, or + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server + # will use its [default + # version][google.cloud.documentai.v1.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @param 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::V1::ProcessResponse#document ProcessResponse.document} + # Specifies which fields to include in the + # {::Google::Cloud::DocumentAI::V1::ProcessResponse#document ProcessResponse.document} # output. Only supports top-level document and pages field, so it must be in # the form of `{document_field_name}` or `pages.{page_field_name}`. # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash] @@ -339,7 +344,8 @@ def process_document request, options = nil # 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::V1::Processor Processor} or + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. # Format: `projects/{project}/locations/{location}/processors/{processor}`, # or @@ -438,7 +444,8 @@ def batch_process_documents request, options = nil end ## - # Fetches processor types. Note that we don't use {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} + # Fetches processor types. Note that we don't use + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} # here, because it isn't paginated. # # @overload fetch_processor_types(request, options = nil) @@ -725,8 +732,8 @@ def get_processor_type request, options = nil # 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}` + # 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. @@ -914,17 +921,19 @@ def get_processor request, options = nil # @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash] # Options to control foundation model tuning of a processor. # @param parent [::String] - # Required. The parent (project, location and processor) to create the new version for. - # Format: `projects/{project}/locations/{location}/processors/{processor}`. + # 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::V1::ProcessorVersion, ::Hash] # Required. The processor version to be created. # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash] # Optional. The schema the processor version will be trained with. # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash] - # Optional. The input data used to train the {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1::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: + # 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 @@ -1103,8 +1112,9 @@ def get_processor_version request, options = nil # 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}` + # 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. @@ -1463,8 +1473,9 @@ def undeploy_processor_version request, options = nil end ## - # Creates a processor from the {::Google::Cloud::DocumentAI::V1::ProcessorType ProcessorType} provided. - # The processor will be at `ENABLED` state by default after its creation. + # Creates a processor from the + # {::Google::Cloud::DocumentAI::V1::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 @@ -1482,11 +1493,14 @@ def undeploy_processor_version request, options = nil # 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}` + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` # @param processor [::Google::Cloud::DocumentAI::V1::Processor, ::Hash] - # Required. The processor to be created, requires {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and - # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} to be set. Also, the {::Google::Cloud::DocumentAI::V1::Processor#kms_key_name Processor.kms_key_name} + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and + # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} + # to be set. Also, the + # {::Google::Cloud::DocumentAI::V1::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 @@ -1834,8 +1848,10 @@ def disable_processor request, options = nil end ## - # Set the default (active) version of a {::Google::Cloud::DocumentAI::V1::Processor Processor} that will be used in - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} and + # Set the default (active) version of a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} that will be used in + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} + # and # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. # # @overload set_default_processor_version(request, options = nil) @@ -1854,10 +1870,13 @@ def disable_processor request, options = nil # 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::V1::Processor Processor} to change default version. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} to change default + # version. # @param default_processor_version [::String] - # Required. The resource name of child {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to use as default. - # Format: + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1::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 @@ -1954,8 +1973,9 @@ def set_default_processor_version request, options = nil # @param inline_document [::Google::Cloud::DocumentAI::V1::Document, ::Hash] # An inline document proto. # @param human_review_config [::String] - # Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - # reviewed with. + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + # document will be reviewed with. # @param enable_schema_validation [::Boolean] # Whether the validation should be performed on the ad-hoc review request. # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority] @@ -2055,11 +2075,13 @@ def review_document request, options = nil # 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::V1::ProcessorVersion ProcessorVersion} to evaluate. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to + # evaluate. # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @param evaluation_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash] - # Optional. The documents used in the evaluation. If unspecified, use the processor's - # dataset as evaluation input. + # 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] @@ -2152,7 +2174,8 @@ def evaluate_processor_version request, options = nil # 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::V1::Evaluation Evaluation} to get. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::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 @@ -2238,7 +2261,9 @@ def get_evaluation request, options = nil # 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::V1::ProcessorVersion ProcessorVersion} to list evaluations for. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to list + # evaluations for. # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @param page_size [::Integer] # The standard list page size. diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb index bc0e52fe476e..06b21b88b35e 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb @@ -226,17 +226,22 @@ def initialize # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash] # A raw document on Google Cloud Storage. # @param name [::String] - # Required. The resource name of the {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} - # to use for processing. If a {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server will use - # its {::Google::Cloud::DocumentAI::V1::Processor#default_processor_version default version}. Format: - # `projects/{project}/locations/{location}/processors/{processor}`, or + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server + # will use its [default + # version][google.cloud.documentai.v1.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @param 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::V1::ProcessResponse#document ProcessResponse.document} + # Specifies which fields to include in the + # {::Google::Cloud::DocumentAI::V1::ProcessResponse#document ProcessResponse.document} # output. Only supports top-level document and pages field, so it must be in # the form of `{document_field_name}` or `pages.{page_field_name}`. # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash] @@ -326,7 +331,8 @@ def process_document request, options = nil # 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::V1::Processor Processor} or + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. # Format: `projects/{project}/locations/{location}/processors/{processor}`, # or @@ -418,7 +424,8 @@ def batch_process_documents request, options = nil end ## - # Fetches processor types. Note that we don't use {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#list_processor_types ListProcessorTypes} + # Fetches processor types. Note that we don't use + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#list_processor_types ListProcessorTypes} # here, because it isn't paginated. # # @overload fetch_processor_types(request, options = nil) @@ -684,8 +691,8 @@ def get_processor_type request, options = nil # 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}` + # 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. @@ -859,17 +866,19 @@ def get_processor request, options = nil # @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash] # Options to control foundation model tuning of a processor. # @param parent [::String] - # Required. The parent (project, location and processor) to create the new version for. - # Format: `projects/{project}/locations/{location}/processors/{processor}`. + # 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::V1::ProcessorVersion, ::Hash] # Required. The processor version to be created. # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash] # Optional. The schema the processor version will be trained with. # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash] - # Optional. The input data used to train the {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1::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: + # 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] @@ -1034,8 +1043,9 @@ def get_processor_version request, options = nil # 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}` + # 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. @@ -1366,8 +1376,9 @@ def undeploy_processor_version request, options = nil end ## - # Creates a processor from the {::Google::Cloud::DocumentAI::V1::ProcessorType ProcessorType} provided. - # The processor will be at `ENABLED` state by default after its creation. + # Creates a processor from the + # {::Google::Cloud::DocumentAI::V1::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 @@ -1385,11 +1396,14 @@ def undeploy_processor_version request, options = nil # 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}` + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` # @param processor [::Google::Cloud::DocumentAI::V1::Processor, ::Hash] - # Required. The processor to be created, requires {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and - # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} to be set. Also, the {::Google::Cloud::DocumentAI::V1::Processor#kms_key_name Processor.kms_key_name} + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and + # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} + # to be set. Also, the + # {::Google::Cloud::DocumentAI::V1::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::V1::Processor] @@ -1709,8 +1723,10 @@ def disable_processor request, options = nil end ## - # Set the default (active) version of a {::Google::Cloud::DocumentAI::V1::Processor Processor} that will be used in - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#process_document ProcessDocument} and + # Set the default (active) version of a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} that will be used in + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#process_document ProcessDocument} + # and # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments}. # # @overload set_default_processor_version(request, options = nil) @@ -1729,10 +1745,13 @@ def disable_processor request, options = nil # 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::V1::Processor Processor} to change default version. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} to change default + # version. # @param default_processor_version [::String] - # Required. The resource name of child {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to use as default. - # Format: + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1::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] @@ -1822,8 +1841,9 @@ def set_default_processor_version request, options = nil # @param inline_document [::Google::Cloud::DocumentAI::V1::Document, ::Hash] # An inline document proto. # @param human_review_config [::String] - # Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - # reviewed with. + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + # document will be reviewed with. # @param enable_schema_validation [::Boolean] # Whether the validation should be performed on the ad-hoc review request. # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority] @@ -1916,11 +1936,13 @@ def review_document request, options = nil # 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::V1::ProcessorVersion ProcessorVersion} to evaluate. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to + # evaluate. # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @param evaluation_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash] - # Optional. The documents used in the evaluation. If unspecified, use the processor's - # dataset as evaluation input. + # 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] @@ -2006,7 +2028,8 @@ def evaluate_processor_version request, options = nil # 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::V1::Evaluation Evaluation} to get. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::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::V1::Evaluation] @@ -2085,7 +2108,9 @@ def get_evaluation request, options = nil # 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::V1::ProcessorVersion ProcessorVersion} to list evaluations for. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to list + # evaluations for. # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @param page_size [::Integer] # The standard list page size. diff --git a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb index 232215fcb1d8..e2d2f3b8d184 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb @@ -41,7 +41,8 @@ class Service # 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::V1::BatchProcessRequest, ::Google::Longrunning::Operation - # Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + # Fetches processor types. Note that we don't use + # [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] # here, because it isn't paginated. rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse # Lists the processor types that exist. @@ -67,8 +68,9 @@ class Service rpc :DeployProcessorVersion, ::Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest, ::Google::Longrunning::Operation # Undeploys the processor version. rpc :UndeployProcessorVersion, ::Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest, ::Google::Longrunning::Operation - # Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. - # The processor will be at `ENABLED` state by default after its creation. + # Creates a processor from the + # [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + # processor will be at `ENABLED` state by default after its creation. rpc :CreateProcessor, ::Google::Cloud::DocumentAI::V1::CreateProcessorRequest, ::Google::Cloud::DocumentAI::V1::Processor # Deletes the processor, unloads all deployed model artifacts if it was # enabled and then deletes all artifacts associated with this processor. @@ -77,8 +79,10 @@ class Service rpc :EnableProcessor, ::Google::Cloud::DocumentAI::V1::EnableProcessorRequest, ::Google::Longrunning::Operation # Disables a processor rpc :DisableProcessor, ::Google::Cloud::DocumentAI::V1::DisableProcessorRequest, ::Google::Longrunning::Operation - # Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in - # [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + # Set the default (active) version of a + # [Processor][google.cloud.documentai.v1.Processor] that will be used in + # [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + # and # [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. rpc :SetDefaultProcessorVersion, ::Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest, ::Google::Longrunning::Operation # Send a document for Human Review. The input document should be processed by diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb index 0dec9006c96c..152ac0bdc862 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb @@ -52,16 +52,19 @@ module V1 # Visual page layout for the {::Google::Cloud::DocumentAI::V1::Document Document}. # @!attribute [rw] entities # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Entity>] - # A list of entities detected on {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. For document shards, - # entities in this list may cross shard boundaries. + # A list of entities detected on + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. For document + # shards, entities in this list may cross shard boundaries. # @!attribute [rw] entity_relations # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::EntityRelation>] - # Placeholder. Relationship among {::Google::Cloud::DocumentAI::V1::Document#entities Document.entities}. + # Placeholder. Relationship among + # {::Google::Cloud::DocumentAI::V1::Document#entities Document.entities}. # @!attribute [rw] text_changes # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::TextChange>] - # Placeholder. A list of text corrections made to {::Google::Cloud::DocumentAI::V1::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. + # Placeholder. A list of text corrections made to + # {::Google::Cloud::DocumentAI::V1::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::V1::Document::ShardInfo] # Information about the sharding if this document is sharded part of a larger @@ -87,7 +90,8 @@ class Document # Total number of shards. # @!attribute [rw] text_offset # @return [::Integer] - # The index of the first character in {::Google::Cloud::DocumentAI::V1::Document#text Document.text} in the overall + # The index of the first character in + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text} in the overall # document global text. class ShardInfo include ::Google::Protobuf::MessageExts @@ -98,7 +102,8 @@ class ShardInfo # conventions as much as possible. # @!attribute [rw] text_anchor # @return [::Google::Cloud::DocumentAI::V1::Document::TextAnchor] - # Text anchor indexing into the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. # @!attribute [rw] color # @return [::Google::Type::Color] # Text color. @@ -147,9 +152,11 @@ class FontSize # A page in a {::Google::Cloud::DocumentAI::V1::Document Document}. # @!attribute [rw] page_number # @return [::Integer] - # 1-based index for current {::Google::Cloud::DocumentAI::V1::Document::Page Page} in a parent {::Google::Cloud::DocumentAI::V1::Document Document}. - # Useful when a page is taken out of a {::Google::Cloud::DocumentAI::V1::Document Document} for individual - # processing. + # 1-based index for current + # {::Google::Cloud::DocumentAI::V1::Document::Page Page} in a parent + # {::Google::Cloud::DocumentAI::V1::Document Document}. Useful when a page is + # taken out of a {::Google::Cloud::DocumentAI::V1::Document Document} for + # individual processing. # @!attribute [rw] image # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Image] # Rendered image for this page. This image is preprocessed to remove any @@ -271,18 +278,23 @@ class Matrix # Visual element describing a layout unit on a page. # @!attribute [rw] text_anchor # @return [::Google::Cloud::DocumentAI::V1::Document::TextAnchor] - # Text anchor indexing into the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. # @!attribute [rw] confidence # @return [::Float] - # Confidence of the current {::Google::Cloud::DocumentAI::V1::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]`. + # Confidence of the current + # {::Google::Cloud::DocumentAI::V1::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::V1::BoundingPoly] - # The bounding polygon for the {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout}. + # The bounding polygon for the + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout}. # @!attribute [rw] orientation # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout::Orientation] - # Detected orientation for the {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout}. + # Detected orientation for the + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout}. class Layout include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -313,7 +325,8 @@ module Orientation # common line-spacing and orientation. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::Block Block}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Block Block}. # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. @@ -329,7 +342,8 @@ class Block # A collection of lines that a human would perceive as a paragraph. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::Paragraph Paragraph}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Paragraph Paragraph}. # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. @@ -346,7 +360,8 @@ class Paragraph # Does not cross column boundaries, can be horizontal, vertical, etc. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::Line Line}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Line Line}. # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. @@ -362,10 +377,12 @@ class Line # A detected token. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. # @!attribute [rw] detected_break # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Token::DetectedBreak] - # Detected break at the end of a {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. + # Detected break at the end of a + # {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. @@ -380,7 +397,8 @@ class Token include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods - # Detected break at the end of a {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. + # Detected break at the end of a + # {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. # @!attribute [rw] type # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Token::DetectedBreak::Type] # Detected break type. @@ -410,8 +428,9 @@ module Type # 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::V1::Document::Page::Token::StyleInfo#font_size font_size}_ * - # _resolution_ ÷ `72.0`. + # Font size in pixels, equal to _unrounded + # {::Google::Cloud::DocumentAI::V1::Document::Page::Token::StyleInfo#font_size font_size}_ + # * _resolution_ ÷ `72.0`. # @!attribute [rw] letter_spacing # @return [::Float] # Letter spacing in points. @@ -420,8 +439,9 @@ module Type # Name or style of the font. # @!attribute [rw] bold # @return [::Boolean] - # Whether the text is bold (equivalent to {::Google::Cloud::DocumentAI::V1::Document::Page::Token::StyleInfo#font_weight font_weight} is at least - # `700`). + # Whether the text is bold (equivalent to + # {::Google::Cloud::DocumentAI::V1::Document::Page::Token::StyleInfo#font_weight font_weight} + # is at least `700`). # @!attribute [rw] italic # @return [::Boolean] # Whether the text is italic. @@ -462,7 +482,8 @@ class StyleInfo # A detected symbol. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::Symbol Symbol}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Symbol Symbol}. # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. @@ -475,10 +496,12 @@ class Symbol # page. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. # @!attribute [rw] type # @return [::String] - # Type of the {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. + # Type of the + # {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. @@ -490,7 +513,8 @@ class VisualElement # A table representation similar to HTML table structure. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::Table Table}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Table Table}. # @!attribute [rw] header_rows # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::Table::TableRow>] # Header rows of the table. @@ -520,7 +544,8 @@ class TableRow # A cell representation inside the table. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::Table::TableCell TableCell}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::Table::TableCell TableCell}. # @!attribute [rw] row_span # @return [::Integer] # How many rows this cell spans. @@ -539,11 +564,13 @@ class TableCell # A form field detected on the page. # @!attribute [rw] field_name # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} name. e.g. `Address`, `Email`, - # `Grand total`, `Phone number`, etc. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} name. + # e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. # @!attribute [rw] field_value # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} value. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} value. # @!attribute [rw] name_detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages for name together with confidence. @@ -579,10 +606,12 @@ class FormField # A detected barcode. # @!attribute [rw] layout # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode DetectedBarcode}. + # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode DetectedBarcode}. # @!attribute [rw] barcode # @return [::Google::Cloud::DocumentAI::V1::Barcode] - # Detailed barcode information of the {::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode DetectedBarcode}. + # Detailed barcode information of the + # {::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode DetectedBarcode}. class DetectedBarcode include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -643,7 +672,8 @@ class DetectedDefect # @!attribute [rw] text_anchor # @return [::Google::Cloud::DocumentAI::V1::Document::TextAnchor] # Optional. Provenance of the entity. - # Text anchor indexing into the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. # @!attribute [rw] type # @return [::String] # Required. Entity type from a schema e.g. `Address`. @@ -658,28 +688,29 @@ class DetectedDefect # Optional. Confidence of detected Schema entity. Range `[0, 1]`. # @!attribute [rw] page_anchor # @return [::Google::Cloud::DocumentAI::V1::Document::PageAnchor] - # Optional. Represents the provenance of this entity wrt. the location on the - # page where it was found. + # 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::V1::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 + # 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::V1::Document::Entity>] - # Optional. Entities can be nested to form a hierarchical data structure representing - # the content in the document. + # Optional. Entities can be nested to form a hierarchical data structure + # representing the content in the document. # @!attribute [rw] provenance # @return [::Google::Cloud::DocumentAI::V1::Document::Provenance] # Optional. The history of this annotation. # @!attribute [rw] redacted # @return [::Boolean] - # Optional. Whether the entity will be redacted for de-identification purposes. + # Optional. Whether the entity will be redacted for de-identification + # purposes. class Entity include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -730,7 +761,8 @@ class NormalizedValue end end - # Relationship between {::Google::Cloud::DocumentAI::V1::Document::Entity Entities}. + # Relationship between + # {::Google::Cloud::DocumentAI::V1::Document::Entity Entities}. # @!attribute [rw] subject_id # @return [::String] # Subject entity id. @@ -745,10 +777,12 @@ class EntityRelation extend ::Google::Protobuf::MessageExts::ClassMethods end - # Text reference indexing into the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # Text reference indexing into the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. # @!attribute [rw] text_segments # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment>] - # The text segments from the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # The text segments from the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. # @!attribute [rw] content # @return [::String] # Contains the content of the text span so that users do @@ -758,15 +792,20 @@ class TextAnchor include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods - # A text segment in the {::Google::Cloud::DocumentAI::V1::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::V1::Document::ShardInfo#text_offset ShardInfo.text_offset} + # A text segment in the + # {::Google::Cloud::DocumentAI::V1::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::V1::Document::ShardInfo#text_offset ShardInfo.text_offset} # @!attribute [rw] start_index # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} start UTF-8 char index in the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. + # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} + # start UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. # @!attribute [rw] end_index # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} half open end UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} + # half open end UTF-8 char index in the # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. class TextSegment include ::Google::Protobuf::MessageExts @@ -774,9 +813,10 @@ class TextSegment end end - # Referencing the visual context of the entity in the {::Google::Cloud::DocumentAI::V1::Document#pages Document.pages}. - # Page anchors can be cross-page, consist of multiple bounding polygons and - # optionally reference specific layout element types. + # Referencing the visual context of the entity in the + # {::Google::Cloud::DocumentAI::V1::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::V1::Document::PageAnchor::PageRef>] # One or more references to visual page elements @@ -787,25 +827,31 @@ class PageAnchor # Represents a weak reference to a page element within a document. # @!attribute [rw] page # @return [::Integer] - # Required. Index into the {::Google::Cloud::DocumentAI::V1::Document#pages Document.pages} element, for example using + # Required. Index into the + # {::Google::Cloud::DocumentAI::V1::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::V1::Document::PageAnchor::PageRef::LayoutType] - # Optional. The type of the layout element that is being referenced if any. + # Optional. The type of the layout element that is being referenced if + # any. # @!attribute [rw] layout_id # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::String] - # Optional. Deprecated. Use {::Google::Cloud::DocumentAI::V1::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} instead. + # Optional. Deprecated. Use + # {::Google::Cloud::DocumentAI::V1::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} + # instead. # @!attribute [rw] bounding_poly # @return [::Google::Cloud::DocumentAI::V1::BoundingPoly] - # Optional. Identifies the bounding polygon of a layout element on the page. - # If `layout_type` is set, the bounding polygon must be exactly the same - # to the layout element it's referring to. + # Optional. Identifies the bounding polygon of a layout element on the + # page. If `layout_type` is set, the bounding polygon must be exactly the + # same to the layout element it's referring to. # @!attribute [rw] confidence # @return [::Float] - # Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. + # Optional. Confidence of detected page element, if applicable. Range + # `[0, 1]`. class PageRef include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -815,25 +861,38 @@ module LayoutType # Layout Unspecified. LAYOUT_TYPE_UNSPECIFIED = 0 - # References a {::Google::Cloud::DocumentAI::V1::Document::Page#blocks Page.blocks} element. + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#blocks Page.blocks} + # element. BLOCK = 1 - # References a {::Google::Cloud::DocumentAI::V1::Document::Page#paragraphs Page.paragraphs} element. + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#paragraphs Page.paragraphs} + # element. PARAGRAPH = 2 - # References a {::Google::Cloud::DocumentAI::V1::Document::Page#lines Page.lines} element. + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#lines Page.lines} element. LINE = 3 - # References a {::Google::Cloud::DocumentAI::V1::Document::Page#tokens Page.tokens} element. + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#tokens Page.tokens} + # element. TOKEN = 4 - # References a {::Google::Cloud::DocumentAI::V1::Document::Page#visual_elements Page.visual_elements} element. + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#visual_elements Page.visual_elements} + # element. VISUAL_ELEMENT = 5 - # Refrrences a {::Google::Cloud::DocumentAI::V1::Document::Page#tables Page.tables} element. + # Refrrences a + # {::Google::Cloud::DocumentAI::V1::Document::Page#tables Page.tables} + # element. TABLE = 6 - # References a {::Google::Cloud::DocumentAI::V1::Document::Page#form_fields Page.form_fields} element. + # References a + # {::Google::Cloud::DocumentAI::V1::Document::Page#form_fields Page.form_fields} + # element. FORM_FIELD = 7 end end @@ -965,8 +1024,9 @@ class HumanReview # @!attribute [rw] text_anchor # @return [::Google::Cloud::DocumentAI::V1::Document::TextAnchor] # Provenance of the correction. - # Text anchor indexing into the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. There can only be a - # single `TextAnchor.text_segments` element. If the start and + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1::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 diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb index 2cf7ab6a8b7c..cc6a3c8d3ae6 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb @@ -151,7 +151,9 @@ class ShardingConfig # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Boolean] # Turn on font identification model and return font style information. - # Deprecated, use {::Google::Cloud::DocumentAI::V1::OcrConfig::PremiumFeatures#compute_style_info PremiumFeatures.compute_style_info} instead. + # Deprecated, use + # {::Google::Cloud::DocumentAI::V1::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 diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb index 87f2928ee80c..012b0e5d35dd 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb @@ -38,9 +38,11 @@ module V1 # Returns error if set on other processor types. # @!attribute [rw] schema_override # @return [::Google::Cloud::DocumentAI::V1::DocumentSchema] - # Optional. Override the schema of the {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. Will return an Invalid - # Argument error if this field is set when the underlying - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} doesn't support schema override. + # Optional. Override the schema of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. Will + # return an Invalid Argument error if this field is set when the underlying + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} doesn't + # support schema override. class ProcessOptions include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -56,7 +58,8 @@ class IndividualPageSelector end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} + # method. # @!attribute [rw] inline_document # @return [::Google::Cloud::DocumentAI::V1::Document] # An inline document proto. @@ -68,11 +71,15 @@ class IndividualPageSelector # A raw document on Google Cloud Storage. # @!attribute [rw] name # @return [::String] - # Required. The resource name of the {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} - # to use for processing. If a {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server will use - # its {::Google::Cloud::DocumentAI::V1::Processor#default_processor_version default version}. Format: - # `projects/{project}/locations/{location}/processors/{processor}`, or + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server + # will use its [default + # version][google.cloud.documentai.v1.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @!attribute [rw] skip_human_review # @return [::Boolean] @@ -80,7 +87,8 @@ class IndividualPageSelector # `false`. # @!attribute [rw] field_mask # @return [::Google::Protobuf::FieldMask] - # Specifies which fields to include in the {::Google::Cloud::DocumentAI::V1::ProcessResponse#document ProcessResponse.document} + # Specifies which fields to include in the + # {::Google::Cloud::DocumentAI::V1::ProcessResponse#document ProcessResponse.document} # output. Only supports top-level document and pages field, so it must be in # the form of `{document_field_name}` or `pages.{page_field_name}`. # @!attribute [rw] process_options @@ -118,9 +126,11 @@ class LabelsEntry # @!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::V1::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::V1::DocumentProcessorService::Client#review_document ReviewDocument}. + # is populated only when the + # {::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#review_document ReviewDocument}. class HumanReviewStatus include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -142,13 +152,15 @@ module State IN_PROGRESS = 3 # Some error happened during triggering human review, see the - # {::Google::Cloud::DocumentAI::V1::HumanReviewStatus#state_message state_message} for details. + # {::Google::Cloud::DocumentAI::V1::HumanReviewStatus#state_message state_message} + # for details. ERROR = 4 end end # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} + # method. # @!attribute [rw] document # @return [::Google::Cloud::DocumentAI::V1::Document] # The document payload, will populate fields based on the processor's @@ -165,7 +177,8 @@ class ProcessResponse # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. # @!attribute [rw] name # @return [::String] - # Required. The resource name of {::Google::Cloud::DocumentAI::V1::Processor Processor} or + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1::Processor Processor} or # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. # Format: `projects/{project}/locations/{location}/processors/{processor}`, # or @@ -241,16 +254,17 @@ class BatchProcessMetadata # 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::V1::BatchProcessMetadata::IndividualProcessStatus#input_gcs_source input_gcs_source} field in the - # request when the batch process started. + # The source of the document, same as the + # {::Google::Cloud::DocumentAI::V1::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::V1::DocumentOutputConfig::GcsOutputConfig#gcs_uri DocumentOutputConfig.GcsOutputConfig.gcs_uri}) of the processed - # document if it was successful, otherwise empty. + # {::Google::Cloud::DocumentAI::V1::DocumentOutputConfig::GcsOutputConfig#gcs_uri DocumentOutputConfig.GcsOutputConfig.gcs_uri}) + # of the processed document if it was successful, otherwise empty. # @!attribute [rw] human_review_status # @return [::Google::Cloud::DocumentAI::V1::HumanReviewStatus] # The status of human review on the processed document. @@ -285,8 +299,9 @@ module State end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} method. - # Some processor types may require the project be added to an allowlist. + # {::Google::Cloud::DocumentAI::V1::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. @@ -297,7 +312,8 @@ class FetchProcessorTypesRequest end # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} + # method. # @!attribute [rw] processor_types # @return [::Array<::Google::Cloud::DocumentAI::V1::ProcessorType>] # The list of processor types. @@ -307,8 +323,9 @@ class FetchProcessorTypesResponse end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} method. - # Some processor types may require the project be added to an allowlist. + # {::Google::Cloud::DocumentAI::V1::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. @@ -327,7 +344,8 @@ class ListProcessorTypesRequest end # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} + # method. # @!attribute [rw] processor_types # @return [::Array<::Google::Cloud::DocumentAI::V1::ProcessorType>] # The processor types. @@ -342,8 +360,8 @@ class ListProcessorTypesResponse # 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}` + # 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. @@ -359,7 +377,8 @@ class ListProcessorsRequest end # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processors ListProcessors} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processors ListProcessors} + # method. # @!attribute [rw] processors # @return [::Array<::Google::Cloud::DocumentAI::V1::Processor>] # The list of processors. @@ -372,7 +391,8 @@ class ListProcessorsResponse end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_type GetProcessorType} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_type GetProcessorType} + # method. # @!attribute [rw] name # @return [::String] # Required. The processor type resource name. @@ -381,7 +401,8 @@ class GetProcessorTypeRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request message for the {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor GetProcessor} + # Request message for the + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor GetProcessor} # method. # @!attribute [rw] name # @return [::String] @@ -392,7 +413,8 @@ class GetProcessorRequest end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_version GetProcessorVersion} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_version GetProcessorVersion} + # method. # @!attribute [rw] name # @return [::String] # Required. The processor resource name. @@ -404,8 +426,9 @@ class GetProcessorVersionRequest # 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}` + # 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. @@ -517,17 +540,21 @@ class UndeployProcessorVersionMetadata end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#create_processor CreateProcessor} method. Notice - # this request is sent to a regionalized backend service. If the - # {::Google::Cloud::DocumentAI::V1::ProcessorType ProcessorType} isn't available in that region, the creation fails. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#create_processor CreateProcessor} + # method. Notice this request is sent to a regionalized backend service. If the + # {::Google::Cloud::DocumentAI::V1::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}` + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` # @!attribute [rw] processor # @return [::Google::Cloud::DocumentAI::V1::Processor] - # Required. The processor to be created, requires {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and - # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} to be set. Also, the {::Google::Cloud::DocumentAI::V1::Processor#kms_key_name Processor.kms_key_name} + # Required. The processor to be created, requires + # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and + # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} + # to be set. Also, the + # {::Google::Cloud::DocumentAI::V1::Processor#kms_key_name Processor.kms_key_name} # field must be set if the processor is under CMEK. class CreateProcessorRequest include ::Google::Protobuf::MessageExts @@ -535,7 +562,8 @@ class CreateProcessorRequest end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor DeleteProcessor} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor DeleteProcessor} + # method. # @!attribute [rw] name # @return [::String] # Required. The processor resource name to be deleted. @@ -545,7 +573,8 @@ class DeleteProcessorRequest end # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor DeleteProcessor} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor DeleteProcessor} + # method. # @!attribute [rw] common_metadata # @return [::Google::Cloud::DocumentAI::V1::CommonOperationMetadata] # The basic metadata of the long-running operation. @@ -555,7 +584,8 @@ class DeleteProcessorMetadata end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor EnableProcessor} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor EnableProcessor} + # method. # @!attribute [rw] name # @return [::String] # Required. The processor resource name to be enabled. @@ -565,15 +595,16 @@ class EnableProcessorRequest end # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor EnableProcessor} method. - # Intentionally empty proto for adding fields in future. + # {::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#enable_processor EnableProcessor} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor EnableProcessor} + # method. # @!attribute [rw] common_metadata # @return [::Google::Cloud::DocumentAI::V1::CommonOperationMetadata] # The basic metadata of the long-running operation. @@ -583,7 +614,8 @@ class EnableProcessorMetadata end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor DisableProcessor} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor DisableProcessor} + # method. # @!attribute [rw] name # @return [::String] # Required. The processor resource name to be disabled. @@ -593,15 +625,16 @@ class DisableProcessorRequest end # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor DisableProcessor} method. - # Intentionally empty proto for adding fields in future. + # {::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#disable_processor DisableProcessor} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor DisableProcessor} + # method. # @!attribute [rw] common_metadata # @return [::Google::Cloud::DocumentAI::V1::CommonOperationMetadata] # The basic metadata of the long-running operation. @@ -615,11 +648,14 @@ class DisableProcessorMetadata # method. # @!attribute [rw] processor # @return [::String] - # Required. The resource name of the {::Google::Cloud::DocumentAI::V1::Processor Processor} to change default version. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::Processor Processor} to change default + # version. # @!attribute [rw] default_processor_version # @return [::String] - # Required. The resource name of child {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to use as default. - # Format: + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to use as + # default. Format: # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` class SetDefaultProcessorVersionRequest include ::Google::Protobuf::MessageExts @@ -656,8 +692,9 @@ class SetDefaultProcessorVersionMetadata # Options to control foundation model tuning of a 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}`. + # 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::V1::ProcessorVersion] # Required. The processor version to be created. @@ -666,17 +703,19 @@ class SetDefaultProcessorVersionMetadata # Optional. The schema the processor version will be trained with. # @!attribute [rw] input_data # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData] - # Optional. The input data used to train the {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. + # Optional. The input data used to train the + # {::Google::Cloud::DocumentAI::V1::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: + # 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::V1::ProcessorVersion ProcessorVersion}. + # The input data used to train a new + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. # @!attribute [rw] training_documents # @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig] # The documents used for training the new version. @@ -711,13 +750,13 @@ module TrainingMethod # Options to control foundation model tuning of the processor. # @!attribute [rw] train_steps # @return [::Integer] - # Optional. The number of steps to run for model tuning. Valid values are between - # 1 and 400. If not provided, recommended steps will be used. + # Optional. The number of steps to run for model tuning. Valid values are + # between 1 and 400. If not provided, recommended steps will be used. # @!attribute [rw] learning_rate_multiplier # @return [::Float] - # Optional. The multiplier to apply to the recommended learning rate. Valid values - # are between 0.1 and 10. If not provided, recommended learning rate will - # be used. + # Optional. The multiplier to apply to the recommended learning rate. Valid + # values are between 0.1 and 10. If not provided, recommended learning rate + # will be used. class FoundationModelTuningOptions include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -773,14 +812,16 @@ class DatasetValidation end # Request message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document ReviewDocument} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document ReviewDocument} + # method. # @!attribute [rw] inline_document # @return [::Google::Cloud::DocumentAI::V1::Document] # An inline document proto. # @!attribute [rw] human_review_config # @return [::String] - # Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - # reviewed with. + # Required. The resource name of the + # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + # document will be reviewed with. # @!attribute [rw] enable_schema_validation # @return [::Boolean] # Whether the validation should be performed on the ad-hoc review request. @@ -806,7 +847,8 @@ module Priority end # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document ReviewDocument} method. + # {::Google::Cloud::DocumentAI::V1::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 @@ -835,7 +877,8 @@ module State end # The long-running operation metadata for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document ReviewDocument} method. + # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document ReviewDocument} + # method. # @!attribute [rw] common_metadata # @return [::Google::Cloud::DocumentAI::V1::CommonOperationMetadata] # The basic metadata of the long-running operation. @@ -847,15 +890,19 @@ class ReviewDocumentOperationMetadata extend ::Google::Protobuf::MessageExts::ClassMethods end - # Evaluates the given {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} against the supplied documents. + # Evaluates the given + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} against the + # supplied documents. # @!attribute [rw] processor_version # @return [::String] - # Required. The resource name of the {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to evaluate. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to + # evaluate. # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @!attribute [rw] evaluation_documents # @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig] - # Optional. The documents used in the evaluation. If unspecified, use the processor's - # dataset as evaluation input. + # 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 @@ -886,17 +933,21 @@ class EvaluateProcessorVersionResponse # Retrieves a specific Evaluation. # @!attribute [rw] name # @return [::String] - # Required. The resource name of the {::Google::Cloud::DocumentAI::V1::Evaluation Evaluation} to get. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion ProcessorVersion}. + # Retrieves a list of evaluations for a given + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. # @!attribute [rw] parent # @return [::String] - # Required. The resource name of the {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to list evaluations for. + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to list + # evaluations for. # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` # @!attribute [rw] page_size # @return [::Integer] diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb index 6a4da90f28e9..01478fdfb726 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb @@ -156,7 +156,8 @@ class ProcessorVersionAlias # Output only. The processor version aliases. # @!attribute [r] process_endpoint # @return [::String] - # Output only. Immutable. The http endpoint that can be called to invoke processing. + # 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. diff --git a/owl-bot-staging/google-cloud-document_ai-v1/.gitignore b/owl-bot-staging/google-cloud-document_ai-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/.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-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-document_ai-v1/.repo-metadata.json deleted file mode 100644 index 324701d83eda..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/.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-v1/latest", - "distribution_name": "google-cloud-document_ai-v1", - "is_cloud": true, - "language": "ruby", - "name": "documentai", - "name_pretty": "Document AI V1 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-v1 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-v1/.rubocop.yml b/owl-bot-staging/google-cloud-document_ai-v1/.rubocop.yml deleted file mode 100644 index 81caad112a12..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-document_ai-v1.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-v1.rb" diff --git a/owl-bot-staging/google-cloud-document_ai-v1/.toys.rb b/owl-bot-staging/google-cloud-document_ai-v1/.toys.rb deleted file mode 100644 index 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/.yardopts b/owl-bot-staging/google-cloud-document_ai-v1/.yardopts deleted file mode 100644 index d0bbaeca490b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Document AI V1 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-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-document_ai-v1/AUTHENTICATION.md deleted file mode 100644 index 3aaee31d105d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-document_ai-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-document_ai-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/document_ai/v1" - -client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/document_ai/v1" - -::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-document_ai-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/document_ai/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### 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 retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-document_ai-v1/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1/Gemfile deleted file mode 100644 index 95163a6d11f8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.27.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-document_ai-v1/LICENSE.md b/owl-bot-staging/google-cloud-document_ai-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/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-v1/README.md b/owl-bot-staging/google-cloud-document_ai-v1/README.md deleted file mode 100644 index 020c75dc4768..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Document AI V1 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 V1 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-v1 -``` - -## 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/v1" - -client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -request = ::Google::Cloud::DocumentAI::V1::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-v1/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.7+. - -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-v1`. -_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-v1`. - -### 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-v1/Rakefile b/owl-bot-staging/google-cloud-document_ai-v1/Rakefile deleted file mode 100644 index f8fe7eaea0b3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-document_ai-v1 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/v1/document_processor_service/credentials" - ::Google::Cloud::DocumentAI::V1::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-v1 gem has no acceptance tests." - end - 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-v1 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-v1 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-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-document_ai-v1" - header "google-cloud-document_ai-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-document_ai-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-document_ai-v1 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-v1 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-v1 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-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-document_ai-v1/gapic_metadata.json deleted file mode 100644 index 03e1832bdcca..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/gapic_metadata.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.documentai.v1", - "libraryPackage": "::Google::Cloud::DocumentAI::V1", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DocumentAI::V1::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" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec b/owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec deleted file mode 100644 index cb96c5dfba88..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/document_ai/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-document_ai-v1" - gem.version = Google::Cloud::DocumentAI::V1::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-v1 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.7" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb deleted file mode 100644 index 1c512f06d6b6..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google-cloud-document_ai-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1" diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb deleted file mode 100644 index 8379d676883f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service" -require "google/cloud/document_ai/v1/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/v1" - # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/document_ai/v1" - # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/document_ai/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb deleted file mode 100644 index d8050b547db5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/bindings_override.rb +++ /dev/null @@ -1,118 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/rest" - # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - module V1 - ## - # @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: "/v1/{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: "/v1/{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.v1 package. - # - # This class contains common configuration for all services - # of the google.cloud.documentai.v1 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-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb deleted file mode 100644 index c5b330ae138b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/version" - -require "google/cloud/document_ai/v1/document_processor_service/credentials" -require "google/cloud/document_ai/v1/document_processor_service/paths" -require "google/cloud/document_ai/v1/document_processor_service/operations" -require "google/cloud/document_ai/v1/document_processor_service/client" -require "google/cloud/document_ai/v1/document_processor_service/rest" - -module Google - module Cloud - module DocumentAI - module V1 - ## - # 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/v1/document_processor_service" - # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/document_ai/v1/document_processor_service/rest" - # client = ::Google::Cloud::DocumentAI::V1::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/v1/document_processor_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb deleted file mode 100644 index 524488238f74..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +++ /dev/null @@ -1,2665 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DocumentAI - module V1 - 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 - # @private - DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :document_processor_service_stub - - ## - # Configure the DocumentProcessorService Client class. - # - # See {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentProcessorService clients - # ::Google::Cloud::DocumentAI::V1::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", "V1"] - 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::V1::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 - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @document_processor_service_stub.universe_domain - end - - ## - # Create a new DocumentProcessorService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DocumentAI::V1::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/v1/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.nil? || - (@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 - config.universe_domain = @config.universe_domain - end - - @document_processor_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @document_processor_service_stub.endpoint - config.universe_domain = @document_processor_service_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::ProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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, skip_human_review: nil, field_mask: nil, process_options: nil, labels: 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::V1::Document, ::Hash] - # An inline document proto. - # @param raw_document [::Google::Cloud::DocumentAI::V1::RawDocument, ::Hash] - # A raw document content (bytes). - # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash] - # A raw document on Google Cloud Storage. - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server - # will use its [default - # version][google.cloud.documentai.v1.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param 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::V1::ProcessResponse#document ProcessResponse.document} - # output. Only supports top-level document and pages field, so it must be in - # the form of `{document_field_name}` or `pages.{page_field_name}`. - # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash] - # Inference-time options for the process API - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints) and can only contain lowercase letters, numeric - # characters, underscores, and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1::ProcessResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1::ProcessResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::ProcessRequest.new - # - # # Call the process_document method. - # result = client.process_document request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::BatchProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil, labels: 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::V1::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param input_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash] - # The input documents for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} - # method. - # @param document_output_config [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig, ::Hash] - # The output configuration for the - # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessOptions, ::Hash] - # Inference-time options for the process API - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints) and can only contain lowercase letters, numeric - # characters, underscores, and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # @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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::FetchProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::FetchProcessorTypesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new - # - # # Call the fetch_processor_types method. - # result = client.fetch_processor_types request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1::ProcessorType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new - # - # # Call the get_processor_type method. - # result = client.get_processor_type request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1::Processor] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new - # - # # Call the get_processor method. - # result = client.get_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::TrainProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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, foundation_model_tuning_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::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] - # Options to control Custom Document Extraction (CDE) Processor. - # @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash] - # Options to control foundation model tuning of a 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::V1::ProcessorVersion, ::Hash] - # Required. The processor version to be created. - # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash] - # Optional. The schema the processor version will be trained with. - # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash] - # Optional. The input data used to train the - # {::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new - # - # # Call the get_processor_version method. - # result = client.get_processor_version request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::DeleteProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::UndeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::CreateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor, ::Hash] - # Required. The processor to be created, requires - # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and - # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} - # to be set. Also, the - # {::Google::Cloud::DocumentAI::V1::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::V1::Processor] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1::Processor] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new - # - # # Call the create_processor method. - # result = client.create_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeleteProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EnableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DisableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Processor Processor} that will be used in - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} - # and - # {::Google::Cloud::DocumentAI::V1::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::V1::SetDefaultProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor Processor} to change default - # version. - # @param default_processor_version [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ReviewDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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, 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::V1::Document, ::Hash] - # An inline document proto. - # @param human_review_config [::String] - # Required. The resource name of the - # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - # document will be reviewed with. - # @param enable_schema_validation [::Boolean] - # Whether the validation should be performed on the ad-hoc review request. - # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @param document_schema [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EvaluateProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param evaluation_documents [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1::Evaluation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new - # - # # Call the get_evaluation method. - # result = client.get_evaluation request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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 - - ## - # 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::V1::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::V1::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::V1::DocumentProcessorService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!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] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - 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 - config_attr :universe_domain, 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 - - # @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 - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb deleted file mode 100644 index d8702ac3d3b3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb deleted file mode 100644 index 564b6e21b521..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb +++ /dev/null @@ -1,801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - module DocumentProcessorService - # Service that implements Longrunning Operations API. - class Operations - # @private - DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" - - # @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 - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - 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, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - 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::V1::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::V1::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::V1::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::V1::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::V1::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 - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!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] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - 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 - config_attr :universe_domain, 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb deleted file mode 100644 index 60ea10fcaa8d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb +++ /dev/null @@ -1,151 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb deleted file mode 100644 index 260a31c35e24..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/version" -require "google/cloud/document_ai/v1/bindings_override" - -require "google/cloud/document_ai/v1/document_processor_service/credentials" -require "google/cloud/document_ai/v1/document_processor_service/paths" -require "google/cloud/document_ai/v1/document_processor_service/rest/operations" -require "google/cloud/document_ai/v1/document_processor_service/rest/client" - -module Google - module Cloud - module DocumentAI - module V1 - ## - # 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/v1/document_processor_service/rest" - # client = ::Google::Cloud::DocumentAI::V1::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/v1/document_processor_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb deleted file mode 100644 index 8f98fa7824cd..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb +++ /dev/null @@ -1,2493 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service_pb" -require "google/cloud/document_ai/v1/document_processor_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DocumentAI - module V1 - 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 - # @private - DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :document_processor_service_stub - - ## - # Configure the DocumentProcessorService Client class. - # - # See {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentProcessorService clients - # ::Google::Cloud::DocumentAI::V1::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", "V1"] - 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::V1::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 - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @document_processor_service_stub.universe_domain - end - - ## - # Create a new DocumentProcessorService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DocumentAI::V1::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.nil? || - (@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::V1::DocumentProcessorService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @document_processor_service_stub = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @document_processor_service_stub.endpoint - config.universe_domain = @document_processor_service_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::ProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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, skip_human_review: nil, field_mask: nil, process_options: nil, labels: 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::V1::Document, ::Hash] - # An inline document proto. - # @param raw_document [::Google::Cloud::DocumentAI::V1::RawDocument, ::Hash] - # A raw document content (bytes). - # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash] - # A raw document on Google Cloud Storage. - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server - # will use its [default - # version][google.cloud.documentai.v1.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param 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::V1::ProcessResponse#document ProcessResponse.document} - # output. Only supports top-level document and pages field, so it must be in - # the form of `{document_field_name}` or `pages.{page_field_name}`. - # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash] - # Inference-time options for the process API - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints) and can only contain lowercase letters, numeric - # characters, underscores, and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DocumentAI::V1::ProcessResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::ProcessResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::ProcessRequest.new - # - # # Call the process_document method. - # result = client.process_document request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::BatchProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil, labels: 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::V1::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param input_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash] - # The input documents for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments} - # method. - # @param document_output_config [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig, ::Hash] - # The output configuration for the - # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessOptions, ::Hash] - # Inference-time options for the process API - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints) and can only contain lowercase letters, numeric - # characters, underscores, and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # @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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::FetchProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::FetchProcessorTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new - # - # # Call the fetch_processor_types method. - # result = client.fetch_processor_types request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::ProcessorType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new - # - # # Call the get_processor_type method. - # result = client.get_processor_type request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::GetProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::Processor] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new - # - # # Call the get_processor method. - # result = client.get_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::TrainProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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, foundation_model_tuning_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::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash] - # Options to control Custom Document Extraction (CDE) Processor. - # @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash] - # Options to control foundation model tuning of a 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::V1::ProcessorVersion, ::Hash] - # Required. The processor version to be created. - # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash] - # Optional. The schema the processor version will be trained with. - # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash] - # Optional. The input data used to train the - # {::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new - # - # # Call the get_processor_version method. - # result = client.get_processor_version request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::DeleteProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::UndeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::CreateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor, ::Hash] - # Required. The processor to be created, requires - # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and - # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} - # to be set. Also, the - # {::Google::Cloud::DocumentAI::V1::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::V1::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::Processor] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new - # - # # Call the create_processor method. - # result = client.create_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DeleteProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EnableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DisableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Processor Processor} that will be used in - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#process_document ProcessDocument} - # and - # {::Google::Cloud::DocumentAI::V1::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::V1::SetDefaultProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::Processor Processor} to change default - # version. - # @param default_processor_version [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ReviewDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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, 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::V1::Document, ::Hash] - # An inline document proto. - # @param human_review_config [::String] - # Required. The resource name of the - # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - # document will be reviewed with. - # @param enable_schema_validation [::Boolean] - # Whether the validation should be performed on the ad-hoc review request. - # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @param document_schema [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::EvaluateProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param evaluation_documents [::Google::Cloud::DocumentAI::V1::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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::GetEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::Evaluation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new - # - # # Call the get_evaluation method. - # result = client.get_evaluation request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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 - - ## - # 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::V1::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::V1::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::V1::DocumentProcessorService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!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] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - 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 - config_attr :universe_domain, 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 - - # @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 - - 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-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb deleted file mode 100644 index 5e1aae66b323..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb +++ /dev/null @@ -1,922 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - module DocumentProcessorService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - DEFAULT_ENDPOINT_TEMPLATE = "documentai.$UNIVERSE_DOMAIN$" - - # @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 - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - 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, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - 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::V1::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::V1::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::V1::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::V1::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 - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!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] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "documentai.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - 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 - config_attr :universe_domain, 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:, endpoint_template:, universe_domain:, 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, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - 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: "/v1/{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: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{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: "/v1/{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-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb deleted file mode 100644 index 9f7079d6367e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb +++ /dev/null @@ -1,1394 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service_pb" - -module Google - module Cloud - module DocumentAI - module V1 - 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:, endpoint_template:, universe_domain:, 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, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the process_document REST call - # - # @param request_pb [::Google::Cloud::DocumentAI::V1::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::V1::ProcessResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::FetchProcessorTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ProcessorType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::ProcessorVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListProcessorVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::Evaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ListEvaluationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DocumentAI::V1::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::V1::ListEvaluationsResponse.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::V1::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: "/v1/{name}:process", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{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::V1::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: "/v1/{name}:batchProcess", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{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::V1::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: "/v1/{parent}/evaluations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb deleted file mode 100644 index be990e2676cc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service/rest" -require "google/cloud/document_ai/v1/bindings_override" -require "google/cloud/document_ai/v1/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/v1/rest" - # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb deleted file mode 100644 index 5031cd28577a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/barcode_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/barcode_pb.rb deleted file mode 100644 index bc3418a3edbc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/barcode.proto - -require 'google/protobuf' - - -descriptor_data = "\n(google/cloud/documentai/v1/barcode.proto\x12\x1agoogle.cloud.documentai.v1\"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\xca\x01\n\x1e\x63om.google.cloud.documentai.v1B\x0c\x42\x61rcodeProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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 V1 - Barcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Barcode").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb deleted file mode 100644 index 9b0e59cc1db4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/document_io.proto - -require 'google/protobuf' - -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n,google/cloud/documentai/v1/document_io.proto\x12\x1agoogle.cloud.documentai.v1\x1a google/protobuf/field_mask.proto\"G\n\x0bRawDocument\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\"1\n\x0bGcsDocument\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"J\n\x0cGcsDocuments\x12:\n\tdocuments\x18\x01 \x03(\x0b\x32\'.google.cloud.documentai.v1.GcsDocument\"#\n\tGcsPrefix\x12\x16\n\x0egcs_uri_prefix\x18\x01 \x01(\t\"\xa5\x01\n\x19\x42\x61tchDocumentsInputConfig\x12;\n\ngcs_prefix\x18\x01 \x01(\x0b\x32%.google.cloud.documentai.v1.GcsPrefixH\x00\x12\x41\n\rgcs_documents\x18\x02 \x01(\x0b\x32(.google.cloud.documentai.v1.GcsDocumentsH\x00\x42\x08\n\x06source\"\x85\x03\n\x14\x44ocumentOutputConfig\x12]\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32@.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfigH\x00\x1a\xfe\x01\n\x0fGcsOutputConfig\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12h\n\x0fsharding_config\x18\x03 \x01(\x0b\x32O.google.cloud.documentai.v1.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\"\xf2\x03\n\tOcrConfig\x12:\n\x05hints\x18\x02 \x01(\x0b\x32+.google.cloud.documentai.v1.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\x12O\n\x10premium_features\x18\x0b \x01(\x0b\x32\x35.google.cloud.documentai.v1.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\xcd\x01\n\x1e\x63om.google.cloud.documentai.v1B\x0f\x44ocumentIoProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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 V1 - RawDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.RawDocument").msgclass - GcsDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GcsDocument").msgclass - GcsDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GcsDocuments").msgclass - GcsPrefix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GcsPrefix").msgclass - BatchDocumentsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchDocumentsInputConfig").msgclass - DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentOutputConfig").msgclass - DocumentOutputConfig::GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig").msgclass - DocumentOutputConfig::GcsOutputConfig::ShardingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig").msgclass - OcrConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.OcrConfig").msgclass - OcrConfig::Hints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.OcrConfig.Hints").msgclass - OcrConfig::PremiumFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.OcrConfig.PremiumFeatures").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb deleted file mode 100644 index 77fe923adde2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1/document.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/documentai/v1/barcode_pb' -require 'google/cloud/documentai/v1/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/v1/document.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/documentai/v1/barcode.proto\x1a)google/cloud/documentai/v1/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\"\x87\x45\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\x12\x43\n\x0btext_styles\x18\x05 \x03(\x0b\x32*.google.cloud.documentai.v1.Document.StyleB\x02\x18\x01\x12\x38\n\x05pages\x18\x06 \x03(\x0b\x32).google.cloud.documentai.v1.Document.Page\x12=\n\x08\x65ntities\x18\x07 \x03(\x0b\x32+.google.cloud.documentai.v1.Document.Entity\x12M\n\x10\x65ntity_relations\x18\x08 \x03(\x0b\x32\x33.google.cloud.documentai.v1.Document.EntityRelation\x12\x45\n\x0ctext_changes\x18\x0e \x03(\x0b\x32/.google.cloud.documentai.v1.Document.TextChange\x12\x42\n\nshard_info\x18\t \x01(\x0b\x32..google.cloud.documentai.v1.Document.ShardInfo\x12!\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.Status\x12@\n\trevisions\x18\r \x03(\x0b\x32-.google.cloud.documentai.v1.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\xe5\x02\n\x05Style\x12\x44\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.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\x12\x46\n\tfont_size\x18\x07 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\xc2)\n\x04Page\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12>\n\x05image\x18\r \x01(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Image\x12\x44\n\ntransforms\x18\x0e \x03(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Matrix\x12\x46\n\tdimension\x18\x02 \x01(\x0b\x32\x33.google.cloud.documentai.v1.Document.Page.Dimension\x12@\n\x06layout\x18\x03 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12?\n\x06\x62locks\x18\x05 \x03(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Block\x12G\n\nparagraphs\x18\x06 \x03(\x0b\x32\x33.google.cloud.documentai.v1.Document.Page.Paragraph\x12=\n\x05lines\x18\x07 \x03(\x0b\x32..google.cloud.documentai.v1.Document.Page.Line\x12?\n\x06tokens\x18\x08 \x03(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Token\x12P\n\x0fvisual_elements\x18\t \x03(\x0b\x32\x37.google.cloud.documentai.v1.Document.Page.VisualElement\x12?\n\x06tables\x18\n \x03(\x0b\x32/.google.cloud.documentai.v1.Document.Page.Table\x12H\n\x0b\x66orm_fields\x18\x0b \x03(\x0b\x32\x33.google.cloud.documentai.v1.Document.Page.FormField\x12\x41\n\x07symbols\x18\x0c \x03(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Symbol\x12T\n\x11\x64\x65tected_barcodes\x18\x0f \x03(\x0b\x32\x39.google.cloud.documentai.v1.Document.Page.DetectedBarcode\x12Z\n\x14image_quality_scores\x18\x11 \x01(\x0b\x32<.google.cloud.documentai.v1.Document.Page.ImageQualityScores\x12G\n\nprovenance\x18\x10 \x01(\x0b\x32/.google.cloud.documentai.v1.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\xdd\x02\n\x06Layout\x12\x44\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.TextAnchor\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12?\n\rbounding_poly\x18\x03 \x01(\x0b\x32(.google.cloud.documentai.v1.BoundingPoly\x12Q\n\x0borientation\x18\x04 \x01(\x0e\x32<.google.cloud.documentai.v1.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\xea\x01\n\x05\x42lock\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1a\xee\x01\n\tParagraph\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1a\xe9\x01\n\x04Line\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x03 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1a\x9e\x07\n\x05Token\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12U\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32=.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak\x12V\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x04 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x12M\n\nstyle_info\x18\x05 \x01(\x0b\x32\x39.google.cloud.documentai.v1.Document.Page.Token.StyleInfo\x1a\xa6\x01\n\rDetectedBreak\x12P\n\x04type\x18\x01 \x01(\x0e\x32\x42.google.cloud.documentai.v1.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\xa2\x01\n\x06Symbol\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12V\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x1a\xb7\x01\n\rVisualElement\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x0c\n\x04type\x18\x02 \x01(\t\x12V\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x1a\xa8\x05\n\x05Table\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12M\n\x0bheader_rows\x18\x02 \x03(\x0b\x32\x38.google.cloud.documentai.v1.Document.Page.Table.TableRow\x12K\n\tbody_rows\x18\x03 \x03(\x0b\x32\x38.google.cloud.documentai.v1.Document.Page.Table.TableRow\x12V\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12G\n\nprovenance\x18\x05 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x1aT\n\x08TableRow\x12H\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32\x39.google.cloud.documentai.v1.Document.Page.Table.TableCell\x1a\xc9\x01\n\tTableCell\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x10\n\x08row_span\x18\x02 \x01(\x05\x12\x10\n\x08\x63ol_span\x18\x03 \x01(\x05\x12V\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x1a\xe6\x03\n\tFormField\x12\x44\n\nfield_name\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x45\n\x0b\x66ield_value\x18\x02 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12[\n\x17name_detected_languages\x18\x03 \x03(\x0b\x32:.google.cloud.documentai.v1.Document.Page.DetectedLanguage\x12\\\n\x18value_detected_languages\x18\x04 \x03(\x0b\x32:.google.cloud.documentai.v1.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\x12\x43\n\nprovenance\x18\x08 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.Provenance\x1a\x89\x01\n\x0f\x44\x65tectedBarcode\x12@\n\x06layout\x18\x01 \x01(\x0b\x32\x30.google.cloud.documentai.v1.Document.Page.Layout\x12\x34\n\x07\x62\x61rcode\x18\x02 \x01(\x0b\x32#.google.cloud.documentai.v1.Barcode\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xc6\x01\n\x12ImageQualityScores\x12\x15\n\rquality_score\x18\x01 \x01(\x02\x12\x65\n\x10\x64\x65tected_defects\x18\x02 \x03(\x0b\x32K.google.cloud.documentai.v1.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\xd0\x06\n\x06\x45ntity\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.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\x12I\n\x0bpage_anchor\x18\x06 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.PageAnchorB\x03\xe0\x41\x01\x12\x0f\n\x02id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12Z\n\x10normalized_value\x18\t \x01(\x0b\x32;.google.cloud.documentai.v1.Document.Entity.NormalizedValueB\x03\xe0\x41\x01\x12\x44\n\nproperties\x18\n \x03(\x0b\x32+.google.cloud.documentai.v1.Document.EntityB\x03\xe0\x41\x01\x12H\n\nprovenance\x18\x0b \x01(\x0b\x32/.google.cloud.documentai.v1.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\xa8\x01\n\nTextAnchor\x12R\n\rtext_segments\x18\x01 \x03(\x0b\x32;.google.cloud.documentai.v1.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\xd8\x03\n\nPageAnchor\x12J\n\tpage_refs\x18\x01 \x03(\x0b\x32\x37.google.cloud.documentai.v1.Document.PageAnchor.PageRef\x1a\xfd\x02\n\x07PageRef\x12\x11\n\x04page\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\\\n\x0blayout_type\x18\x02 \x01(\x0e\x32\x42.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutTypeB\x03\xe0\x41\x01\x12\x18\n\tlayout_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x44\n\rbounding_poly\x18\x04 \x01(\x0b\x32(.google.cloud.documentai.v1.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\xa8\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\x12G\n\x07parents\x18\x03 \x03(\x0b\x32\x36.google.cloud.documentai.v1.Document.Provenance.Parent\x12K\n\x04type\x18\x04 \x01(\x0e\x32=.google.cloud.documentai.v1.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\xa5\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\x12O\n\x0chuman_review\x18\x06 \x01(\x0b\x32\x39.google.cloud.documentai.v1.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\xb1\x01\n\nTextChange\x12\x44\n\x0btext_anchor\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1.Document.TextAnchor\x12\x14\n\x0c\x63hanged_text\x18\x02 \x01(\t\x12G\n\nprovenance\x18\x03 \x03(\x0b\x32/.google.cloud.documentai.v1.Document.ProvenanceB\x02\x18\x01\x42\x08\n\x06sourceB\xcb\x01\n\x1e\x63om.google.cloud.documentai.v1B\rDocumentProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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.v1.BoundingPoly", "google/cloud/documentai/v1/geometry.proto"], - ["google.cloud.documentai.v1.Barcode", "google/cloud/documentai/v1/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 V1 - Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document").msgclass - Document::ShardInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.ShardInfo").msgclass - Document::Style = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Style").msgclass - Document::Style::FontSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Style.FontSize").msgclass - Document::Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page").msgclass - Document::Page::Dimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Dimension").msgclass - Document::Page::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Image").msgclass - Document::Page::Matrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Matrix").msgclass - Document::Page::Layout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Layout").msgclass - Document::Page::Layout::Orientation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Layout.Orientation").enummodule - Document::Page::Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Block").msgclass - Document::Page::Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Paragraph").msgclass - Document::Page::Line = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Line").msgclass - Document::Page::Token = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token").msgclass - Document::Page::Token::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token.DetectedBreak").msgclass - Document::Page::Token::DetectedBreak::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type").enummodule - Document::Page::Token::StyleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Token.StyleInfo").msgclass - Document::Page::Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Symbol").msgclass - Document::Page::VisualElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.VisualElement").msgclass - Document::Page::Table = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Table").msgclass - Document::Page::Table::TableRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Table.TableRow").msgclass - Document::Page::Table::TableCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.Table.TableCell").msgclass - Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.FormField").msgclass - Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.DetectedBarcode").msgclass - Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.DetectedLanguage").msgclass - Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.ImageQualityScores").msgclass - Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect").msgclass - Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Entity").msgclass - Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Entity.NormalizedValue").msgclass - Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.EntityRelation").msgclass - Document::TextAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.TextAnchor").msgclass - Document::TextAnchor::TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.TextAnchor.TextSegment").msgclass - Document::PageAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.PageAnchor").msgclass - Document::PageAnchor::PageRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.PageAnchor.PageRef").msgclass - Document::PageAnchor::PageRef::LayoutType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType").enummodule - Document::Provenance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Provenance").msgclass - Document::Provenance::Parent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Provenance.Parent").msgclass - Document::Provenance::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Provenance.OperationType").enummodule - Document::Revision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Revision").msgclass - Document::Revision::HumanReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Revision.HumanReview").msgclass - Document::TextChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.TextChange").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb deleted file mode 100644 index 28b360e79048..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_pb.rb +++ /dev/null @@ -1,129 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1/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/v1/document_pb' -require 'google/cloud/documentai/v1/document_io_pb' -require 'google/cloud/documentai/v1/document_schema_pb' -require 'google/cloud/documentai/v1/evaluation_pb' -require 'google/cloud/documentai/v1/operation_metadata_pb' -require 'google/cloud/documentai/v1/processor_pb' -require 'google/cloud/documentai/v1/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/v1/document_processor_service.proto\x12\x1agoogle.cloud.documentai.v1\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/v1/document.proto\x1a,google/cloud/documentai/v1/document_io.proto\x1a\x30google/cloud/documentai/v1/document_schema.proto\x1a+google/cloud/documentai/v1/evaluation.proto\x1a\x33google/cloud/documentai/v1/operation_metadata.proto\x1a*google/cloud/documentai/v1/processor.proto\x1a/google/cloud/documentai/v1/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\"\xe2\x02\n\x0eProcessOptions\x12\x65\n\x18individual_page_selector\x18\x05 \x01(\x0b\x32\x41.google.cloud.documentai.v1.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\x39\n\nocr_config\x18\x01 \x01(\x0b\x32%.google.cloud.documentai.v1.OcrConfig\x12H\n\x0fschema_override\x18\x08 \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchemaB\x03\xe0\x41\x01\x1a,\n\x16IndividualPageSelector\x12\x12\n\x05pages\x18\x01 \x03(\x05\x42\x03\xe0\x41\x01\x42\x0c\n\npage_range\"\x82\x04\n\x0eProcessRequest\x12?\n\x0finline_document\x18\x04 \x01(\x0b\x32$.google.cloud.documentai.v1.DocumentH\x00\x12?\n\x0craw_document\x18\x05 \x01(\x0b\x32\'.google.cloud.documentai.v1.RawDocumentH\x00\x12?\n\x0cgcs_document\x18\x08 \x01(\x0b\x32\'.google.cloud.documentai.v1.GcsDocumentH\x00\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08\x12.\n\nfield_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x0fprocess_options\x18\x07 \x01(\x0b\x32*.google.cloud.documentai.v1.ProcessOptions\x12K\n\x06labels\x18\n \x03(\x0b\x32\x36.google.cloud.documentai.v1.ProcessRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06source\"\xee\x01\n\x11HumanReviewStatus\x12\x42\n\x05state\x18\x01 \x01(\x0e\x32\x33.google.cloud.documentai.v1.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\"\x95\x01\n\x0fProcessResponse\x12\x36\n\x08\x64ocument\x18\x01 \x01(\x0b\x32$.google.cloud.documentai.v1.Document\x12J\n\x13human_review_status\x18\x03 \x01(\x0b\x32-.google.cloud.documentai.v1.HumanReviewStatus\"\xb1\x03\n\x13\x42\x61tchProcessRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12N\n\x0finput_documents\x18\x05 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfig\x12P\n\x16\x64ocument_output_config\x18\x06 \x01(\x0b\x32\x30.google.cloud.documentai.v1.DocumentOutputConfig\x12\x19\n\x11skip_human_review\x18\x04 \x01(\x08\x12\x43\n\x0fprocess_options\x18\x07 \x01(\x0b\x32*.google.cloud.documentai.v1.ProcessOptions\x12P\n\x06labels\x18\t \x03(\x0b\x32;.google.cloud.documentai.v1.BatchProcessRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x16\n\x14\x42\x61tchProcessResponse\"\xff\x04\n\x14\x42\x61tchProcessMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.documentai.v1.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\x12m\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32H.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus\x1a\xc3\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\x12J\n\x13human_review_status\x18\x05 \x01(\x0b\x32-.google.cloud.documentai.v1.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\"a\n\x1b\x46\x65tchProcessorTypesResponse\x12\x42\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32).google.cloud.documentai.v1.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\"y\n\x1aListProcessorTypesResponse\x12\x42\n\x0fprocessor_types\x18\x01 \x03(\x0b\x32).google.cloud.documentai.v1.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\"l\n\x16ListProcessorsResponse\x12\x39\n\nprocessors\x18\x01 \x03(\x0b\x32%.google.cloud.documentai.v1.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\"\x82\x01\n\x1dListProcessorVersionsResponse\x12H\n\x12processor_versions\x18\x01 \x03(\x0b\x32,.google.cloud.documentai.v1.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\"n\n\x1e\x44\x65leteProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"n\n\x1e\x44\x65ployProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\"c\n\x1fUndeployProcessorVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\"\n UndeployProcessorVersionResponse\"p\n UndeployProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\"\x94\x01\n\x16\x43reateProcessorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#documentai.googleapis.com/Processor\x12=\n\tprocessor\x18\x02 \x01(\x0b\x32%.google.cloud.documentai.v1.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\"g\n\x17\x44\x65leteProcessorMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"g\n\x17\x45nableProcessorMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"h\n\x18\x44isableProcessorMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"r\n\"SetDefaultProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\"\xa4\t\n\x1cTrainProcessorVersionRequest\x12\x86\x01\n\"custom_document_extraction_options\x18\x05 \x01(\x0b\x32X.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptionsH\x00\x12\x80\x01\n\x1f\x66oundation_model_tuning_options\x18\x0c \x01(\x0b\x32U.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptionsH\x00\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12L\n\x11processor_version\x18\x02 \x01(\x0b\x32,.google.cloud.documentai.v1.ProcessorVersionB\x03\xe0\x41\x02\x12H\n\x0f\x64ocument_schema\x18\n \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchemaB\x03\xe0\x41\x01\x12[\n\ninput_data\x18\x04 \x01(\x0b\x32\x42.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataB\x03\xe0\x41\x01\x12#\n\x16\x62\x61se_processor_version\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1a\xad\x01\n\tInputData\x12Q\n\x12training_documents\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfig\x12M\n\x0etest_documents\x18\x04 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfig\x1a\xfc\x01\n\x1f\x43ustomDocumentExtractionOptions\x12\x80\x01\n\x0ftraining_method\x18\x03 \x01(\x0e\x32g.google.cloud.documentai.v1.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\x1a_\n\x1c\x46oundationModelTuningOptions\x12\x18\n\x0btrain_steps\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x18learning_rate_multiplier\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01\x42\x11\n\x0fprocessor_flags\":\n\x1dTrainProcessorVersionResponse\x12\x19\n\x11processor_version\x18\x01 \x01(\t\"\xf7\x03\n\x1dTrainProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\x12p\n\x1btraining_dataset_validation\x18\x02 \x01(\x0b\x32K.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation\x12l\n\x17test_dataset_validation\x18\x03 \x01(\x0b\x32K.google.cloud.documentai.v1.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\"\x8e\x03\n\x15ReviewDocumentRequest\x12?\n\x0finline_document\x18\x04 \x01(\x0b\x32$.google.cloud.documentai.v1.DocumentH\x00\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12 \n\x18\x65nable_schema_validation\x18\x03 \x01(\x08\x12L\n\x08priority\x18\x05 \x01(\x0e\x32:.google.cloud.documentai.v1.ReviewDocumentRequest.Priority\x12\x43\n\x0f\x64ocument_schema\x18\x06 \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchema\"#\n\x08Priority\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\n\n\x06URGENT\x10\x01\x42\x08\n\x06source\"\xd1\x01\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t\x12G\n\x05state\x18\x02 \x01(\x0e\x32\x38.google.cloud.documentai.v1.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\"\x84\x01\n\x1fReviewDocumentOperationMetadata\x12L\n\x0f\x63ommon_metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.documentai.v1.CommonOperationMetadata\x12\x13\n\x0bquestion_id\x18\x06 \x01(\t\"\xca\x01\n\x1f\x45valuateProcessorVersionRequest\x12M\n\x11processor_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\x12X\n\x14\x65valuation_documents\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1.BatchDocumentsInputConfigB\x03\xe0\x41\x01\"p\n EvaluateProcessorVersionMetadata\x12L\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32\x33.google.cloud.documentai.v1.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\"o\n\x17ListEvaluationsResponse\x12;\n\x0b\x65valuations\x18\x01 \x03(\x0b\x32&.google.cloud.documentai.v1.Evaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x9c*\n\x18\x44ocumentProcessorService\x12\x87\x02\n\x0fProcessDocument\x12*.google.cloud.documentai.v1.ProcessRequest\x1a+.google.cloud.documentai.v1.ProcessResponse\"\x9a\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8c\x01\"6/v1/{name=projects/*/locations/*/processors/*}:process:\x01*ZO\"J/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process:\x01*\x12\xbd\x02\n\x15\x42\x61tchProcessDocuments\x12/.google.cloud.documentai.v1.BatchProcessRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x96\x01\";/v1/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*ZT\"O/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess:\x01*\x12\xd0\x01\n\x13\x46\x65tchProcessorTypes\x12\x36.google.cloud.documentai.v1.FetchProcessorTypesRequest\x1a\x37.google.cloud.documentai.v1.FetchProcessorTypesResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*}:fetchProcessorTypes\x12\xc8\x01\n\x12ListProcessorTypes\x12\x35.google.cloud.documentai.v1.ListProcessorTypesRequest\x1a\x36.google.cloud.documentai.v1.ListProcessorTypesResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/processorTypes\x12\xb5\x01\n\x10GetProcessorType\x12\x33.google.cloud.documentai.v1.GetProcessorTypeRequest\x1a).google.cloud.documentai.v1.ProcessorType\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/processorTypes/*}\x12\xb8\x01\n\x0eListProcessors\x12\x31.google.cloud.documentai.v1.ListProcessorsRequest\x1a\x32.google.cloud.documentai.v1.ListProcessorsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/processors\x12\xa5\x01\n\x0cGetProcessor\x12/.google.cloud.documentai.v1.GetProcessorRequest\x1a%.google.cloud.documentai.v1.Processor\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/processors/*}\x12\xa2\x02\n\x15TrainProcessorVersion\x12\x38.google.cloud.documentai.v1.TrainProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xaf\x01\xca\x41>\n\x1dTrainProcessorVersionResponse\x12\x1dTrainProcessorVersionMetadata\xda\x41\x18parent,processor_version\x82\xd3\xe4\x93\x02M\"H/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train:\x01*\x12\xce\x01\n\x13GetProcessorVersion\x12\x36.google.cloud.documentai.v1.GetProcessorVersionRequest\x1a,.google.cloud.documentai.v1.ProcessorVersion\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}\x12\xe1\x01\n\x15ListProcessorVersions\x12\x38.google.cloud.documentai.v1.ListProcessorVersionsRequest\x1a\x39.google.cloud.documentai.v1.ListProcessorVersionsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{parent=projects/*/locations/*/processors/*}/processorVersions\x12\x80\x02\n\x16\x44\x65leteProcessorVersion\x12\x39.google.cloud.documentai.v1.DeleteProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteProcessorVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44*B/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}\x12\x93\x02\n\x16\x44\x65ployProcessorVersion\x12\x39.google.cloud.documentai.v1.DeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41@\n\x1e\x44\x65ployProcessorVersionResponse\x12\x1e\x44\x65ployProcessorVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02N\"I/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy:\x01*\x12\x9d\x02\n\x18UndeployProcessorVersion\x12;.google.cloud.documentai.v1.UndeployProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa4\x01\xca\x41\x44\n UndeployProcessorVersionResponse\x12 UndeployProcessorVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02P\"K/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy:\x01*\x12\xc2\x01\n\x0f\x43reateProcessor\x12\x32.google.cloud.documentai.v1.CreateProcessorRequest\x1a%.google.cloud.documentai.v1.Processor\"T\xda\x41\x10parent,processor\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/processors:\tprocessor\x12\xd6\x01\n\x0f\x44\x65leteProcessor\x12\x32.google.cloud.documentai.v1.DeleteProcessorRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteProcessorMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/processors/*}\x12\xdb\x01\n\x0f\x45nableProcessor\x12\x32.google.cloud.documentai.v1.EnableProcessorRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41\x32\n\x17\x45nableProcessorResponse\x12\x17\x45nableProcessorMetadata\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/processors/*}:enable:\x01*\x12\xe0\x01\n\x10\x44isableProcessor\x12\x33.google.cloud.documentai.v1.DisableProcessorRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x34\n\x18\x44isableProcessorResponse\x12\x18\x44isableProcessorMetadata\x82\xd3\xe4\x93\x02;\"6/v1/{name=projects/*/locations/*/processors/*}:disable:\x01*\x12\xa1\x02\n\x1aSetDefaultProcessorVersion\x12=.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xa4\x01\xca\x41H\n\"SetDefaultProcessorVersionResponse\x12\"SetDefaultProcessorVersionMetadata\x82\xd3\xe4\x93\x02S\"N/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion:\x01*\x12\xa0\x02\n\x0eReviewDocument\x12\x31.google.cloud.documentai.v1.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xbb\x01\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\xda\x41\x13human_review_config\x82\xd3\xe4\x93\x02\x63\"^/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\x12\xc7\x02\n\x18\x45valuateProcessorVersion\x12;.google.cloud.documentai.v1.EvaluateProcessorVersionRequest\x1a\x1d.google.longrunning.Operation\"\xce\x01\xca\x41\x44\n EvaluateProcessorVersionResponse\x12 EvaluateProcessorVersionMetadata\xda\x41\x11processor_version\x82\xd3\xe4\x93\x02m\"h/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion:\x01*\x12\xca\x01\n\rGetEvaluation\x12\x30.google.cloud.documentai.v1.GetEvaluationRequest\x1a&.google.cloud.documentai.v1.Evaluation\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\x12P/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}\x12\xdd\x01\n\x0fListEvaluations\x12\x32.google.cloud.documentai.v1.ListEvaluationsRequest\x1a\x33.google.cloud.documentai.v1.ListEvaluationsResponse\"a\xda\x41\x06parent\x82\xd3\xe4\x93\x02R\x12P/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xaa\x03\n\x1e\x63om.google.cloud.documentai.v1B\x1a\x44ocumentAiProcessorServiceP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1\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 - # 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.v1.OcrConfig", "google/cloud/documentai/v1/document_io.proto"], - ["google.cloud.documentai.v1.DocumentSchema", "google/cloud/documentai/v1/document_schema.proto"], - ["google.cloud.documentai.v1.Document", "google/cloud/documentai/v1/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.v1.ProcessorType", "google/cloud/documentai/v1/processor_type.proto"], - ["google.cloud.documentai.v1.Processor", "google/cloud/documentai/v1/processor.proto"], - ["google.cloud.documentai.v1.CommonOperationMetadata", "google/cloud/documentai/v1/operation_metadata.proto"], - ["google.cloud.documentai.v1.Evaluation", "google/cloud/documentai/v1/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 V1 - ProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessOptions").msgclass - ProcessOptions::IndividualPageSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector").msgclass - ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessRequest").msgclass - HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.HumanReviewStatus").msgclass - HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.HumanReviewStatus.State").enummodule - ProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessResponse").msgclass - BatchProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessRequest").msgclass - BatchProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessResponse").msgclass - BatchProcessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessMetadata").msgclass - BatchProcessMetadata::IndividualProcessStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus").msgclass - BatchProcessMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BatchProcessMetadata.State").enummodule - FetchProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.FetchProcessorTypesRequest").msgclass - FetchProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.FetchProcessorTypesResponse").msgclass - ListProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorTypesRequest").msgclass - ListProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorTypesResponse").msgclass - ListProcessorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorsRequest").msgclass - ListProcessorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorsResponse").msgclass - GetProcessorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorTypeRequest").msgclass - GetProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorRequest").msgclass - GetProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorVersionRequest").msgclass - ListProcessorVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorVersionsRequest").msgclass - ListProcessorVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorVersionsResponse").msgclass - DeleteProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorVersionRequest").msgclass - DeleteProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorVersionMetadata").msgclass - DeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeployProcessorVersionRequest").msgclass - DeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeployProcessorVersionResponse").msgclass - DeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeployProcessorVersionMetadata").msgclass - UndeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.UndeployProcessorVersionRequest").msgclass - UndeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.UndeployProcessorVersionResponse").msgclass - UndeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.UndeployProcessorVersionMetadata").msgclass - CreateProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.CreateProcessorRequest").msgclass - DeleteProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorRequest").msgclass - DeleteProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DeleteProcessorMetadata").msgclass - EnableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EnableProcessorRequest").msgclass - EnableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EnableProcessorResponse").msgclass - EnableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EnableProcessorMetadata").msgclass - DisableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DisableProcessorRequest").msgclass - DisableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DisableProcessorResponse").msgclass - DisableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DisableProcessorMetadata").msgclass - SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionRequest").msgclass - SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionResponse").msgclass - SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata").msgclass - TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest").msgclass - TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData").msgclass - TrainProcessorVersionRequest::CustomDocumentExtractionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions").msgclass - TrainProcessorVersionRequest::CustomDocumentExtractionOptions::TrainingMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod").enummodule - TrainProcessorVersionRequest::FoundationModelTuningOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions").msgclass - TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionResponse").msgclass - TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionMetadata").msgclass - TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation").msgclass - ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest").msgclass - ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest.Priority").enummodule - ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse").msgclass - ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse.State").enummodule - ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentOperationMetadata").msgclass - EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionRequest").msgclass - EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionMetadata").msgclass - EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionResponse").msgclass - GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetEvaluationRequest").msgclass - ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListEvaluationsRequest").msgclass - ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListEvaluationsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb deleted file mode 100644 index 2f38e9a847e7..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb +++ /dev/null @@ -1,105 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/documentai/v1/document_processor_service.proto for package 'Google.Cloud.DocumentAI.V1' -# Original file comments: -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.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/v1/document_processor_service_pb' - -module Google - module Cloud - module DocumentAI - module V1 - 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.v1.DocumentProcessorService' - - # Processes a single document. - rpc :ProcessDocument, ::Google::Cloud::DocumentAI::V1::ProcessRequest, ::Google::Cloud::DocumentAI::V1::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::V1::BatchProcessRequest, ::Google::Longrunning::Operation - # Fetches processor types. Note that we don't use - # [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] - # here, because it isn't paginated. - rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse - # Lists the processor types that exist. - rpc :ListProcessorTypes, ::Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorTypesResponse - # Gets a processor type detail. - rpc :GetProcessorType, ::Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest, ::Google::Cloud::DocumentAI::V1::ProcessorType - # Lists all processors which belong to this project. - rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorsResponse - # Gets a processor detail. - rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1::Processor - # Trains a new processor version. - # Operation metadata is returned as - # [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. - rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest, ::Google::Longrunning::Operation - # Gets a processor version detail. - rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1::ProcessorVersion - # Lists all versions of a processor. - rpc :ListProcessorVersions, ::Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorVersionsResponse - # Deletes the processor version, all artifacts under the processor version - # will be deleted. - rpc :DeleteProcessorVersion, ::Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest, ::Google::Longrunning::Operation - # Deploys the processor version. - rpc :DeployProcessorVersion, ::Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest, ::Google::Longrunning::Operation - # Undeploys the processor version. - rpc :UndeployProcessorVersion, ::Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest, ::Google::Longrunning::Operation - # Creates a processor from the - # [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The - # processor will be at `ENABLED` state by default after its creation. - rpc :CreateProcessor, ::Google::Cloud::DocumentAI::V1::CreateProcessorRequest, ::Google::Cloud::DocumentAI::V1::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::V1::DeleteProcessorRequest, ::Google::Longrunning::Operation - # Enables a processor - rpc :EnableProcessor, ::Google::Cloud::DocumentAI::V1::EnableProcessorRequest, ::Google::Longrunning::Operation - # Disables a processor - rpc :DisableProcessor, ::Google::Cloud::DocumentAI::V1::DisableProcessorRequest, ::Google::Longrunning::Operation - # Set the default (active) version of a - # [Processor][google.cloud.documentai.v1.Processor] that will be used in - # [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] - # and - # [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. - rpc :SetDefaultProcessorVersion, ::Google::Cloud::DocumentAI::V1::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::V1::ReviewDocumentRequest, ::Google::Longrunning::Operation - # Evaluates a ProcessorVersion against annotated documents, producing an - # Evaluation. - rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation - # Retrieves a specific evaluation. - rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1::Evaluation - # Retrieves a set of evaluations for a given processor version. - rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1::ListEvaluationsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb deleted file mode 100644 index 3a5ac4ed0443..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_schema_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1/document_schema.proto - -require 'google/protobuf' - - -descriptor_data = "\n0google/cloud/documentai/v1/document_schema.proto\x12\x1agoogle.cloud.documentai.v1\"\xbd\x07\n\x0e\x44ocumentSchema\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12K\n\x0c\x65ntity_types\x18\x03 \x03(\x0b\x32\x35.google.cloud.documentai.v1.DocumentSchema.EntityType\x12\x45\n\x08metadata\x18\x04 \x01(\x0b\x32\x33.google.cloud.documentai.v1.DocumentSchema.Metadata\x1a\xd4\x04\n\nEntityType\x12W\n\x0b\x65num_values\x18\x0e \x01(\x0b\x32@.google.cloud.documentai.v1.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\x12R\n\nproperties\x18\x06 \x03(\x0b\x32>.google.cloud.documentai.v1.DocumentSchema.EntityType.Property\x1a\x1c\n\nEnumValues\x12\x0e\n\x06values\x18\x01 \x03(\t\x1a\xb2\x02\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12\x12\n\nvalue_type\x18\x02 \x01(\t\x12\x66\n\x0foccurrence_type\x18\x03 \x01(\x0e\x32M.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType\"\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\xd6\x01\n\x1e\x63om.google.cloud.documentai.v1B\x18\x44ocumentAiDocumentSchemaP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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 V1 - DocumentSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema").msgclass - DocumentSchema::EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType").msgclass - DocumentSchema::EntityType::EnumValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues").msgclass - DocumentSchema::EntityType::Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType.Property").msgclass - DocumentSchema::EntityType::Property::OccurrenceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType").enummodule - DocumentSchema::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.DocumentSchema.Metadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/evaluation_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/evaluation_pb.rb deleted file mode 100644 index 55093729c028..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/evaluation.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n+google/cloud/documentai/v1/evaluation.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\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\x12I\n\x11\x61ggregate_metrics\x18\x04 \x01(\x0b\x32..google.cloud.documentai.v1.Evaluation.Metrics\x12O\n\x17\x61ggregate_metrics_exact\x18\x05 \x01(\x0b\x32..google.cloud.documentai.v1.Evaluation.Metrics\"\xe5\r\n\nEvaluation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12J\n\x11\x64ocument_counters\x18\x05 \x01(\x0b\x32/.google.cloud.documentai.v1.Evaluation.Counters\x12[\n\x14\x61ll_entities_metrics\x18\x03 \x01(\x0b\x32=.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics\x12Q\n\x0e\x65ntity_metrics\x18\x04 \x03(\x0b\x32\x39.google.cloud.documentai.v1.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\x1as\n\x16\x43onfidenceLevelMetrics\x12\x18\n\x10\x63onfidence_level\x18\x01 \x01(\x02\x12?\n\x07metrics\x18\x02 \x01(\x0b\x32..google.cloud.documentai.v1.Evaluation.Metrics\x1a\xf1\x03\n\x16MultiConfidenceMetrics\x12_\n\x18\x63onfidence_level_metrics\x18\x01 \x03(\x0b\x32=.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics\x12\x65\n\x1e\x63onfidence_level_metrics_exact\x18\x04 \x03(\x0b\x32=.google.cloud.documentai.v1.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_\n\x0cmetrics_type\x18\x07 \x01(\x0e\x32I.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType\":\n\x0bMetricsType\x12\x1c\n\x18METRICS_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tAGGREGATE\x10\x01\x1as\n\x12\x45ntityMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.documentai.v1.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\xd2\x01\n\x1e\x63om.google.cloud.documentai.v1B\x14\x44ocumentAiEvaluationP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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 V1 - EvaluationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluationReference").msgclass - Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation").msgclass - Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.Counters").msgclass - Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.Metrics").msgclass - Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics").msgclass - Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics").msgclass - Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/geometry_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/geometry_pb.rb deleted file mode 100644 index d08b4e37ce9b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/geometry.proto - -require 'google/protobuf' - - -descriptor_data = "\n)google/cloud/documentai/v1/geometry.proto\x12\x1agoogle.cloud.documentai.v1\"\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\"\x8f\x01\n\x0c\x42oundingPoly\x12\x34\n\x08vertices\x18\x01 \x03(\x0b\x32\".google.cloud.documentai.v1.Vertex\x12I\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32,.google.cloud.documentai.v1.NormalizedVertexB\xcb\x01\n\x1e\x63om.google.cloud.documentai.v1B\rGeometryProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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 V1 - Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Vertex").msgclass - NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.NormalizedVertex").msgclass - BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.BoundingPoly").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/operation_metadata_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/operation_metadata_pb.rb deleted file mode 100644 index 1207821bbfdc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/operation_metadata.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n3google/cloud/documentai/v1/operation_metadata.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd5\x02\n\x17\x43ommonOperationMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.documentai.v1.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\xd4\x01\n\x1e\x63om.google.cloud.documentai.v1B\x16OperationMetadataProtoP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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 V1 - CommonOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.CommonOperationMetadata").msgclass - CommonOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.CommonOperationMetadata.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb deleted file mode 100644 index f7198cfee162..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1/processor.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/documentai/v1/document_schema_pb' -require 'google/cloud/documentai/v1/evaluation_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/cloud/documentai/v1/processor.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/documentai/v1/document_schema.proto\x1a+google/cloud/documentai/v1/evaluation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe1\x08\n\x10ProcessorVersion\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x43\n\x0f\x64ocument_schema\x18\x0c \x01(\x0b\x32*.google.cloud.documentai.v1.DocumentSchema\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32\x32.google.cloud.documentai.v1.ProcessorVersion.State\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12J\n\x11latest_evaluation\x18\x08 \x01(\x0b\x32/.google.cloud.documentai.v1.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\x12V\n\x10\x64\x65precation_info\x18\r \x01(\x0b\x32<.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo\x12O\n\nmodel_type\x18\x0f \x01(\x0e\x32\x36.google.cloud.documentai.v1.ProcessorVersion.ModelTypeB\x03\xe0\x41\x03\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\"Y\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15MODEL_TYPE_GENERATIVE\x10\x01\x12\x15\n\x11MODEL_TYPE_CUSTOM\x10\x02:\x96\x01\xea\x41\x92\x01\n*documentai.googleapis.com/ProcessorVersion\x12\x64projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}\"r\n\x15ProcessorVersionAlias\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12J\n\x11processor_version\x18\x02 \x01(\tB/\xfa\x41,\n*documentai.googleapis.com/ProcessorVersion\"\x88\x05\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?\n\x05state\x18\x04 \x01(\x0e\x32+.google.cloud.documentai.v1.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\x12Y\n\x19processor_version_aliases\x18\n \x03(\x0b\x32\x31.google.cloud.documentai.v1.ProcessorVersionAliasB\x03\xe0\x41\x03\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\xd1\x01\n\x1e\x63om.google.cloud.documentai.v1B\x13\x44ocumentAiProcessorP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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.v1.DocumentSchema", "google/cloud/documentai/v1/document_schema.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.documentai.v1.EvaluationReference", "google/cloud/documentai/v1/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 V1 - ProcessorVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion").msgclass - ProcessorVersion::DeprecationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo").msgclass - ProcessorVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion.State").enummodule - ProcessorVersion::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersion.ModelType").enummodule - ProcessorVersionAlias = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorVersionAlias").msgclass - Processor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Processor").msgclass - Processor::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Processor.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_type_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_type_pb.rb deleted file mode 100644 index e7dd565e8d9c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/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/v1/processor_type.proto - -require 'google/protobuf' - -require 'google/api/launch_stage_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n/google/cloud/documentai/v1/processor_type.proto\x12\x1agoogle.cloud.documentai.v1\x1a\x1dgoogle/api/launch_stage.proto\x1a\x19google/api/resource.proto\"\x93\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\x12S\n\x13\x61vailable_locations\x18\x04 \x03(\x0b\x32\x36.google.cloud.documentai.v1.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\xd5\x01\n\x1e\x63om.google.cloud.documentai.v1B\x17\x44ocumentAiProcessorTypeP\x01Z>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb\xaa\x02\x1aGoogle.Cloud.DocumentAI.V1\xca\x02\x1aGoogle\\Cloud\\DocumentAI\\V1\xea\x02\x1dGoogle::Cloud::DocumentAI::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # 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 V1 - ProcessorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorType").msgclass - ProcessorType::LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ProcessorType.LocationInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md deleted file mode 100644 index ffc8a8aaa855..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Document AI V1 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-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 934c39849a6a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,399 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 - # @deprecated This field is deprecated and may be removed in the next major version update. - # @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 - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - 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 - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - 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-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index b03587481349..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 38b4b61e6061..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/cloud/documentai/v1/barcode.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb deleted file mode 100644 index 32c2fb8237b8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # 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-v1/proto_docs/google/cloud/documentai/v1/document.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb deleted file mode 100644 index f27021edb071..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb +++ /dev/null @@ -1,1047 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # Document represents the canonical document resource in Document AI. It is an - # interchange format that provides insights into documents and allows for - # collaboration between users and Document AI to iterate and optimize for - # quality. - # @!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 - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Style>] - # Styles for the {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. - # @!attribute [rw] pages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page>] - # Visual page layout for the {::Google::Cloud::DocumentAI::V1::Document Document}. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Entity>] - # A list of entities detected on - # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. For document - # shards, entities in this list may cross shard boundaries. - # @!attribute [rw] entity_relations - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::EntityRelation>] - # Placeholder. Relationship among - # {::Google::Cloud::DocumentAI::V1::Document#entities Document.entities}. - # @!attribute [rw] text_changes - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::TextChange>] - # Placeholder. A list of text corrections made to - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::Document::TextAnchor] - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document Document}. - # @!attribute [rw] page_number - # @return [::Integer] - # 1-based index for current - # {::Google::Cloud::DocumentAI::V1::Document::Page Page} in a parent - # {::Google::Cloud::DocumentAI::V1::Document Document}. Useful when a page is - # taken out of a {::Google::Cloud::DocumentAI::V1::Document Document} for - # individual processing. - # @!attribute [rw] image - # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Matrix>] - # Transformation matrices that were applied to the original document image - # to produce {::Google::Cloud::DocumentAI::V1::Document::Page#image Page.image}. - # @!attribute [rw] dimension - # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Dimension] - # Physical dimension of the page. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the page. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] blocks - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Document::Page::Token>] - # A list of visually detected tokens on the page. - # @!attribute [rw] visual_elements - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Table>] - # A list of visually detected tables on the page. - # @!attribute [rw] form_fields - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::FormField>] - # A list of visually detected form fields on the page. - # @!attribute [rw] symbols - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::Symbol>] - # A list of visually detected symbols on the page. - # @!attribute [rw] detected_barcodes - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode>] - # A list of detected barcodes. - # @!attribute [rw] image_quality_scores - # @return [::Google::Cloud::DocumentAI::V1::Document::Page::ImageQualityScores] - # Image quality scores. - # @!attribute [rw] provenance - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::TextAnchor] - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the current - # {::Google::Cloud::DocumentAI::V1::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::V1::BoundingPoly] - # The bounding polygon for the - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout}. - # @!attribute [rw] orientation - # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout::Orientation] - # Detected orientation for the - # {::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::Block Block}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::Paragraph Paragraph}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::Line Line}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. - # @!attribute [rw] detected_break - # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Token::DetectedBreak] - # Detected break at the end of a - # {::Google::Cloud::DocumentAI::V1::Document::Page::Token Token}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::DocumentAI::V1::Document::Provenance] - # The history of this annotation. - # @!attribute [rw] style_info - # @return [::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Token Token}. - # @!attribute [rw] type - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::Symbol Symbol}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. - # @!attribute [rw] type - # @return [::String] - # Type of the - # {::Google::Cloud::DocumentAI::V1::Document::Page::VisualElement VisualElement}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::Table Table}. - # @!attribute [rw] header_rows - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::Table::TableRow>] - # Header rows of the table. - # @!attribute [rw] body_rows - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::Table::TableRow>] - # Body rows of the table. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the - # {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} name. - # e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - # @!attribute [rw] field_value - # @return [::Google::Cloud::DocumentAI::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for the - # {::Google::Cloud::DocumentAI::V1::Document::Page::FormField FormField} value. - # @!attribute [rw] name_detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] - # A list of detected languages for name together with confidence. - # @!attribute [rw] value_detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode DetectedBarcode}. - # @!attribute [rw] barcode - # @return [::Google::Cloud::DocumentAI::V1::Barcode] - # Detailed barcode information of the - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::TextAnchor] - # Optional. Provenance of the entity. - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::Document#text Document.text}. - # @!attribute [rw] text_segments - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment>] - # The text segments from the - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Document::ShardInfo#text_offset ShardInfo.text_offset} - # @!attribute [rw] start_index - # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} - # start UTF-8 char index in the - # {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. - # @!attribute [rw] end_index - # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1::Document::TextAnchor::TextSegment TextSegment} - # half open end UTF-8 char index in the - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::Document::PageAnchor::PageRef::LayoutType] - # Optional. The type of the layout element that is being referenced if - # any. - # @!attribute [rw] layout_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. Deprecated. Use - # {::Google::Cloud::DocumentAI::V1::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} - # instead. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::DocumentAI::V1::BoundingPoly] - # Optional. Identifies the bounding polygon of a layout element on the - # page. If `layout_type` is set, the bounding polygon must be exactly the - # same to the layout element it's referring to. - # @!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::V1::Document::Page#blocks Page.blocks} - # element. - BLOCK = 1 - - # References a - # {::Google::Cloud::DocumentAI::V1::Document::Page#paragraphs Page.paragraphs} - # element. - PARAGRAPH = 2 - - # References a - # {::Google::Cloud::DocumentAI::V1::Document::Page#lines Page.lines} element. - LINE = 3 - - # References a - # {::Google::Cloud::DocumentAI::V1::Document::Page#tokens Page.tokens} - # element. - TOKEN = 4 - - # References a - # {::Google::Cloud::DocumentAI::V1::Document::Page#visual_elements Page.visual_elements} - # element. - VISUAL_ELEMENT = 5 - - # Refrrences a - # {::Google::Cloud::DocumentAI::V1::Document::Page#tables Page.tables} - # element. - TABLE = 6 - - # References a - # {::Google::Cloud::DocumentAI::V1::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 - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # The index of the revision that produced this element. - # @!attribute [rw] id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @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::V1::Document::Provenance::Parent>] - # References to the original elements that are replaced. - # @!attribute [rw] type - # @return [::Google::Cloud::DocumentAI::V1::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 - # @deprecated This field is deprecated and may be removed in the next major version update. - # @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 - # @deprecated This field is deprecated and may be removed in the next major version update. - # @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::V1::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::V1::Document::TextAnchor] - # Provenance of the correction. - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1::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 - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Provenance>] - # The history of this annotation. - class TextChange - 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-v1/proto_docs/google/cloud/documentai/v1/document_io.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb deleted file mode 100644 index 558ff50affef..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # 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::V1::RawDocument#content content}. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the document, it supports all Unicode characters except - # the following: - # `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` - # `~`, `=` and `:` are reserved. - # If not specified, a default ID is generated. - 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::V1::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::V1::GcsPrefix] - # The set of documents that match the specified Cloud Storage `gcs_prefix`. - # @!attribute [rw] gcs_documents - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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 - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Turn on font identification model and return font style information. - # Deprecated, use - # {::Google::Cloud::DocumentAI::V1::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 (and later) processors. - # @!attribute [rw] premium_features - # @return [::Google::Cloud::DocumentAI::V1::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 - # (and later) 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-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb deleted file mode 100644 index 385f28b3da15..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb +++ /dev/null @@ -1,981 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # Options for Process API - # @!attribute [rw] individual_page_selector - # @return [::Google::Cloud::DocumentAI::V1::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 fewer 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::V1::OcrConfig] - # Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. - # Returns error if set on other processor types. - # @!attribute [rw] schema_override - # @return [::Google::Cloud::DocumentAI::V1::DocumentSchema] - # Optional. Override the schema of the - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. Will - # return an Invalid Argument error if this field is set when the underlying - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} doesn't - # support schema override. - 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::V1::DocumentProcessorService::Client#process_document ProcessDocument} - # method. - # @!attribute [rw] inline_document - # @return [::Google::Cloud::DocumentAI::V1::Document] - # An inline document proto. - # @!attribute [rw] raw_document - # @return [::Google::Cloud::DocumentAI::V1::RawDocument] - # A raw document content (bytes). - # @!attribute [rw] gcs_document - # @return [::Google::Cloud::DocumentAI::V1::GcsDocument] - # A raw document on Google Cloud Storage. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1::Processor Processor} is specified, the server - # will use its [default - # version][google.cloud.documentai.v1.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!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::V1::ProcessResponse#document ProcessResponse.document} - # output. Only supports top-level document and pages field, so it must be in - # the form of `{document_field_name}` or `pages.{page_field_name}`. - # @!attribute [rw] process_options - # @return [::Google::Cloud::DocumentAI::V1::ProcessOptions] - # Inference-time options for the process API - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints) and can only contain lowercase letters, numeric - # characters, underscores, and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - class ProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The status of human review on a processed document. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::HumanReviewStatus#state_message state_message} - # for details. - ERROR = 4 - end - end - - # Response message for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document ProcessDocument} - # method. - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1::Document] - # The document payload, will populate fields based on the processor's - # behavior. - # @!attribute [rw] human_review_status - # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of - # {::Google::Cloud::DocumentAI::V1::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] input_documents - # @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig] - # The input documents for the - # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments} - # method. - # @!attribute [rw] document_output_config - # @return [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig] - # The output configuration for the - # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessOptions] - # Inference-time options for the process API - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints) and can only contain lowercase letters, numeric - # characters, underscores, and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - class BatchProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentOutputConfig::GcsOutputConfig#gcs_uri DocumentOutputConfig.GcsOutputConfig.gcs_uri}) - # of the processed document if it was successful, otherwise empty. - # @!attribute [rw] human_review_status - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes} - # method. - # @!attribute [rw] processor_types - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes} - # method. - # @!attribute [rw] processor_types - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#list_processors ListProcessors} - # method. - # @!attribute [rw] processors - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#list_processor_versions ListProcessorVersions} - # method. - # @!attribute [rw] processor_versions - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#delete_processor_version DeleteProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#deploy_processor_version DeployProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#undeploy_processor_version UndeployProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#create_processor CreateProcessor} - # method. Notice this request is sent to a regionalized backend service. If the - # {::Google::Cloud::DocumentAI::V1::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::V1::Processor] - # Required. The processor to be created, requires - # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and - # {::Google::Cloud::DocumentAI::V1::Processor#display_name Processor.display_name} - # to be set. Also, the - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#delete_processor DeleteProcessor} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#enable_processor EnableProcessor} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#disable_processor DisableProcessor} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} - # method. - # @!attribute [rw] processor - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1::Processor Processor} to change default - # version. - # @!attribute [rw] default_processor_version - # @return [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentProcessorService::Client#set_default_processor_version SetDefaultProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#train_processor_version TrainProcessorVersion} - # method. - # @!attribute [rw] custom_document_extraction_options - # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions] - # Options to control Custom Document Extraction (CDE) Processor. - # @!attribute [rw] foundation_model_tuning_options - # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions] - # Options to control foundation model tuning of a 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::V1::ProcessorVersion] - # Required. The processor version to be created. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1::DocumentSchema] - # Optional. The schema the processor version will be trained with. - # @!attribute [rw] input_data - # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData] - # Optional. The input data used to train the - # {::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion ProcessorVersion}. - # @!attribute [rw] training_documents - # @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig] - # The documents used for training the new version. - # @!attribute [rw] test_documents - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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 fall back to - # `MODEL_BASED`. - module TrainingMethod - TRAINING_METHOD_UNSPECIFIED = 0 - - MODEL_BASED = 1 - - TEMPLATE_BASED = 2 - end - end - - # Options to control foundation model tuning of the processor. - # @!attribute [rw] train_steps - # @return [::Integer] - # Optional. The number of steps to run for model tuning. Valid values are - # between 1 and 400. If not provided, recommended steps will be used. - # @!attribute [rw] learning_rate_multiplier - # @return [::Float] - # Optional. The multiplier to apply to the recommended learning rate. Valid - # values are between 0.1 and 10. If not provided, recommended learning rate - # will be used. - class FoundationModelTuningOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response for - # {::Google::Cloud::DocumentAI::V1::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::V1::CommonOperationMetadata] - # The basic metadata of the long-running operation. - # @!attribute [rw] training_dataset_validation - # @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionMetadata::DatasetValidation] - # The training dataset validation information. - # @!attribute [rw] test_dataset_validation - # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#review_document ReviewDocument} - # method. - # @!attribute [rw] inline_document - # @return [::Google::Cloud::DocumentAI::V1::Document] - # An inline document proto. - # @!attribute [rw] human_review_config - # @return [::String] - # Required. The resource name of the - # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - # document will be reviewed with. - # @!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::V1::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::DocumentProcessorService::Client#review_document ReviewDocument} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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 - end - - # Evaluates the given - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} against the - # supplied documents. - # @!attribute [rw] processor_version - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] evaluation_documents - # @return [::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client#evaluate_processor_version EvaluateProcessorVersion} - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::ProcessorVersion ProcessorVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1::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::V1::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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb deleted file mode 100644 index ed857c5c91a3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb +++ /dev/null @@ -1,165 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # 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::V1::DocumentSchema::EntityType>] - # Entity types of the schema. - # @!attribute [rw] metadata - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::DocumentSchema::EntityType::Property>] - # Description the nested structure, or composition of an entity. - 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] display_name - # @return [::String] - # User defined name for the property. - # @!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::V1::DocumentSchema::EntityType::Property::OccurrenceType] - # Occurrence type limits the number of instances an entity type appears - # in the document. - 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, not mentions, of an entity. - # For example, a bank statement might only have one - # `account_number`, but this account number can be mentioned in several - # places on the document. In this case, the `account_number` is - # considered a `REQUIRED_ONCE` entity type. If, on the other hand, we - # expect a bank statement to contain the status of multiple different - # accounts for the customers, the occurrence type is set to - # `REQUIRED_MULTIPLE`. - 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-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb deleted file mode 100644 index f489ab2e00ed..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/evaluation.rb +++ /dev/null @@ -1,199 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # 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::V1::Evaluation::Metrics] - # An aggregate of the statistics for the evaluation with fuzzy matching on. - # @!attribute [rw] aggregate_metrics_exact - # @return [::Google::Cloud::DocumentAI::V1::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::V1::Evaluation::Counters] - # Counters for the documents used in the evaluation. - # @!attribute [rw] all_entities_metrics - # @return [::Google::Cloud::DocumentAI::V1::Evaluation::MultiConfidenceMetrics] - # Metrics for all the entities in aggregate. - # @!attribute [rw] entity_metrics - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::Evaluation::ConfidenceLevelMetrics>] - # Metrics across confidence levels with fuzzy matching enabled. - # @!attribute [rw] confidence_level_metrics_exact - # @return [::Array<::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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-v1/proto_docs/google/cloud/documentai/v1/geometry.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/geometry.rb deleted file mode 100644 index 332d3c83dd67..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/geometry.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # 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::V1::Vertex>] - # The bounding polygon vertices. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::DocumentAI::V1::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-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb deleted file mode 100644 index 39a10b864e08..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/operation_metadata.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # The common metadata for long running operations. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1::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-v1/proto_docs/google/cloud/documentai/v1/processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb deleted file mode 100644 index 51a4d9e7b86e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # A processor version is an implementation of a processor. Each processor - # can have multiple versions, pretrained by Google internally or uptrained - # by the customer. A processor can only have one default version at a time. - # Its document-processing behavior is defined by that version. - # @!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::V1::DocumentSchema] - # The schema of the processor version. Describes the output. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1::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::V1::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::V1::ProcessorVersion::DeprecationInfo] - # If set, information about the eventual deprecation of this version. - # @!attribute [r] model_type - # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion::ModelType] - # Output only. The model type of this processor 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 - - # The possible model types of the processor version. - module ModelType - # The processor version has unspecified model type. - MODEL_TYPE_UNSPECIFIED = 0 - - # The processor version has generative model type. - MODEL_TYPE_GENERATIVE = 1 - - # The processor version has custom model type. - MODEL_TYPE_CUSTOM = 2 - end - end - - # Contains the alias and the aliased resource name of processor version. - # @!attribute [rw] alias - # @return [::String] - # The alias in the form of `processor_version` resource name. - # @!attribute [rw] processor_version - # @return [::String] - # The resource name of aliased processor version. - class ProcessorVersionAlias - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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::V1::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::V1::Processor::State] - # Output only. The state of the processor. - # @!attribute [rw] default_processor_version - # @return [::String] - # The default processor version. - # @!attribute [r] processor_version_aliases - # @return [::Array<::Google::Cloud::DocumentAI::V1::ProcessorVersionAlias>] - # Output only. The processor version aliases. - # @!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-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb deleted file mode 100644 index f54f7925ebf1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 V1 - # 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::V1::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-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index fb4d6862eac9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # 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-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b5731a824060..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 8c6b19d52e3d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 8e7abcf8f052..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 4ac9c4801a3f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 5160138862c2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 09acc69b6125..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/color.rb deleted file mode 100644 index 0cb4ccd2d45d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/color.rb +++ /dev/null @@ -1,173 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/date.rb deleted file mode 100644 index a8b78b5e8ce4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/datetime.rb deleted file mode 100644 index 7be9d37b7d84..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/datetime.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/money.rb deleted file mode 100644 index e3dfd2f9ecda..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/money.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/postal_address.rb deleted file mode 100644 index 07d77c5d3183..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/proto_docs/google/type/postal_address.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1/snippets/Gemfile deleted file mode 100644 index fec23b9ca434..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-v1", path: "../" -else - gem "google-cloud-document_ai-v1" -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-v1/snippets/document_processor_service/batch_process_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb deleted file mode 100644 index f895352d5626..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the batch_process_documents call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents. -# -def batch_process_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb deleted file mode 100644 index 5199863c22e8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_CreateProcessor_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the create_processor call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#create_processor. -# -def create_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new - - # Call the create_processor method. - result = client.create_processor request - - # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. - p result -end -# [END documentai_v1_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb deleted file mode 100644 index 89216091f3ef..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_DeleteProcessor_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the delete_processor call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor. -# -def delete_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb deleted file mode 100644 index 96c010b088c4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the delete_processor_version call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor_version. -# -def delete_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb deleted file mode 100644 index 62bf6c78927d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the deploy_processor_version call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#deploy_processor_version. -# -def deploy_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb deleted file mode 100644 index 6f9ef636641b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_DisableProcessor_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the disable_processor call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor. -# -def disable_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb deleted file mode 100644 index a613a66ada79..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_EnableProcessor_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the enable_processor call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor. -# -def enable_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb deleted file mode 100644 index cb12bd6c43e9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/evaluate_processor_version.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the evaluate_processor_version call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#evaluate_processor_version. -# -def evaluate_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb deleted file mode 100644 index d75434431ec8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the fetch_processor_types call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types. -# -def fetch_processor_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new - - # Call the fetch_processor_types method. - result = client.fetch_processor_types request - - # The returned object is of type Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse. - p result -end -# [END documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb deleted file mode 100644 index e73d695adc9a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_evaluation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_GetEvaluation_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the get_evaluation call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_evaluation. -# -def get_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new - - # Call the get_evaluation method. - result = client.get_evaluation request - - # The returned object is of type Google::Cloud::DocumentAI::V1::Evaluation. - p result -end -# [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb deleted file mode 100644 index f45403dbd9f6..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_GetProcessor_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the get_processor call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor. -# -def get_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new - - # Call the get_processor method. - result = client.get_processor request - - # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. - p result -end -# [END documentai_v1_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb deleted file mode 100644 index ffb136521d27..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_type.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_GetProcessorType_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the get_processor_type call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_type. -# -def get_processor_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new - - # Call the get_processor_type method. - result = client.get_processor_type request - - # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorType. - p result -end -# [END documentai_v1_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb deleted file mode 100644 index e41d8a5e6adf..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the get_processor_version call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_version. -# -def get_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new - - # Call the get_processor_version method. - result = client.get_processor_version request - - # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorVersion. - p result -end -# [END documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb deleted file mode 100644 index cdc334651fb0..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_evaluations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_ListEvaluations_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the list_evaluations call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_evaluations. -# -def list_evaluations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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::V1::Evaluation. - p item - end -end -# [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb deleted file mode 100644 index 216d55f99502..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the list_processor_types call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types. -# -def list_processor_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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::V1::ProcessorType. - p item - end -end -# [END documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb deleted file mode 100644 index 319cb5382c18..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the list_processor_versions call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_versions. -# -def list_processor_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion. - p item - end -end -# [END documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb deleted file mode 100644 index 6820bb27e937..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_ListProcessors_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the list_processors call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processors. -# -def list_processors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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::V1::Processor. - p item - end -end -# [END documentai_v1_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb deleted file mode 100644 index e540e93ef9a9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_ProcessDocument_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the process_document call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document. -# -def process_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::ProcessRequest.new - - # Call the process_document method. - result = client.process_document request - - # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessResponse. - p result -end -# [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb deleted file mode 100644 index 18c4c4dd5cc5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_ReviewDocument_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the review_document call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document. -# -def review_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb deleted file mode 100644 index 47b602eed327..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the set_default_processor_version call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#set_default_processor_version. -# -def set_default_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb deleted file mode 100644 index d65c94187c1c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/train_processor_version.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the train_processor_version call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#train_processor_version. -# -def train_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb deleted file mode 100644 index 6169b3b7d5fe..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] -require "google/cloud/document_ai/v1" - -## -# Snippet for the undeploy_processor_version call in the DocumentProcessorService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#undeploy_processor_version. -# -def undeploy_processor_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1::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_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json b/owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json deleted file mode 100644 index f199771089be..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-document_ai-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.documentai.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#process_document.", - "file": "document_processor_service/process_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "process_document", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::ProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::ProcessResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ProcessDocument", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#batch_process_documents.", - "file": "document_processor_service/batch_process_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_process_documents", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::BatchProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "BatchProcessDocuments", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#fetch_processor_types.", - "file": "document_processor_service/fetch_processor_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_processor_types", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "FetchProcessorTypes", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_processor_types.", - "file": "document_processor_service/list_processor_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processor_types", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::ListProcessorTypesResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessorTypes", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_processor_type.", - "file": "document_processor_service/get_processor_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor_type", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::ProcessorType", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessorType", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_processors.", - "file": "document_processor_service/list_processors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processors", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::ListProcessorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::ListProcessorsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessors", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessors", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_processor.", - "file": "document_processor_service/get_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::GetProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::Processor", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessor", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#train_processor_version.", - "file": "document_processor_service/train_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "train_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#train_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "TrainProcessorVersion", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_processor_version.", - "file": "document_processor_service/get_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::ProcessorVersion", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessorVersion", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_processor_versions.", - "file": "document_processor_service/list_processor_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processor_versions", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::ListProcessorVersionsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessorVersions", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#delete_processor_version.", - "file": "document_processor_service/delete_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeleteProcessorVersion", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#deploy_processor_version.", - "file": "document_processor_service/deploy_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#deploy_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeployProcessorVersion", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#undeploy_processor_version.", - "file": "document_processor_service/undeploy_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "undeploy_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#undeploy_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "UndeployProcessorVersion", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#create_processor.", - "file": "document_processor_service/create_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_processor", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#create_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::CreateProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::Processor", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "CreateProcessor", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#delete_processor.", - "file": "document_processor_service/delete_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_processor", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::DeleteProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeleteProcessor", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#enable_processor.", - "file": "document_processor_service/enable_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_processor", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::EnableProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "EnableProcessor", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#disable_processor.", - "file": "document_processor_service/disable_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_processor", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::DisableProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DisableProcessor", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#set_default_processor_version.", - "file": "document_processor_service/set_default_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_default_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#set_default_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "SetDefaultProcessorVersion", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#review_document.", - "file": "document_processor_service/review_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "review_document", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ReviewDocument", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#evaluate_processor_version.", - "file": "document_processor_service/evaluate_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "evaluate_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#evaluate_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "EvaluateProcessorVersion", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#get_evaluation.", - "file": "document_processor_service/get_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_evaluation", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::GetEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::Evaluation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetEvaluation", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.GetEvaluation", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1_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::V1::DocumentProcessorService::Client#list_evaluations.", - "file": "document_processor_service/list_evaluations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_evaluations", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_evaluations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1::ListEvaluationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1::ListEvaluationsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListEvaluations", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService.ListEvaluations", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb deleted file mode 100644 index 97e56f4baf0a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service_pb" -require "google/cloud/documentai/v1/document_processor_service_services_pb" -require "google/cloud/document_ai/v1/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1::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 - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - 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::V1::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::V1::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::V1::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::V1::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::V1::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 - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb deleted file mode 100644 index 2decd66edc80..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_evaluation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do - client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do - client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do - client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do - client = ::Google::Cloud::DocumentAI::V1::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, DummyStub.new do - client = ::Google::Cloud::DocumentAI::V1::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-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb deleted file mode 100644 index 8a2c6645d64f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb +++ /dev/null @@ -1,1309 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service_pb" -require "google/cloud/document_ai/v1/document_processor_service/rest" - - -class ::Google::Cloud::DocumentAI::V1::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 - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_process_document - # Create test objects. - client_result = ::Google::Cloud::DocumentAI::V1::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" - skip_human_review = true - field_mask = {} - process_options = {} - labels = {} - - 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::V1::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::V1::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.process_document({ inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.process_document inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.process_document ::Google::Cloud::DocumentAI::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels) 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, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.process_document(::Google::Cloud::DocumentAI::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels), 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_documents = {} - document_output_config = {} - skip_human_review = true - process_options = {} - labels = {} - - 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::V1::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::V1::DocumentProcessorService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_process_documents({ name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_process_documents name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_process_documents ::Google::Cloud::DocumentAI::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_process_documents({ name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }, 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::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels), 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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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" - 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::V1::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::V1::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, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb deleted file mode 100644 index d1b7febd0bbc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb +++ /dev/null @@ -1,1504 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/v1/document_processor_service_pb" -require "google/cloud/documentai/v1/document_processor_service_services_pb" -require "google/cloud/document_ai/v1/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1::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 - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_process_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1::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" - skip_human_review = true - field_mask = {} - process_options = {} - labels = {} - - 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::V1::ProcessRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::Document), request["inline_document"] - assert_equal :inline_document, request.source - assert_equal "hello world", request["name"] - 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::V1::ProcessOptions), request["process_options"] - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, process_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.process_document({ inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }) 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, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.process_document ::Google::Cloud::DocumentAI::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels) 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, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels }, 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::V1::ProcessRequest.new(inline_document: inline_document, name: name, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options, labels: labels), 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_documents = {} - document_output_config = {} - skip_human_review = true - process_options = {} - labels = {} - - 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::V1::BatchProcessRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig), request["input_documents"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::DocumentOutputConfig), request["document_output_config"] - assert_equal true, request["skip_human_review"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::ProcessOptions), request["process_options"] - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_process_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_process_documents({ name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }) 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_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels 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::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels) 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_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels }, 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::V1::BatchProcessRequest.new(name: name, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options, labels: labels), 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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::TrainProcessorVersionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::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::V1::ProcessorVersion), request["processor_version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::DocumentSchema), request["document_schema"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::CreateProcessorRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::Processor), request["processor"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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" - 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::V1::ReviewDocumentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::Document), request["inline_document"] - assert_equal :inline_document, request.source - assert_equal "hello world", request["human_review_config"] - assert_equal true, request["enable_schema_validation"] - assert_equal :DEFAULT, request["priority"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::DocumentSchema), request["document_schema"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, review_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1::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, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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, 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::V1::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, 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::V1::EvaluateProcessorVersionRequest, request - assert_equal "hello world", request["processor_version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig), request["evaluation_documents"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, evaluate_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DocumentAI::V1::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::V1::DocumentProcessorService::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb b/owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb deleted file mode 100644 index 48407bca7edb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"