From aa249c233c544f255114cbb6f84e6c6d62a558e9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 20:52:47 +0000 Subject: [PATCH 1/2] feat: added advanced_ocr_options field in OcrConfig PiperOrigin-RevId: 504600937 Source-Link: https://github.com/googleapis/googleapis/commit/91bee517fba624f73584e72c3daaa04ef87c368f Source-Link: https://github.com/googleapis/googleapis-gen/commit/70424b9457d15ed852a0a0b9a4f032f2b309b32c Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRvY3VtZW50X2FpLXYxYmV0YTMvLk93bEJvdC55YW1sIiwiaCI6IjcwNDI0Yjk0NTdkMTVlZDg1MmEwYTBiOWE0ZjAzMmYyYjMwOWIzMmMifQ== --- .../.gitignore | 22 + .../.repo-metadata.json | 19 + .../.rubocop.yml | 33 + .../.yardopts | 12 + .../AUTHENTICATION.md | 151 + .../CHANGELOG.md | 2 + .../google-cloud-document_ai-v1beta3/Gemfile | 3 + .../LICENSE.md | 201 ++ .../README.md | 144 + .../google-cloud-document_ai-v1beta3/Rakefile | 201 ++ .../gapic_metadata.json | 128 + .../google-cloud-document_ai-v1beta3.gemspec | 38 + .../lib/google-cloud-document_ai-v1beta3.rb | 21 + .../lib/google/cloud/document_ai/v1beta3.rb | 40 + .../v1beta3/document_processor_service.rb | 53 + .../document_processor_service/client.rb | 2615 +++++++++++++++++ .../document_processor_service/credentials.rb | 51 + .../document_processor_service/operations.rb | 770 +++++ .../document_processor_service/paths.rb | 151 + .../cloud/document_ai/v1beta3/version.rb | 28 + .../cloud/documentai/v1beta3/barcode_pb.rb | 24 + .../documentai/v1beta3/document_io_pb.rb | 67 + .../cloud/documentai/v1beta3/document_pb.rb | 332 +++ .../v1beta3/document_processor_service_pb.rb | 352 +++ .../document_processor_service_services_pb.rb | 103 + .../documentai/v1beta3/document_schema_pb.rb | 60 + .../cloud/documentai/v1beta3/evaluation_pb.rb | 72 + .../cloud/documentai/v1beta3/geometry_pb.rb | 33 + .../v1beta3/operation_metadata_pb.rb | 37 + .../cloud/documentai/v1beta3/processor_pb.rb | 73 + .../documentai/v1beta3/processor_type_pb.rb | 35 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 318 ++ .../proto_docs/google/api/field_behavior.rb | 71 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 ++ .../cloud/documentai/v1beta3/barcode.rb | 73 + .../cloud/documentai/v1beta3/document.rb | 969 ++++++ .../cloud/documentai/v1beta3/document_io.rb | 133 + .../v1beta3/document_processor_service.rb | 867 ++++++ .../documentai/v1beta3/document_schema.rb | 155 + .../cloud/documentai/v1beta3/evaluation.rb | 181 ++ .../cloud/documentai/v1beta3/geometry.rb | 65 + .../documentai/v1beta3/operation_metadata.rb | 68 + .../cloud/documentai/v1beta3/processor.rb | 175 ++ .../documentai/v1beta3/processor_type.rb | 65 + .../google/longrunning/operations.rb | 164 ++ .../proto_docs/google/protobuf/any.rb | 141 + .../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 | 129 + .../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 | 46 + .../create_processor.rb | 39 + .../delete_processor.rb | 46 + .../delete_processor_version.rb | 46 + .../deploy_processor_version.rb | 46 + .../disable_processor.rb | 46 + .../enable_processor.rb | 46 + .../evaluate_processor_version.rb | 46 + .../fetch_processor_types.rb | 39 + .../get_evaluation.rb | 39 + .../get_processor.rb | 39 + .../get_processor_type.rb | 39 + .../get_processor_version.rb | 39 + .../list_evaluations.rb | 45 + .../list_processor_types.rb | 45 + .../list_processor_versions.rb | 45 + .../list_processors.rb | 45 + .../process_document.rb | 39 + .../review_document.rb | 46 + .../set_default_processor_version.rb | 46 + .../train_processor_version.rb | 46 + .../undeploy_processor_version.rb | 46 + ...adata_google.cloud.documentai.v1beta3.json | 895 ++++++ ...ument_processor_service_operations_test.rb | 380 +++ .../document_processor_service_paths_test.rb | 97 + .../document_processor_service_test.rb | 1495 ++++++++++ .../test/helper.rb | 23 + 87 files changed, 14656 insertions(+) create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/README.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb create mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore b/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json new file mode 100644 index 000000000000..e4eca1154624 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_id": "us-documentai.googleapis.com", + "api_shortname": "documentai", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest", + "distribution_name": "google-cloud-document_ai-v1beta3", + "is_cloud": true, + "language": "ruby", + "name": "documentai", + "name_pretty": "Document AI V1beta3 API", + "product_documentation": "https://cloud.google.com/document-ai/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details.", + "ruby-cloud-env-prefix": "DOCUMENT_AI", + "ruby-cloud-product-url": "https://cloud.google.com/document-ai/", + "ruby-cloud-namespace-override": "DocumentAi=DocumentAI", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml b/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml new file mode 100644 index 000000000000..945616d355d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-document_ai-v1beta3.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-document_ai-v1beta3.rb" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts b/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts new file mode 100644 index 000000000000..fd21d6f25a32 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Document AI V1beta3 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md new file mode 100644 index 000000000000..ebe733081f48 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md @@ -0,0 +1,151 @@ +# Authentication + +In general, the google-cloud-document_ai-v1beta3 library uses +[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) +credentials to connect to Google Cloud services. When running within +[Google Cloud Platform environments](#google-cloud-platform-environments) the +credentials will be discovered automatically. When running on other +environments, the Service Account credentials can be specified by providing the +path to the +[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) +for the account (or the JSON itself) in +[environment variables](#environment-variables). Additionally, Cloud SDK +credentials can also be discovered automatically, but this is only recommended +during development. + +## Quickstart + +1. [Create a service account and credentials](#creating-a-service-account). +2. Set the [environment variable](#environment-variables). + +```sh +export DOCUMENT_AI_CREDENTIALS=path/to/keyfile.json +``` + +3. Initialize the client. + +```ruby +require "google/cloud/document_ai/v1beta3" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +``` + +## Credential Lookup + +The google-cloud-document_ai-v1beta3 library aims to make authentication +as simple as possible, and provides several mechanisms to configure your system +without requiring **Service Account Credentials** directly in code. + +**Credentials** are discovered in the following order: + +1. Specify credentials in method arguments +2. Specify credentials in configuration +3. Discover credentials path in environment variables +4. Discover credentials JSON in environment variables +5. Discover credentials file in the Cloud SDK's path +6. Discover GCP credentials + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. +Code should be written as if already authenticated. + +### Environment Variables + +The **Credentials JSON** can be placed in environment variables instead of +declaring them directly in code. Each service has its own environment variable, +allowing for different service accounts to be used for different services. (See +the READMEs for the individual service gems for details.) The path to the +**Credentials JSON** file can be stored in the environment variable, or the +**Credentials JSON** itself can be stored for environments such as Docker +containers where writing files is difficult or not encouraged. + +The environment variables that google-cloud-document_ai-v1beta3 +checks for credentials are configured on the service Credentials class (such as +{::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials}): + +* `DOCUMENT_AI_CREDENTIALS` - Path to JSON file, or JSON contents +* `DOCUMENT_AI_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/document_ai/v1beta3" + +ENV["DOCUMENT_AI_CREDENTIALS"] = "path/to/keyfile.json" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +``` + +### Configuration + +The path to the **Credentials JSON** file can be configured instead of storing +it in an environment variable. Either on an individual client initialization: + +```ruby +require "google/cloud/document_ai/v1beta3" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = "path/to/keyfile.json" +end +``` + +Or globally for all clients: + +```ruby +require "google/cloud/document_ai/v1beta3" + +::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| + config.credentials = "path/to/keyfile.json" +end + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +``` + +### Cloud SDK + +This option allows for an easy way to authenticate during development. If +credentials are not provided in code or in environment variables, then Cloud SDK +credentials are discovered. + +To configure your system for this, simply: + +1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) +2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` +3. Write code as if already authenticated. + +**NOTE:** This is _not_ recommended for running in production. The Cloud SDK +*should* only be used during development. + +## Creating a Service Account + +Google Cloud requires **Service Account Credentials** to +connect to the APIs. You will use the **JSON key file** to +connect to most services with google-cloud-document_ai-v1beta3. + +If you are not running this client within +[Google Cloud Platform environments](#google-cloud-platform-environments), you +need a Google Developers service account. + +1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). +2. Create a new project or click on an existing project. +3. Activate the menu in the upper left and select **APIs & Services**. From + here, you will enable the APIs that your application requires. + + *Note: You may need to enable billing in order to use these services.* + +4. Select **Credentials** from the side navigation. + + Find the "Create credentials" drop down near the top of the page, and select + "Service account" to be guided through downloading a new JSON key file. + + If you want to re-use an existing service account, you can easily generate a + new key file. Just select the account you wish to re-use, click the pencil + tool on the right side to edit the service account, select the **Keys** tab, + and then select **Add Key**. + + The key file you download will be used by this library to authenticate API + requests and should be stored in a secure location. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile new file mode 100644 index 000000000000..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md new file mode 100644 index 000000000000..9995e975266b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Document AI V1beta3 API + +API Client library for the Document AI V1beta3 API + +Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Document AI V1beta3 API. Most users should consider using +the main client gem, +[google-cloud-document_ai](https://rubygems.org/gems/google-cloud-document_ai). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-document_ai-v1beta3 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/us-documentai.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/document_ai/v1beta3" + +client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +request = ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new # (request fields as keyword arguments...) +response = client.process_document request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/document-ai/) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-document_ai`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-document_ai-v1beta3`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-document_ai`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-document_ai-v1beta3`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile new file mode 100644 index 000000000000..eefce4d611cb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-document_ai-v1beta3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-document_ai-v1beta3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +end + +# Acceptance tests +desc "Run the google-cloud-document_ai-v1beta3 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["DOCUMENT_AI_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["DOCUMENT_AI_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["DOCUMENT_AI_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or DOCUMENT_AI_TEST_PROJECT=test123 DOCUMENT_AI_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["DOCUMENT_AI_PROJECT"] = project + ENV["DOCUMENT_AI_TEST_PROJECT"] = project + ENV["DOCUMENT_AI_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-document_ai-v1beta3 gem has no acceptance tests." + end + end + + desc "Run acceptance tests with coverage." + task :coverage do + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-document_ai-v1beta3 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-document_ai-v1beta3" + header "google-cloud-document_ai-v1beta3 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-document_ai-v1beta3 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-document_ai-v1beta3 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-document_ai-v1beta3 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-document_ai-v1beta3 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json new file mode 100644 index 000000000000..c84135811a7e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/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.v1beta3", + "libraryPackage": "::Google::Cloud::DocumentAI::V1beta3", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client", + "rpcs": { + "ProcessDocument": { + "methods": [ + "process_document" + ] + }, + "BatchProcessDocuments": { + "methods": [ + "batch_process_documents" + ] + }, + "FetchProcessorTypes": { + "methods": [ + "fetch_processor_types" + ] + }, + "ListProcessorTypes": { + "methods": [ + "list_processor_types" + ] + }, + "GetProcessorType": { + "methods": [ + "get_processor_type" + ] + }, + "ListProcessors": { + "methods": [ + "list_processors" + ] + }, + "GetProcessor": { + "methods": [ + "get_processor" + ] + }, + "TrainProcessorVersion": { + "methods": [ + "train_processor_version" + ] + }, + "GetProcessorVersion": { + "methods": [ + "get_processor_version" + ] + }, + "ListProcessorVersions": { + "methods": [ + "list_processor_versions" + ] + }, + "DeleteProcessorVersion": { + "methods": [ + "delete_processor_version" + ] + }, + "DeployProcessorVersion": { + "methods": [ + "deploy_processor_version" + ] + }, + "UndeployProcessorVersion": { + "methods": [ + "undeploy_processor_version" + ] + }, + "CreateProcessor": { + "methods": [ + "create_processor" + ] + }, + "DeleteProcessor": { + "methods": [ + "delete_processor" + ] + }, + "EnableProcessor": { + "methods": [ + "enable_processor" + ] + }, + "DisableProcessor": { + "methods": [ + "disable_processor" + ] + }, + "SetDefaultProcessorVersion": { + "methods": [ + "set_default_processor_version" + ] + }, + "ReviewDocument": { + "methods": [ + "review_document" + ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluate_processor_version" + ] + }, + "GetEvaluation": { + "methods": [ + "get_evaluation" + ] + }, + "ListEvaluations": { + "methods": [ + "list_evaluations" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec b/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec new file mode 100644 index 000000000000..6b14859505c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec @@ -0,0 +1,38 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/document_ai/v1beta3/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-document_ai-v1beta3" + gem.version = Google::Cloud::DocumentAI::V1beta3::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details." + gem.summary = "API Client library for the Document AI V1beta3 API" + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.16.0", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.3", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb new file mode 100644 index 000000000000..8aad94dd490d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/document_ai/v1beta3" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb new file mode 100644 index 000000000000..f78e79c9c9b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/document_ai/v1beta3/document_processor_service" +require "google/cloud/document_ai/v1beta3/version" + +module Google + module Cloud + module DocumentAI + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/document_ai/v1beta3" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + module V1beta3 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta3", "_helpers.rb" +require "google/cloud/document_ai/v1beta3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb new file mode 100644 index 000000000000..93cf8666fcbf --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/document_ai/v1beta3/version" + +require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" +require "google/cloud/document_ai/v1beta3/document_processor_service/paths" +require "google/cloud/document_ai/v1beta3/document_processor_service/operations" +require "google/cloud/document_ai/v1beta3/document_processor_service/client" + +module Google + module Cloud + module DocumentAI + module V1beta3 + ## + # Service to call Cloud DocumentAI to process documents according to the + # processor's definition. Processors are built using state-of-the-art Google + # AI such as natural language, computer vision, and translation to extract + # structured information from unstructured or semi-structured documents. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/document_ai/v1beta3/document_processor_service" + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + module DocumentProcessorService + end + end + end + end +end + +helper_path = ::File.join __dir__, "document_processor_service", "helpers.rb" +require "google/cloud/document_ai/v1beta3/document_processor_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb new file mode 100644 index 000000000000..c8e34658ba30 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb @@ -0,0 +1,2615 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + ## + # Client for the DocumentProcessorService service. + # + # Service to call Cloud DocumentAI to process documents according to the + # processor's definition. Processors are built using state-of-the-art Google + # AI such as natural language, computer vision, and translation to extract + # structured information from unstructured or semi-structured documents. + # + class Client + include Paths + + # @private + attr_reader :document_processor_service_stub + + ## + # Configure the DocumentProcessorService Client class. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentProcessorService clients + # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.process_document.timeout = 120.0 + default_config.rpcs.process_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_process_documents.timeout = 120.0 + default_config.rpcs.batch_process_documents.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.review_document.timeout = 120.0 + default_config.rpcs.review_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentProcessorService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new DocumentProcessorService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DocumentProcessorService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @document_processor_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Processes a single document. + # + # @overload process_document(request, options = nil) + # Pass arguments to `process_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload process_document(inline_document: nil, raw_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil) + # Pass arguments to `process_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # An inline document proto. + # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash] + # A raw document content (bytes). + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the + # server will use its [default + # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # The document payload, the [content] and [mime_type] fields must be set. + # @param skip_human_review [::Boolean] + # Whether Human Review feature should be skipped for this request. Default to + # false. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Specifies which fields to include in ProcessResponse's document. + # Only supports top level document and pages field so it must be in the form + # of `{document_field_name}` or `pages.{page_field_name}`. + # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] + # Inference-time options for the process API + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new + # + # # Call the process_document method. + # result = client.process_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. + # p result + # + def process_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.process_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.process_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.process_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :process_document, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # LRO endpoint to batch process many documents. The output is written + # to Cloud Storage as JSON in the [Document] format. + # + # @overload batch_process_documents(request, options = nil) + # Pass arguments to `batch_process_documents` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil) + # Pass arguments to `batch_process_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param input_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, ::Hash>] + # The input config for each single document in the batch process. + # @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash] + # The overall output config for batch process. + # @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] + # The input documents for batch process. + # @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash] + # The overall output config for batch process. + # @param skip_human_review [::Boolean] + # Whether Human Review feature should be skipped for this request. Default to + # false. + # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] + # Inference-time options for the process API + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new + # + # # Call the batch_process_documents method. + # result = client.batch_process_documents request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def batch_process_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_process_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_process_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :batch_process_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetches processor types. Note that we do not use ListProcessorTypes here + # because it is not paginated. + # + # @overload fetch_processor_types(request, options = nil) + # Pass arguments to `fetch_processor_types` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_processor_types(parent: nil) + # Pass arguments to `fetch_processor_types` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project of processor type to list. + # The available processor types may depend on the allow-listing on projects. + # Format: `projects/{project}/locations/{location}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new + # + # # Call the fetch_processor_types method. + # result = client.fetch_processor_types request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. + # p result + # + def fetch_processor_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_processor_types.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_processor_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :fetch_processor_types, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the processor types that exist. + # + # @overload list_processor_types(request, options = nil) + # Pass arguments to `list_processor_types` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_processor_types(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processor_types` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of processor type to list. + # The available processor types may depend on the allow-listing on projects. + # Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of processor types to return. + # If unspecified, at most 100 processor types will be returned. + # The maximum value is 500; values above 500 will be coerced to 500. + # @param page_token [::String] + # Used to retrieve the next page of results, empty if at the end of the list. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new + # + # # Call the list_processor_types method. + # result = client.list_processor_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p response + # end + # + def list_processor_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_processor_types.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_processor_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processor_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_processor_types, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor type detail. + # + # @overload get_processor_type(request, options = nil) + # Pass arguments to `get_processor_type` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_processor_type(name: nil) + # Pass arguments to `get_processor_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor type resource name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new + # + # # Call the get_processor_type method. + # result = client.get_processor_type request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p result + # + def get_processor_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_processor_type.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_processor_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_processor_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_processor_type, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all processors which belong to this project. + # + # @overload list_processors(request, options = nil) + # Pass arguments to `list_processors` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_processors(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processors` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) which owns this collection of + # Processors. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of processors to return. + # If unspecified, at most 50 processors will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # We will return the processors sorted by creation time. The page token + # will point to the next processor. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new + # + # # Call the list_processors method. + # result = client.list_processors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. + # p response + # end + # + def list_processors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_processors.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_processors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_processors, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processors, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor detail. + # + # @overload get_processor(request, options = nil) + # Pass arguments to `get_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_processor(name: nil) + # Pass arguments to `get_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # + def get_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_processor, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Trains a new processor version. + # Operation metadata is returned as + # cloud_documentai_core.TrainProcessorVersionMetadata. + # + # @overload train_processor_version(request, options = nil) + # Pass arguments to `train_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload train_processor_version(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 parent [::String] + # Required. The parent (project, location and processor) to create the new + # version for. Format: + # `projects/{project}/locations/{location}/processors/{processor}`. + # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash] + # Required. The processor version to be created. + # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] + # Optional. The schema the processor version will be trained with. + # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash] + # Optional. The input data used to train the `ProcessorVersion`. + # @param base_processor_version [::String] + # Optional. The processor version to use as a base for training. This + # processor version must be a child of `parent`. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + # + # # Call the train_processor_version method. + # result = client.train_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def train_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.train_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.train_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a processor version detail. + # + # @overload get_processor_version(request, options = nil) + # Pass arguments to `get_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_processor_version(name: nil) + # Pass arguments to `get_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new + # + # # Call the get_processor_version method. + # result = client.get_processor_version request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p result + # + def get_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_processor_version, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all versions of a processor. + # + # @overload list_processor_versions(request, options = nil) + # Pass arguments to `list_processor_versions` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_processor_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_processor_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project, location and processor) to list all + # versions. Format: + # `projects/{project}/locations/{location}/processors/{processor}` + # @param page_size [::Integer] + # The maximum number of processor versions to return. + # If unspecified, at most 10 processor versions will be returned. + # The maximum value is 20; values above 20 will be coerced to 20. + # @param page_token [::String] + # We will return the processor versions sorted by creation time. The page + # token will point to the next processor version. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new + # + # # Call the list_processor_versions method. + # result = client.list_processor_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p response + # end + # + def list_processor_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_processor_versions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_processor_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processor_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_processor_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the processor version, all artifacts under the processor version + # will be deleted. + # + # @overload delete_processor_version(request, options = nil) + # Pass arguments to `delete_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_processor_version(name: nil) + # Pass arguments to `delete_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new + # + # # Call the delete_processor_version method. + # result = client.delete_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def delete_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :delete_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deploys the processor version. + # + # @overload deploy_processor_version(request, options = nil) + # Pass arguments to `deploy_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload deploy_processor_version(name: nil) + # Pass arguments to `deploy_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be deployed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new + # + # # Call the deploy_processor_version method. + # result = client.deploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def deploy_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.deploy_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.deploy_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :deploy_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeploys the processor version. + # + # @overload undeploy_processor_version(request, options = nil) + # Pass arguments to `undeploy_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undeploy_processor_version(name: nil) + # Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor version resource name to be undeployed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new + # + # # Call the undeploy_processor_version method. + # result = client.undeploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def undeploy_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.undeploy_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.undeploy_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undeploy_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :undeploy_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a processor from the type processor that the user chose. + # The processor will be at "ENABLED" state by default after its creation. + # + # @overload create_processor(request, options = nil) + # Pass arguments to `create_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_processor(parent: nil, processor: nil) + # Pass arguments to `create_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` + # @param processor [::Google::Cloud::DocumentAI::V1beta3::Processor, ::Hash] + # Required. The processor to be created, requires [processor_type] and + # [display_name] to be set. Also, the processor is under CMEK if CMEK fields + # are set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # + def create_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :create_processor, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the processor, unloads all deployed model artifacts if it was + # enabled and then deletes all artifacts associated with this processor. + # + # @overload delete_processor(request, options = nil) + # Pass arguments to `delete_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_processor(name: nil) + # Pass arguments to `delete_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new + # + # # Call the delete_processor method. + # result = client.delete_processor request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def delete_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :delete_processor, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a processor + # + # @overload enable_processor(request, options = nil) + # Pass arguments to `enable_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_processor(name: nil) + # Pass arguments to `enable_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be enabled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new + # + # # Call the enable_processor method. + # result = client.enable_processor request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def enable_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :enable_processor, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a processor + # + # @overload disable_processor(request, options = nil) + # Pass arguments to `disable_processor` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_processor(name: nil) + # Pass arguments to `disable_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The processor resource name to be disabled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new + # + # # Call the disable_processor method. + # result = client.disable_processor request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def disable_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_processor.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :disable_processor, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Set the default (active) version of a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} that will be used in + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} + # and + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. + # + # @overload set_default_processor_version(request, options = nil) + # Pass arguments to `set_default_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_default_processor_version(processor: nil, default_processor_version: nil) + # Pass arguments to `set_default_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default + # version. + # @param default_processor_version [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use + # as default. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new + # + # # Call the set_default_processor_version method. + # result = client.set_default_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def set_default_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_default_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.processor + header_params["processor"] = request.processor + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_default_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_default_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :set_default_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Send a document for Human Review. The input document should be processed by + # the specified processor. + # + # @overload review_document(request, options = nil) + # Pass arguments to `review_document` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload review_document(inline_document: nil, human_review_config: nil, document: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) + # Pass arguments to `review_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # An inline document proto. + # @param human_review_config [::String] + # Required. The resource name of the HumanReviewConfig that the document will + # be reviewed with. + # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] + # The document that needs human review. + # @param enable_schema_validation [::Boolean] + # Whether the validation should be performed on the ad-hoc review request. + # @param priority [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] + # The document schema of the human review task. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new + # + # # Call the review_document method. + # result = client.review_document request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def review_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.review_document.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.human_review_config + header_params["human_review_config"] = request.human_review_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.review_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.review_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :review_document, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + # + # @overload evaluate_processor_version(request, options = nil) + # Pass arguments to `evaluate_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil) + # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor_version [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] + # Optional. The documents used in the evaluation. If unspecified, use the + # processor's dataset as evaluation input. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + # + # # Call the evaluate_processor_version method. + # result = client.evaluate_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def evaluate_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.evaluate_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.processor_version + header_params["processor_version"] = request.processor_version + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.evaluate_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a specific evaluation. + # + # @overload get_evaluation(request, options = nil) + # Pass arguments to `get_evaluation` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_evaluation(name: nil) + # Pass arguments to `get_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p result + # + def get_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_evaluation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a set of evaluations for a given processor version. + # + # @overload list_evaluations(request, options = nil) + # Pass arguments to `list_evaluations` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_evaluations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # list evaluations for. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param page_size [::Integer] + # The standard list page size. + # If unspecified, at most 5 evaluations will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous `ListEvaluations` call. + # Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + # + # # Call the list_evaluations method. + # result = client.list_evaluations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p response + # end + # + def list_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_evaluations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DocumentProcessorService API. + # + # This class represents the configuration for DocumentProcessorService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # process_document to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.process_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "documentai.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration 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-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb new file mode 100644 index 000000000000..75ae5a98a886 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Credentials for the DocumentProcessorService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DOCUMENT_AI_CREDENTIALS", + "DOCUMENT_AI_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DOCUMENT_AI_CREDENTIALS_JSON", + "DOCUMENT_AI_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb new file mode 100644 index 000000000000..8cccabfc0815 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb @@ -0,0 +1,770 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the DocumentProcessorService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentProcessorService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + + # 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 all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Longrunning::Operation. + # p response + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"documentai.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "documentai.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb new file mode 100644 index 000000000000..bd199612e369 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Path helper methods for the DocumentProcessorService API. + module Paths + ## + # Create a fully-qualified Evaluation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # @param processor_version [String] + # @param evaluation [String] + # + # @return [::String] + def evaluation_path project:, location:, processor:, processor_version:, evaluation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" + raise ::ArgumentError, "processor_version cannot contain /" if processor_version.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}/evaluations/#{evaluation}" + end + + ## + # Create a fully-qualified HumanReviewConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # + # @return [::String] + def human_review_config_path project:, location:, processor: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/humanReviewConfig" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Processor resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # + # @return [::String] + def processor_path project:, location:, processor: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}" + end + + ## + # Create a fully-qualified ProcessorType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processorTypes/{processor_type}` + # + # @param project [String] + # @param location [String] + # @param processor_type [String] + # + # @return [::String] + def processor_type_path project:, location:, processor_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processorTypes/#{processor_type}" + end + + ## + # Create a fully-qualified ProcessorVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # @param processor_version [String] + # + # @return [::String] + def processor_version_path project:, location:, processor:, processor_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb new file mode 100644 index 000000000000..9b6a7dd5f7d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb new file mode 100644 index 000000000000..acd8965b3081 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb @@ -0,0 +1,24 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/barcode.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/barcode.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.Barcode" do + optional :format, :string, 1 + optional :value_format, :string, 2 + optional :raw_value, :string, 3 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Barcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Barcode").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb new file mode 100644 index 000000000000..5ce071b07181 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document_io.proto + +require 'google/protobuf' + +require 'google/protobuf/field_mask_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/document_io.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.RawDocument" do + optional :content, :bytes, 1 + optional :mime_type, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.GcsDocument" do + optional :gcs_uri, :string, 1 + optional :mime_type, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.GcsDocuments" do + repeated :documents, :message, 1, "google.cloud.documentai.v1beta3.GcsDocument" + end + add_message "google.cloud.documentai.v1beta3.GcsPrefix" do + optional :gcs_uri_prefix, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" do + oneof :source do + optional :gcs_prefix, :message, 1, "google.cloud.documentai.v1beta3.GcsPrefix" + optional :gcs_documents, :message, 2, "google.cloud.documentai.v1beta3.GcsDocuments" + end + end + add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig" do + oneof :destination do + optional :gcs_output_config, :message, 1, "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig" + end + end + add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig" do + optional :gcs_uri, :string, 1 + optional :field_mask, :message, 2, "google.protobuf.FieldMask" + optional :sharding_config, :message, 3, "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig" + end + add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig" do + optional :pages_per_shard, :int32, 1 + optional :pages_overlap, :int32, 2 + end + add_message "google.cloud.documentai.v1beta3.OcrConfig" do + optional :enable_native_pdf_parsing, :bool, 3 + repeated :advanced_ocr_options, :string, 5 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + RawDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RawDocument").msgclass + GcsDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocument").msgclass + GcsDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocuments").msgclass + GcsPrefix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsPrefix").msgclass + BatchDocumentsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDocumentsInputConfig").msgclass + DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig").msgclass + DocumentOutputConfig::GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig").msgclass + DocumentOutputConfig::GcsOutputConfig::ShardingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig").msgclass + OcrConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb new file mode 100644 index 000000000000..daeabd9479e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb @@ -0,0 +1,332 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/documentai/v1beta3/barcode_pb' +require 'google/cloud/documentai/v1beta3/geometry_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/color_pb' +require 'google/type/date_pb' +require 'google/type/datetime_pb' +require 'google/type/money_pb' +require 'google/type/postal_address_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/document.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.Document" do + optional :mime_type, :string, 3 + optional :text, :string, 4 + repeated :text_styles, :message, 5, "google.cloud.documentai.v1beta3.Document.Style" + repeated :pages, :message, 6, "google.cloud.documentai.v1beta3.Document.Page" + repeated :entities, :message, 7, "google.cloud.documentai.v1beta3.Document.Entity" + repeated :entity_relations, :message, 8, "google.cloud.documentai.v1beta3.Document.EntityRelation" + repeated :text_changes, :message, 14, "google.cloud.documentai.v1beta3.Document.TextChange" + optional :shard_info, :message, 9, "google.cloud.documentai.v1beta3.Document.ShardInfo" + optional :error, :message, 10, "google.rpc.Status" + repeated :revisions, :message, 13, "google.cloud.documentai.v1beta3.Document.Revision" + oneof :source do + optional :uri, :string, 1 + optional :content, :bytes, 2 + end + end + add_message "google.cloud.documentai.v1beta3.Document.ShardInfo" do + optional :shard_index, :int64, 1 + optional :shard_count, :int64, 2 + optional :text_offset, :int64, 3 + end + add_message "google.cloud.documentai.v1beta3.Document.Style" do + optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" + optional :color, :message, 2, "google.type.Color" + optional :background_color, :message, 3, "google.type.Color" + optional :font_weight, :string, 4 + optional :text_style, :string, 5 + optional :text_decoration, :string, 6 + optional :font_size, :message, 7, "google.cloud.documentai.v1beta3.Document.Style.FontSize" + optional :font_family, :string, 8 + end + add_message "google.cloud.documentai.v1beta3.Document.Style.FontSize" do + optional :size, :float, 1 + optional :unit, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.Document.Page" do + optional :page_number, :int32, 1 + optional :image, :message, 13, "google.cloud.documentai.v1beta3.Document.Page.Image" + repeated :transforms, :message, 14, "google.cloud.documentai.v1beta3.Document.Page.Matrix" + optional :dimension, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Dimension" + optional :layout, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.Layout" + repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + repeated :blocks, :message, 5, "google.cloud.documentai.v1beta3.Document.Page.Block" + repeated :paragraphs, :message, 6, "google.cloud.documentai.v1beta3.Document.Page.Paragraph" + repeated :lines, :message, 7, "google.cloud.documentai.v1beta3.Document.Page.Line" + repeated :tokens, :message, 8, "google.cloud.documentai.v1beta3.Document.Page.Token" + repeated :visual_elements, :message, 9, "google.cloud.documentai.v1beta3.Document.Page.VisualElement" + repeated :tables, :message, 10, "google.cloud.documentai.v1beta3.Document.Page.Table" + repeated :form_fields, :message, 11, "google.cloud.documentai.v1beta3.Document.Page.FormField" + repeated :symbols, :message, 12, "google.cloud.documentai.v1beta3.Document.Page.Symbol" + repeated :detected_barcodes, :message, 15, "google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode" + optional :image_quality_scores, :message, 17, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores" + optional :provenance, :message, 16, "google.cloud.documentai.v1beta3.Document.Provenance" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Dimension" do + optional :width, :float, 1 + optional :height, :float, 2 + optional :unit, :string, 3 + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Image" do + optional :content, :bytes, 1 + optional :mime_type, :string, 2 + optional :width, :int32, 3 + optional :height, :int32, 4 + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Matrix" do + optional :rows, :int32, 1 + optional :cols, :int32, 2 + optional :type, :int32, 3 + optional :data, :bytes, 4 + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Layout" do + optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" + optional :confidence, :float, 2 + optional :bounding_poly, :message, 3, "google.cloud.documentai.v1beta3.BoundingPoly" + optional :orientation, :enum, 4, "google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation" + end + add_enum "google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation" do + value :ORIENTATION_UNSPECIFIED, 0 + value :PAGE_UP, 1 + value :PAGE_RIGHT, 2 + value :PAGE_DOWN, 3 + value :PAGE_LEFT, 4 + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Block" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + optional :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Paragraph" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + optional :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Line" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + optional :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Token" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + optional :detected_break, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak" + repeated :detected_languages, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + optional :provenance, :message, 4, "google.cloud.documentai.v1beta3.Document.Provenance" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak" do + optional :type, :enum, 1, "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type" + end + add_enum "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type" do + value :TYPE_UNSPECIFIED, 0 + value :SPACE, 1 + value :WIDE_SPACE, 2 + value :HYPHEN, 3 + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Symbol" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.VisualElement" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + optional :type, :string, 2 + repeated :detected_languages, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Table" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + repeated :header_rows, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" + repeated :body_rows, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" + repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + optional :provenance, :message, 5, "google.cloud.documentai.v1beta3.Document.Provenance" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" do + repeated :cells, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Table.TableCell" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.Table.TableCell" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + optional :row_span, :int32, 2 + optional :col_span, :int32, 3 + repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.FormField" do + optional :field_name, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + optional :field_value, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Layout" + repeated :name_detected_languages, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + repeated :value_detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + optional :value_type, :string, 5 + optional :corrected_key_text, :string, 6 + optional :corrected_value_text, :string, 7 + optional :provenance, :message, 8, "google.cloud.documentai.v1beta3.Document.Provenance" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode" do + optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" + optional :barcode, :message, 2, "google.cloud.documentai.v1beta3.Barcode" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" do + optional :language_code, :string, 1 + optional :confidence, :float, 2 + end + add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores" do + optional :quality_score, :float, 1 + repeated :detected_defects, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect" do + optional :type, :string, 1 + optional :confidence, :float, 2 + end + add_message "google.cloud.documentai.v1beta3.Document.Entity" do + optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" + optional :type, :string, 2 + optional :mention_text, :string, 3 + optional :mention_id, :string, 4 + optional :confidence, :float, 5 + optional :page_anchor, :message, 6, "google.cloud.documentai.v1beta3.Document.PageAnchor" + optional :id, :string, 7 + optional :normalized_value, :message, 9, "google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue" + repeated :properties, :message, 10, "google.cloud.documentai.v1beta3.Document.Entity" + optional :provenance, :message, 11, "google.cloud.documentai.v1beta3.Document.Provenance" + optional :redacted, :bool, 12 + end + add_message "google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue" do + optional :text, :string, 1 + oneof :structured_value do + optional :money_value, :message, 2, "google.type.Money" + optional :date_value, :message, 3, "google.type.Date" + optional :datetime_value, :message, 4, "google.type.DateTime" + optional :address_value, :message, 5, "google.type.PostalAddress" + optional :boolean_value, :bool, 6 + optional :integer_value, :int32, 7 + optional :float_value, :float, 8 + end + end + add_message "google.cloud.documentai.v1beta3.Document.EntityRelation" do + optional :subject_id, :string, 1 + optional :object_id, :string, 2 + optional :relation, :string, 3 + end + add_message "google.cloud.documentai.v1beta3.Document.TextAnchor" do + repeated :text_segments, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment" + optional :content, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment" do + optional :start_index, :int64, 1 + optional :end_index, :int64, 2 + end + add_message "google.cloud.documentai.v1beta3.Document.PageAnchor" do + repeated :page_refs, :message, 1, "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef" + end + add_message "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef" do + optional :page, :int64, 1 + optional :layout_type, :enum, 2, "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType" + optional :layout_id, :string, 3 + optional :bounding_poly, :message, 4, "google.cloud.documentai.v1beta3.BoundingPoly" + optional :confidence, :float, 5 + end + add_enum "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType" do + value :LAYOUT_TYPE_UNSPECIFIED, 0 + value :BLOCK, 1 + value :PARAGRAPH, 2 + value :LINE, 3 + value :TOKEN, 4 + value :VISUAL_ELEMENT, 5 + value :TABLE, 6 + value :FORM_FIELD, 7 + end + add_message "google.cloud.documentai.v1beta3.Document.Provenance" do + optional :revision, :int32, 1 + optional :id, :int32, 2 + repeated :parents, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance.Parent" + optional :type, :enum, 4, "google.cloud.documentai.v1beta3.Document.Provenance.OperationType" + end + add_message "google.cloud.documentai.v1beta3.Document.Provenance.Parent" do + optional :revision, :int32, 1 + optional :index, :int32, 3 + optional :id, :int32, 2 + end + add_enum "google.cloud.documentai.v1beta3.Document.Provenance.OperationType" do + value :OPERATION_TYPE_UNSPECIFIED, 0 + value :ADD, 1 + value :REMOVE, 2 + value :REPLACE, 3 + value :EVAL_REQUESTED, 4 + value :EVAL_APPROVED, 5 + value :EVAL_SKIPPED, 6 + end + add_message "google.cloud.documentai.v1beta3.Document.Revision" do + optional :id, :string, 1 + repeated :parent, :int32, 2 + repeated :parent_ids, :string, 7 + optional :create_time, :message, 3, "google.protobuf.Timestamp" + optional :human_review, :message, 6, "google.cloud.documentai.v1beta3.Document.Revision.HumanReview" + oneof :source do + optional :agent, :string, 4 + optional :processor, :string, 5 + end + end + add_message "google.cloud.documentai.v1beta3.Document.Revision.HumanReview" do + optional :state, :string, 1 + optional :state_message, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.Document.TextChange" do + optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" + optional :changed_text, :string, 2 + repeated :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document").msgclass + Document::ShardInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.ShardInfo").msgclass + Document::Style = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style").msgclass + Document::Style::FontSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style.FontSize").msgclass + Document::Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page").msgclass + Document::Page::Dimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Dimension").msgclass + Document::Page::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Image").msgclass + Document::Page::Matrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Matrix").msgclass + Document::Page::Layout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout").msgclass + Document::Page::Layout::Orientation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation").enummodule + Document::Page::Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Block").msgclass + Document::Page::Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Paragraph").msgclass + Document::Page::Line = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Line").msgclass + Document::Page::Token = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token").msgclass + Document::Page::Token::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak").msgclass + Document::Page::Token::DetectedBreak::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type").enummodule + Document::Page::Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Symbol").msgclass + Document::Page::VisualElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.VisualElement").msgclass + Document::Page::Table = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table").msgclass + Document::Page::Table::TableRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableRow").msgclass + Document::Page::Table::TableCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableCell").msgclass + Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.FormField").msgclass + Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode").msgclass + Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage").msgclass + Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores").msgclass + Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect").msgclass + Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity").msgclass + Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue").msgclass + Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.EntityRelation").msgclass + Document::TextAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor").msgclass + Document::TextAnchor::TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment").msgclass + Document::PageAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor").msgclass + Document::PageAnchor::PageRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef").msgclass + Document::PageAnchor::PageRef::LayoutType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType").enummodule + Document::Provenance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance").msgclass + Document::Provenance::Parent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.Parent").msgclass + Document::Provenance::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.OperationType").enummodule + Document::Revision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision").msgclass + Document::Revision::HumanReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision.HumanReview").msgclass + Document::TextChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextChange").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb new file mode 100644 index 000000000000..5bd3f7760f63 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb @@ -0,0 +1,352 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document_processor_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/documentai/v1beta3/document_pb' +require 'google/cloud/documentai/v1beta3/document_io_pb' +require 'google/cloud/documentai/v1beta3/document_schema_pb' +require 'google/cloud/documentai/v1beta3/evaluation_pb' +require 'google/cloud/documentai/v1beta3/operation_metadata_pb' +require 'google/cloud/documentai/v1beta3/processor_pb' +require 'google/cloud/documentai/v1beta3/processor_type_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/document_processor_service.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.ProcessOptions" do + optional :ocr_config, :message, 1, "google.cloud.documentai.v1beta3.OcrConfig" + end + add_message "google.cloud.documentai.v1beta3.ProcessRequest" do + optional :name, :string, 1 + optional :document, :message, 2, "google.cloud.documentai.v1beta3.Document" + optional :skip_human_review, :bool, 3 + optional :field_mask, :message, 6, "google.protobuf.FieldMask" + optional :process_options, :message, 7, "google.cloud.documentai.v1beta3.ProcessOptions" + oneof :source do + optional :inline_document, :message, 4, "google.cloud.documentai.v1beta3.Document" + optional :raw_document, :message, 5, "google.cloud.documentai.v1beta3.RawDocument" + end + end + add_message "google.cloud.documentai.v1beta3.HumanReviewStatus" do + optional :state, :enum, 1, "google.cloud.documentai.v1beta3.HumanReviewStatus.State" + optional :state_message, :string, 2 + optional :human_review_operation, :string, 3 + end + add_enum "google.cloud.documentai.v1beta3.HumanReviewStatus.State" do + value :STATE_UNSPECIFIED, 0 + value :SKIPPED, 1 + value :VALIDATION_PASSED, 2 + value :IN_PROGRESS, 3 + value :ERROR, 4 + end + add_message "google.cloud.documentai.v1beta3.ProcessResponse" do + optional :document, :message, 1, "google.cloud.documentai.v1beta3.Document" + optional :human_review_operation, :string, 2 + optional :human_review_status, :message, 3, "google.cloud.documentai.v1beta3.HumanReviewStatus" + end + add_message "google.cloud.documentai.v1beta3.BatchProcessRequest" do + optional :name, :string, 1 + repeated :input_configs, :message, 2, "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig" + optional :output_config, :message, 3, "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig" + optional :input_documents, :message, 5, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + optional :document_output_config, :message, 6, "google.cloud.documentai.v1beta3.DocumentOutputConfig" + optional :skip_human_review, :bool, 4 + optional :process_options, :message, 7, "google.cloud.documentai.v1beta3.ProcessOptions" + end + add_message "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig" do + optional :gcs_source, :string, 1 + optional :mime_type, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig" do + optional :gcs_destination, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.BatchProcessResponse" do + end + add_message "google.cloud.documentai.v1beta3.BatchProcessMetadata" do + optional :state, :enum, 1, "google.cloud.documentai.v1beta3.BatchProcessMetadata.State" + optional :state_message, :string, 2 + optional :create_time, :message, 3, "google.protobuf.Timestamp" + optional :update_time, :message, 4, "google.protobuf.Timestamp" + repeated :individual_process_statuses, :message, 5, "google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus" + end + add_message "google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus" do + optional :input_gcs_source, :string, 1 + optional :status, :message, 2, "google.rpc.Status" + optional :output_gcs_destination, :string, 3 + optional :human_review_operation, :string, 4 + optional :human_review_status, :message, 5, "google.cloud.documentai.v1beta3.HumanReviewStatus" + end + add_enum "google.cloud.documentai.v1beta3.BatchProcessMetadata.State" do + value :STATE_UNSPECIFIED, 0 + value :WAITING, 1 + value :RUNNING, 2 + value :SUCCEEDED, 3 + value :CANCELLING, 4 + value :CANCELLED, 5 + value :FAILED, 6 + end + add_message "google.cloud.documentai.v1beta3.FetchProcessorTypesRequest" do + optional :parent, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.FetchProcessorTypesResponse" do + repeated :processor_types, :message, 1, "google.cloud.documentai.v1beta3.ProcessorType" + end + add_message "google.cloud.documentai.v1beta3.ListProcessorTypesRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + end + add_message "google.cloud.documentai.v1beta3.ListProcessorTypesResponse" do + repeated :processor_types, :message, 1, "google.cloud.documentai.v1beta3.ProcessorType" + optional :next_page_token, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.ListProcessorsRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + end + add_message "google.cloud.documentai.v1beta3.ListProcessorsResponse" do + repeated :processors, :message, 1, "google.cloud.documentai.v1beta3.Processor" + optional :next_page_token, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.GetProcessorTypeRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.GetProcessorRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.GetProcessorVersionRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.ListProcessorVersionsRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + end + add_message "google.cloud.documentai.v1beta3.ListProcessorVersionsResponse" do + repeated :processor_versions, :message, 1, "google.cloud.documentai.v1beta3.ProcessorVersion" + optional :next_page_token, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.DeployProcessorVersionRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.DeployProcessorVersionResponse" do + end + add_message "google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse" do + end + add_message "google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.CreateProcessorRequest" do + optional :parent, :string, 1 + optional :processor, :message, 2, "google.cloud.documentai.v1beta3.Processor" + end + add_message "google.cloud.documentai.v1beta3.DeleteProcessorRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.DeleteProcessorMetadata" do + optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.EnableProcessorRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.EnableProcessorResponse" do + end + add_message "google.cloud.documentai.v1beta3.EnableProcessorMetadata" do + optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.DisableProcessorRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.DisableProcessorResponse" do + end + add_message "google.cloud.documentai.v1beta3.DisableProcessorMetadata" do + optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest" do + optional :processor, :string, 1 + optional :default_processor_version, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse" do + end + add_message "google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest" do + optional :parent, :string, 1 + optional :processor_version, :message, 2, "google.cloud.documentai.v1beta3.ProcessorVersion" + optional :document_schema, :message, 10, "google.cloud.documentai.v1beta3.DocumentSchema" + optional :input_data, :message, 4, "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" + optional :base_processor_version, :string, 8 + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" do + optional :training_documents, :message, 3, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + optional :test_documents, :message, 4, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionResponse" do + optional :processor_version, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + optional :training_dataset_validation, :message, 2, "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" + optional :test_dataset_validation, :message, 3, "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" do + optional :document_error_count, :int32, 3 + optional :dataset_error_count, :int32, 4 + repeated :document_errors, :message, 1, "google.rpc.Status" + repeated :dataset_errors, :message, 2, "google.rpc.Status" + end + add_message "google.cloud.documentai.v1beta3.ReviewDocumentRequest" do + optional :human_review_config, :string, 1 + optional :document, :message, 2, "google.cloud.documentai.v1beta3.Document" + optional :enable_schema_validation, :bool, 3 + optional :priority, :enum, 5, "google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority" + optional :document_schema, :message, 6, "google.cloud.documentai.v1beta3.DocumentSchema" + oneof :source do + optional :inline_document, :message, 4, "google.cloud.documentai.v1beta3.Document" + end + end + add_enum "google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority" do + value :DEFAULT, 0 + value :URGENT, 1 + end + add_message "google.cloud.documentai.v1beta3.ReviewDocumentResponse" do + optional :gcs_destination, :string, 1 + optional :state, :enum, 2, "google.cloud.documentai.v1beta3.ReviewDocumentResponse.State" + optional :rejection_reason, :string, 3 + end + add_enum "google.cloud.documentai.v1beta3.ReviewDocumentResponse.State" do + value :STATE_UNSPECIFIED, 0 + value :REJECTED, 1 + value :SUCCEEDED, 2 + end + add_message "google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata" do + optional :state, :enum, 1, "google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State" + optional :state_message, :string, 2 + optional :create_time, :message, 3, "google.protobuf.Timestamp" + optional :update_time, :message, 4, "google.protobuf.Timestamp" + optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + optional :question_id, :string, 6 + end + add_enum "google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State" do + value :STATE_UNSPECIFIED, 0 + value :RUNNING, 1 + value :CANCELLING, 2 + value :SUCCEEDED, 3 + value :FAILED, 4 + value :CANCELLED, 5 + end + add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest" do + optional :processor_version, :string, 1 + optional :evaluation_documents, :message, 3, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + end + add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse" do + optional :evaluation, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.GetEvaluationRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.ListEvaluationsRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + end + add_message "google.cloud.documentai.v1beta3.ListEvaluationsResponse" do + repeated :evaluations, :message, 1, "google.cloud.documentai.v1beta3.Evaluation" + optional :next_page_token, :string, 2 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + ProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions").msgclass + ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessRequest").msgclass + HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus").msgclass + HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus.State").enummodule + ProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessResponse").msgclass + BatchProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest").msgclass + BatchProcessRequest::BatchInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig").msgclass + BatchProcessRequest::BatchOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig").msgclass + BatchProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessResponse").msgclass + BatchProcessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata").msgclass + BatchProcessMetadata::IndividualProcessStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus").msgclass + BatchProcessMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.State").enummodule + FetchProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesRequest").msgclass + FetchProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesResponse").msgclass + ListProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesRequest").msgclass + ListProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesResponse").msgclass + ListProcessorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsRequest").msgclass + ListProcessorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsResponse").msgclass + GetProcessorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorTypeRequest").msgclass + GetProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorRequest").msgclass + GetProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorVersionRequest").msgclass + ListProcessorVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsRequest").msgclass + ListProcessorVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsResponse").msgclass + DeleteProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest").msgclass + DeleteProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata").msgclass + DeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionRequest").msgclass + DeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionResponse").msgclass + DeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata").msgclass + UndeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest").msgclass + UndeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse").msgclass + UndeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata").msgclass + CreateProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CreateProcessorRequest").msgclass + DeleteProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorRequest").msgclass + DeleteProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorMetadata").msgclass + EnableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorRequest").msgclass + EnableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorResponse").msgclass + EnableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorMetadata").msgclass + DisableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorRequest").msgclass + DisableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorResponse").msgclass + DisableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorMetadata").msgclass + SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest").msgclass + SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse").msgclass + SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata").msgclass + TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest").msgclass + TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData").msgclass + TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionResponse").msgclass + TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata").msgclass + TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation").msgclass + ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest").msgclass + ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority").enummodule + ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse").msgclass + ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse.State").enummodule + ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata").msgclass + ReviewDocumentOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State").enummodule + EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest").msgclass + EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata").msgclass + EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse").msgclass + GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetEvaluationRequest").msgclass + ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsRequest").msgclass + ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb new file mode 100644 index 000000000000..1fc786835088 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb @@ -0,0 +1,103 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/documentai/v1beta3/document_processor_service.proto for package 'Google.Cloud.DocumentAI.V1beta3' +# Original file comments: +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/documentai/v1beta3/document_processor_service_pb' + +module Google + module Cloud + module DocumentAI + module V1beta3 + module DocumentProcessorService + # Service to call Cloud DocumentAI to process documents according to the + # processor's definition. Processors are built using state-of-the-art Google + # AI such as natural language, computer vision, and translation to extract + # structured information from unstructured or semi-structured documents. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.documentai.v1beta3.DocumentProcessorService' + + # Processes a single document. + rpc :ProcessDocument, ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse + # LRO endpoint to batch process many documents. The output is written + # to Cloud Storage as JSON in the [Document] format. + rpc :BatchProcessDocuments, ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Google::Longrunning::Operation + # Fetches processor types. Note that we do not use ListProcessorTypes here + # because it is not paginated. + rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse + # Lists the processor types that exist. + rpc :ListProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse + # Gets a processor type detail. + rpc :GetProcessorType, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorType + # Lists all processors which belong to this project. + rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse + # Gets a processor detail. + rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor + # Trains a new processor version. + # Operation metadata is returned as + # cloud_documentai_core.TrainProcessorVersionMetadata. + rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Google::Longrunning::Operation + # Gets a processor version detail. + rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion + # Lists all versions of a processor. + rpc :ListProcessorVersions, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse + # Deletes the processor version, all artifacts under the processor version + # will be deleted. + rpc :DeleteProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Google::Longrunning::Operation + # Deploys the processor version. + rpc :DeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Google::Longrunning::Operation + # Undeploys the processor version. + rpc :UndeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Google::Longrunning::Operation + # Creates a processor from the type processor that the user chose. + # The processor will be at "ENABLED" state by default after its creation. + rpc :CreateProcessor, ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor + # Deletes the processor, unloads all deployed model artifacts if it was + # enabled and then deletes all artifacts associated with this processor. + rpc :DeleteProcessor, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Google::Longrunning::Operation + # Enables a processor + rpc :EnableProcessor, ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Google::Longrunning::Operation + # Disables a processor + rpc :DisableProcessor, ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Google::Longrunning::Operation + # Set the default (active) version of a + # [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in + # [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] + # and + # [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. + rpc :SetDefaultProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Google::Longrunning::Operation + # Send a document for Human Review. The input document should be processed by + # the specified processor. + rpc :ReviewDocument, ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Google::Longrunning::Operation + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation + # Retrieves a specific evaluation. + rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1beta3::Evaluation + # Retrieves a set of evaluations for a given processor version. + rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb new file mode 100644 index 000000000000..0c49482c6eb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb @@ -0,0 +1,60 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/document_schema.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/document_schema.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.DocumentSchema" do + optional :display_name, :string, 1 + optional :description, :string, 2 + repeated :entity_types, :message, 3, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType" + optional :metadata, :message, 4, "google.cloud.documentai.v1beta3.DocumentSchema.Metadata" + end + add_message "google.cloud.documentai.v1beta3.DocumentSchema.EntityType" do + optional :display_name, :string, 13 + optional :name, :string, 1 + repeated :base_types, :string, 2 + repeated :properties, :message, 6, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property" + oneof :value_source do + optional :enum_values, :message, 14, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues" + end + end + add_message "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues" do + repeated :values, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property" do + optional :name, :string, 1 + optional :value_type, :string, 2 + optional :occurrence_type, :enum, 3, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType" + end + add_enum "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType" do + value :OCCURRENCE_TYPE_UNSPECIFIED, 0 + value :OPTIONAL_ONCE, 1 + value :OPTIONAL_MULTIPLE, 2 + value :REQUIRED_ONCE, 3 + value :REQUIRED_MULTIPLE, 4 + end + add_message "google.cloud.documentai.v1beta3.DocumentSchema.Metadata" do + optional :document_splitter, :bool, 1 + optional :document_allow_multiple_labels, :bool, 2 + optional :prefixed_naming_on_properties, :bool, 6 + optional :skip_naming_validation, :bool, 7 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + DocumentSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema").msgclass + DocumentSchema::EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType").msgclass + DocumentSchema::EntityType::EnumValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues").msgclass + DocumentSchema::EntityType::Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property").msgclass + DocumentSchema::EntityType::Property::OccurrenceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType").enummodule + DocumentSchema::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.Metadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb new file mode 100644 index 000000000000..a0aacac71687 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/evaluation.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/evaluation.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.Evaluation" do + optional :name, :string, 1 + optional :create_time, :message, 2, "google.protobuf.Timestamp" + optional :document_counters, :message, 5, "google.cloud.documentai.v1beta3.Evaluation.Counters" + optional :all_entities_metrics, :message, 3, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" + map :entity_metrics, :string, :message, 4, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" + optional :kms_key_name, :string, 6 + optional :kms_key_version_name, :string, 7 + end + add_message "google.cloud.documentai.v1beta3.Evaluation.Counters" do + optional :input_documents_count, :int32, 1 + optional :invalid_documents_count, :int32, 2 + optional :failed_documents_count, :int32, 3 + optional :evaluated_documents_count, :int32, 4 + end + add_message "google.cloud.documentai.v1beta3.Evaluation.Metrics" do + optional :precision, :float, 1 + optional :recall, :float, 2 + optional :f1_score, :float, 3 + optional :predicted_occurrences_count, :int32, 4 + optional :ground_truth_occurrences_count, :int32, 5 + optional :predicted_document_count, :int32, 10 + optional :ground_truth_document_count, :int32, 11 + optional :true_positives_count, :int32, 6 + optional :false_positives_count, :int32, 7 + optional :false_negatives_count, :int32, 8 + optional :total_documents_count, :int32, 9 + end + add_message "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" do + optional :confidence_level, :float, 1 + optional :metrics, :message, 2, "google.cloud.documentai.v1beta3.Evaluation.Metrics" + end + add_message "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" do + repeated :confidence_level_metrics, :message, 1, "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" + repeated :confidence_level_metrics_exact, :message, 4, "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" + optional :auprc, :float, 2 + optional :estimated_calibration_error, :float, 3 + optional :auprc_exact, :float, 5 + optional :estimated_calibration_error_exact, :float, 6 + optional :metrics_type, :enum, 7, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType" + end + add_enum "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType" do + value :METRICS_TYPE_UNSPECIFIED, 0 + value :AGGREGATE, 1 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation").msgclass + Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Counters").msgclass + Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Metrics").msgclass + Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics").msgclass + Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics").msgclass + Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb new file mode 100644 index 000000000000..8f0daac3bc3d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb @@ -0,0 +1,33 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/geometry.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/geometry.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.Vertex" do + optional :x, :int32, 1 + optional :y, :int32, 2 + end + add_message "google.cloud.documentai.v1beta3.NormalizedVertex" do + optional :x, :float, 1 + optional :y, :float, 2 + end + add_message "google.cloud.documentai.v1beta3.BoundingPoly" do + repeated :vertices, :message, 1, "google.cloud.documentai.v1beta3.Vertex" + repeated :normalized_vertices, :message, 2, "google.cloud.documentai.v1beta3.NormalizedVertex" + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Vertex").msgclass + NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.NormalizedVertex").msgclass + BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BoundingPoly").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb new file mode 100644 index 000000000000..d63483a7c733 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb @@ -0,0 +1,37 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/operation_metadata.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/operation_metadata.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.CommonOperationMetadata" do + optional :state, :enum, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata.State" + optional :state_message, :string, 2 + optional :resource, :string, 5 + optional :create_time, :message, 3, "google.protobuf.Timestamp" + optional :update_time, :message, 4, "google.protobuf.Timestamp" + end + add_enum "google.cloud.documentai.v1beta3.CommonOperationMetadata.State" do + value :STATE_UNSPECIFIED, 0 + value :RUNNING, 1 + value :CANCELLING, 2 + value :SUCCEEDED, 3 + value :FAILED, 4 + value :CANCELLED, 5 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + CommonOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata").msgclass + CommonOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb new file mode 100644 index 000000000000..4989e6d25e9a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb @@ -0,0 +1,73 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/processor.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/documentai/v1beta3/document_schema_pb' +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/processor.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.ProcessorVersion" do + optional :name, :string, 1 + optional :display_name, :string, 2 + optional :document_schema, :message, 12, "google.cloud.documentai.v1beta3.DocumentSchema" + optional :state, :enum, 6, "google.cloud.documentai.v1beta3.ProcessorVersion.State" + optional :create_time, :message, 7, "google.protobuf.Timestamp" + optional :kms_key_name, :string, 9 + optional :kms_key_version_name, :string, 10 + optional :google_managed, :bool, 11 + optional :deprecation_info, :message, 13, "google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo" + end + add_message "google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo" do + optional :deprecation_time, :message, 1, "google.protobuf.Timestamp" + optional :replacement_processor_version, :string, 2 + end + add_enum "google.cloud.documentai.v1beta3.ProcessorVersion.State" do + value :STATE_UNSPECIFIED, 0 + value :DEPLOYED, 1 + value :DEPLOYING, 2 + value :UNDEPLOYED, 3 + value :UNDEPLOYING, 4 + value :CREATING, 5 + value :DELETING, 6 + value :FAILED, 7 + end + add_message "google.cloud.documentai.v1beta3.Processor" do + optional :name, :string, 1 + optional :type, :string, 2 + optional :display_name, :string, 3 + optional :state, :enum, 4, "google.cloud.documentai.v1beta3.Processor.State" + optional :default_processor_version, :string, 9 + optional :process_endpoint, :string, 6 + optional :create_time, :message, 7, "google.protobuf.Timestamp" + optional :kms_key_name, :string, 8 + end + add_enum "google.cloud.documentai.v1beta3.Processor.State" do + value :STATE_UNSPECIFIED, 0 + value :ENABLED, 1 + value :DISABLED, 2 + value :ENABLING, 3 + value :DISABLING, 4 + value :CREATING, 5 + value :FAILED, 6 + value :DELETING, 7 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + ProcessorVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion").msgclass + ProcessorVersion::DeprecationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo").msgclass + ProcessorVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.State").enummodule + Processor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor").msgclass + Processor::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb new file mode 100644 index 000000000000..abeaa4eb4964 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb @@ -0,0 +1,35 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/processor_type.proto + +require 'google/protobuf' + +require 'google/api/launch_stage_pb' +require 'google/api/resource_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/processor_type.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.ProcessorType" do + optional :name, :string, 1 + optional :type, :string, 2 + optional :category, :string, 3 + repeated :available_locations, :message, 4, "google.cloud.documentai.v1beta3.ProcessorType.LocationInfo" + optional :allow_creation, :bool, 6 + optional :launch_stage, :enum, 8, "google.api.LaunchStage" + repeated :sample_document_uris, :string, 9 + end + add_message "google.cloud.documentai.v1beta3.ProcessorType.LocationInfo" do + optional :location_id, :string, 1 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + ProcessorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType").msgclass + ProcessorType::LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType.LocationInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md new file mode 100644 index 000000000000..9445d5bb62be --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md @@ -0,0 +1,4 @@ +# Document AI V1beta3 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..763d8b39a50a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!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 place that API 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. + 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. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..ca8d9e343c83 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # 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 + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..173c5c85f5dc --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..522e181c4702 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same + # concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb new file mode 100644 index 000000000000..1d305e47d2b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Encodes the detailed information of a barcode. + # @!attribute [rw] format + # @return [::String] + # Format of a barcode. + # The supported formats are: + # + # - `CODE_128`: Code 128 type. + # - `CODE_39`: Code 39 type. + # - `CODE_93`: Code 93 type. + # - `CODABAR`: Codabar type. + # - `DATA_MATRIX`: 2D Data Matrix type. + # - `ITF`: ITF type. + # - `EAN_13`: EAN-13 type. + # - `EAN_8`: EAN-8 type. + # - `QR_CODE`: 2D QR code type. + # - `UPC_A`: UPC-A type. + # - `UPC_E`: UPC-E type. + # - `PDF417`: PDF417 type. + # - `AZTEC`: 2D Aztec code type. + # - `DATABAR`: GS1 DataBar code type. + # @!attribute [rw] value_format + # @return [::String] + # Value format describes the format of the value that a barcode + # encodes. + # The supported formats are: + # + # - `CONTACT_INFO`: Contact information. + # - `EMAIL`: Email address. + # - `ISBN`: ISBN identifier. + # - `PHONE`: Phone number. + # - `PRODUCT`: Product. + # - `SMS`: SMS message. + # - `TEXT`: Text string. + # - `URL`: URL address. + # - `WIFI`: Wifi information. + # - `GEO`: Geo-localization. + # - `CALENDAR_EVENT`: Calendar event. + # - `DRIVER_LICENSE`: Driver's license. + # @!attribute [rw] raw_value + # @return [::String] + # Raw value encoded in the barcode. + # For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + class Barcode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb new file mode 100644 index 000000000000..e1f285a84ad5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb @@ -0,0 +1,969 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Document represents the canonical document resource in Document AI. It is an + # interchange format that provides insights into documents and allows for + # collaboration between users and Document AI to iterate and optimize for + # quality. + # @!attribute [rw] uri + # @return [::String] + # Optional. Currently supports Google Cloud Storage URI of the form + # `gs://bucket_name/object_name`. Object versioning is not supported. + # See [Google Cloud Storage Request + # URIs](https://cloud.google.com/storage/docs/reference-uris) for more + # info. + # @!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 MIME type (also referred to as media type). For more + # information, see + # https://www.iana.org/assignments/media-types/media-types.xhtml. + # @!attribute [rw] text + # @return [::String] + # Optional. UTF-8 encoded text in reading order from the document. + # @!attribute [rw] text_styles + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Style>] + # Styles for the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] pages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page>] + # Visual page layout for the + # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] + # A list of entities detected on + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. For + # document shards, entities in this list may cross shard boundaries. + # @!attribute [rw] entity_relations + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::EntityRelation>] + # Placeholder. Relationship among + # {::Google::Cloud::DocumentAI::V1beta3::Document#entities Document.entities}. + # @!attribute [rw] text_changes + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextChange>] + # Placeholder. A list of text corrections made to + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. This is + # usually used for annotating corrections to OCR mistakes. Text changes for + # a given revision may not overlap with each other. + # @!attribute [rw] shard_info + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo] + # Information about the sharding if this document is sharded part of a larger + # document. If the document is not sharded, this message is not specified. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Any error that occurred while processing this document. + # @!attribute [rw] revisions + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Revision>] + # Placeholder. Revision history of this document. + class Document + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # For a large document, sharding may be performed to produce several + # document shards. Each document shard contains this field to detail which + # shard it is. + # @!attribute [rw] shard_index + # @return [::Integer] + # The 0-based index of this shard. + # @!attribute [rw] shard_count + # @return [::Integer] + # Total number of shards. + # @!attribute [rw] text_offset + # @return [::Integer] + # The index of the first character in + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text} in the + # overall document global text. + class ShardInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Annotation for common text style attributes. This adheres to CSS + # conventions as much as possible. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] color + # @return [::Google::Type::Color] + # Text color. + # @!attribute [rw] background_color + # @return [::Google::Type::Color] + # Text background color. + # @!attribute [rw] font_weight + # @return [::String] + # Font weight. Possible values are normal, bold, bolder, and lighter. + # https://www.w3schools.com/cssref/pr_font_weight.asp + # @!attribute [rw] text_style + # @return [::String] + # Text style. Possible values are normal, italic, and oblique. + # https://www.w3schools.com/cssref/pr_font_font-style.asp + # @!attribute [rw] text_decoration + # @return [::String] + # Text decoration. Follows CSS standard. + # + # https://www.w3schools.com/cssref/pr_text_text-decoration.asp + # @!attribute [rw] font_size + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Style::FontSize] + # Font size. + # @!attribute [rw] font_family + # @return [::String] + # Font family such as `Arial`, `Times New Roman`. + # https://www.w3schools.com/cssref/pr_font_font-family.asp + class Style + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Font size with unit. + # @!attribute [rw] size + # @return [::Float] + # Font size for the text. + # @!attribute [rw] unit + # @return [::String] + # Unit for the font size. Follows CSS naming (in, px, pt, etc.). + class FontSize + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A page in a {::Google::Cloud::DocumentAI::V1beta3::Document Document}. + # @!attribute [rw] page_number + # @return [::Integer] + # 1-based index for current + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page Page} in a parent + # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. Useful when a page + # is taken out of a {::Google::Cloud::DocumentAI::V1beta3::Document Document} + # for individual processing. + # @!attribute [rw] image + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Image] + # Rendered image for this page. This image is preprocessed to remove any + # skew, rotation, and distortions such that the annotation bounding boxes + # can be upright and axis-aligned. + # @!attribute [rw] transforms + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Matrix>] + # Transformation matrices that were applied to the original document image + # to produce + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#image Page.image}. + # @!attribute [rw] dimension + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Dimension] + # Physical dimension of the page. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the + # page. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] blocks + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block>] + # A list of visually detected text blocks on the page. + # A block has a set of lines (collected into paragraphs) that have a common + # line-spacing and orientation. + # @!attribute [rw] paragraphs + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph>] + # A list of visually detected text paragraphs on the page. + # A collection of lines that a human would perceive as a paragraph. + # @!attribute [rw] lines + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line>] + # A list of visually detected text lines on the page. + # A collection of tokens that a human would perceive as a line. + # @!attribute [rw] tokens + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token>] + # A list of visually detected tokens on the page. + # @!attribute [rw] visual_elements + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement>] + # A list of detected non-text visual elements e.g. checkbox, + # signature etc. on the page. + # @!attribute [rw] tables + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table>] + # A list of visually detected tables on the page. + # @!attribute [rw] form_fields + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField>] + # A list of visually detected form fields on the page. + # @!attribute [rw] symbols + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol>] + # A list of visually detected symbols on the page. + # @!attribute [rw] detected_barcodes + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode>] + # A list of detected barcodes. + # @!attribute [rw] image_quality_scores + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores] + # Image Quality Scores. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this page. + class Page + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Dimension for the page. + # @!attribute [rw] width + # @return [::Float] + # Page width. + # @!attribute [rw] height + # @return [::Float] + # Page height. + # @!attribute [rw] unit + # @return [::String] + # Dimension unit. + class Dimension + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Rendered image contents for this page. + # @!attribute [rw] content + # @return [::String] + # Raw byte content of the image. + # @!attribute [rw] mime_type + # @return [::String] + # Encoding mime type for the image. + # @!attribute [rw] width + # @return [::Integer] + # Width of the image in pixels. + # @!attribute [rw] height + # @return [::Integer] + # Height of the image in pixels. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Representation for transformation matrix, intended to be compatible and + # used with OpenCV format for image manipulation. + # @!attribute [rw] rows + # @return [::Integer] + # Number of rows in the matrix. + # @!attribute [rw] cols + # @return [::Integer] + # Number of columns in the matrix. + # @!attribute [rw] type + # @return [::Integer] + # This encodes information about what data type the matrix uses. + # For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + # of OpenCV primitive data types, please refer to + # https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + # @!attribute [rw] data + # @return [::String] + # The matrix data. + class Matrix + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Visual element describing a layout unit on a page. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the current + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} within + # context of the object this layout is for. e.g. confidence can be for a + # single token, a table, a visual element, etc. depending on context. + # Range `[0, 1]`. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] + # The bounding polygon for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. + # @!attribute [rw] orientation + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout::Orientation] + # Detected orientation for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. + class Layout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Detected human reading orientation. + module Orientation + # Unspecified orientation. + ORIENTATION_UNSPECIFIED = 0 + + # Orientation is aligned with page up. + PAGE_UP = 1 + + # Orientation is aligned with page right. + # Turn the head 90 degrees clockwise from upright to read. + PAGE_RIGHT = 2 + + # Orientation is aligned with page down. + # Turn the head 180 degrees from upright to read. + PAGE_DOWN = 3 + + # Orientation is aligned with page left. + # Turn the head 90 degrees counterclockwise from upright to read. + PAGE_LEFT = 4 + end + end + + # A block has a set of lines (collected into paragraphs) that have a + # common line-spacing and orientation. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block Block}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class Block + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of lines that a human would perceive as a paragraph. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph Paragraph}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class Paragraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of tokens that a human would perceive as a line. + # Does not cross column boundaries, can be horizontal, vertical, etc. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line Line}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class Line + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A detected token. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. + # @!attribute [rw] detected_break + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak] + # Detected break at the end of a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class Token + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Detected break at the end of a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. + # @!attribute [rw] type + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak::Type] + # Detected break type. + class DetectedBreak + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to denote the type of break found. + module Type + # Unspecified break type. + TYPE_UNSPECIFIED = 0 + + # A single whitespace. + SPACE = 1 + + # A wider whitespace. + WIDE_SPACE = 2 + + # A hyphen that indicates that a token has been split across lines. + HYPHEN = 3 + end + end + end + + # A detected symbol. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol Symbol}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + class Symbol + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detected non-text visual elements e.g. checkbox, signature etc. on the + # page. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. + # @!attribute [rw] type + # @return [::String] + # Type of the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + class VisualElement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A table representation similar to HTML table structure. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table Table}. + # @!attribute [rw] header_rows + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] + # Header rows of the table. + # @!attribute [rw] body_rows + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] + # Body rows of the table. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this table. + class Table + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A row of table cells. + # @!attribute [rw] cells + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell>] + # Cells that make up this row. + class TableRow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A cell representation inside the table. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell TableCell}. + # @!attribute [rw] row_span + # @return [::Integer] + # How many rows this cell spans. + # @!attribute [rw] col_span + # @return [::Integer] + # How many columns this cell spans. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages together with confidence. + class TableCell + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A form field detected on the page. + # @!attribute [rw] field_name + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} + # name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + # @!attribute [rw] field_value + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} + # value. + # @!attribute [rw] name_detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages for name together with confidence. + # @!attribute [rw] value_detected_languages + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] + # A list of detected languages for value together with confidence. + # @!attribute [rw] value_type + # @return [::String] + # If the value is non-textual, this field represents the type. Current + # valid values are: + # + # - blank (this indicates the `field_value` is normal text) + # - `unfilled_checkbox` + # - `filled_checkbox` + # @!attribute [rw] corrected_key_text + # @return [::String] + # Created for Labeling UI to export key text. + # If corrections were made to the text identified by the + # `field_name.text_anchor`, this field will contain the correction. + # @!attribute [rw] corrected_value_text + # @return [::String] + # Created for Labeling UI to export value text. + # If corrections were made to the text identified by the + # `field_value.text_anchor`, this field will contain the correction. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this annotation. + class FormField + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A detected barcode. + # @!attribute [rw] layout + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. + # @!attribute [rw] barcode + # @return [::Google::Cloud::DocumentAI::V1beta3::Barcode] + # Detailed barcode information of the + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. + class DetectedBarcode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detected language for a structural component. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as `en-US` or `sr-Latn`. For more + # information, see + # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected language. Range `[0, 1]`. + class DetectedLanguage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Image Quality Scores for the page image + # @!attribute [rw] quality_score + # @return [::Float] + # The overall quality score. Range `[0, 1]` where 1 is perfect quality. + # @!attribute [rw] detected_defects + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores::DetectedDefect>] + # A list of detected defects. + class ImageQualityScores + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Image Quality Defects + # @!attribute [rw] type + # @return [::String] + # Name of the defect type. Supported values are: + # + # - `quality/defect_blurry` + # - `quality/defect_noisy` + # - `quality/defect_dark` + # - `quality/defect_faint` + # - `quality/defect_text_too_small` + # - `quality/defect_document_cutoff` + # - `quality/defect_text_cutoff` + # - `quality/defect_glare` + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected defect. Range `[0, 1]` where 1 indicates + # strong confidence of that the defect exists. + class DetectedDefect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # An entity that could be a phrase in the text or a property that belongs to + # the document. It is a known entity type, such as a person, an organization, + # or location. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Optional. Provenance of the entity. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] type + # @return [::String] + # Required. Entity type from a schema e.g. `Address`. + # @!attribute [rw] mention_text + # @return [::String] + # Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. + # @!attribute [rw] mention_id + # @return [::String] + # Optional. Deprecated. Use `id` field instead. + # @!attribute [rw] confidence + # @return [::Float] + # Optional. Confidence of detected Schema entity. Range `[0, 1]`. + # @!attribute [rw] page_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor] + # Optional. Represents the provenance of this entity wrt. the location on + # the page where it was found. + # @!attribute [rw] id + # @return [::String] + # Optional. Canonical id. This will be a unique value in the entity list + # for this document. + # @!attribute [rw] normalized_value + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Entity::NormalizedValue] + # Optional. Normalized entity value. Absent if the extracted value could + # not be converted or the type (e.g. address) is not supported for certain + # parsers. This field is also only populated for certain supported document + # types. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] + # Optional. Entities can be nested to form a hierarchical data structure + # representing the content in the document. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # Optional. The history of this annotation. + # @!attribute [rw] redacted + # @return [::Boolean] + # Optional. Whether the entity will be redacted for de-identification + # purposes. + class Entity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parsed and normalized entity value. + # @!attribute [rw] money_value + # @return [::Google::Type::Money] + # Money value. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + # @!attribute [rw] date_value + # @return [::Google::Type::Date] + # Date value. Includes year, month, day. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + # @!attribute [rw] datetime_value + # @return [::Google::Type::DateTime] + # DateTime value. Includes date, time, and timezone. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + # @!attribute [rw] address_value + # @return [::Google::Type::PostalAddress] + # Postal address. See also: + # https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + # @!attribute [rw] boolean_value + # @return [::Boolean] + # Boolean value. Can be used for entities with binary values, or for + # checkboxes. + # @!attribute [rw] integer_value + # @return [::Integer] + # Integer value. + # @!attribute [rw] float_value + # @return [::Float] + # Float value. + # @!attribute [rw] text + # @return [::String] + # Optional. An optional field to store a normalized string. + # For some entity types, one of respective `structured_value` fields may + # also be populated. Also not all the types of `structured_value` will be + # normalized. For example, some processors may not generate `float` + # or `integer` normalized text by default. + # + # Below are sample formats mapped to structured values. + # + # - Money/Currency type (`money_value`) is in the ISO 4217 text format. + # - Date type (`date_value`) is in the ISO 8601 text format. + # - Datetime type (`datetime_value`) is in the ISO 8601 text format. + class NormalizedValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Relationship between + # {::Google::Cloud::DocumentAI::V1beta3::Document::Entity Entities}. + # @!attribute [rw] subject_id + # @return [::String] + # Subject entity id. + # @!attribute [rw] object_id + # @return [::String] + # Object entity id. + # @!attribute [rw] relation + # @return [::String] + # Relationship description. + class EntityRelation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Text reference indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] text_segments + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment>] + # The text segments from the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] content + # @return [::String] + # Contains the content of the text span so that users do + # not have to look it up in the text_segments. It is always + # populated for formFields. + class TextAnchor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A text segment in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. The + # indices may be out of bounds which indicate that the text extends into + # another document shard for large sharded documents. See + # {::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo#text_offset ShardInfo.text_offset} + # @!attribute [rw] start_index + # @return [::Integer] + # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} + # start UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + # @!attribute [rw] end_index + # @return [::Integer] + # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} + # half open end UTF-8 char index in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. + class TextSegment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Referencing the visual context of the entity in the + # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages}. Page + # anchors can be cross-page, consist of multiple bounding polygons and + # optionally reference specific layout element types. + # @!attribute [rw] page_refs + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef>] + # One or more references to visual page elements + class PageAnchor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a weak reference to a page element within a document. + # @!attribute [rw] page + # @return [::Integer] + # Required. Index into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages} + # element, for example using + # `[Document.pages][page_refs.page]` to locate the related page element. + # This field is skipped when its value is the default `0`. See + # https://developers.google.com/protocol-buffers/docs/proto3#json. + # @!attribute [rw] layout_type + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef::LayoutType] + # Optional. The type of the layout element that is being referenced if + # any. + # @!attribute [rw] layout_id + # @return [::String] + # Optional. Deprecated. Use + # {::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} + # instead. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] + # Optional. Identifies the bounding polygon of a layout element on the + # page. + # @!attribute [rw] confidence + # @return [::Float] + # Optional. Confidence of detected page element, if applicable. Range + # `[0, 1]`. + class PageRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of layout that is being referenced. + module LayoutType + # Layout Unspecified. + LAYOUT_TYPE_UNSPECIFIED = 0 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#blocks Page.blocks} + # element. + BLOCK = 1 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#paragraphs Page.paragraphs} + # element. + PARAGRAPH = 2 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#lines Page.lines} + # element. + LINE = 3 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tokens Page.tokens} + # element. + TOKEN = 4 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#visual_elements Page.visual_elements} + # element. + VISUAL_ELEMENT = 5 + + # Refrrences a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tables Page.tables} + # element. + TABLE = 6 + + # References a + # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#form_fields Page.form_fields} + # element. + FORM_FIELD = 7 + end + end + end + + # Structure to identify provenance relationships between annotations in + # different revisions. + # @!attribute [rw] revision + # @return [::Integer] + # The index of the revision that produced this element. + # @!attribute [rw] id + # @return [::Integer] + # The Id of this operation. Needs to be unique within the scope of the + # revision. + # @!attribute [rw] parents + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::Parent>] + # References to the original elements that are replaced. + # @!attribute [rw] type + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::OperationType] + # The type of provenance operation. + class Provenance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The parent element the current element is based on. Used for + # referencing/aligning, removal and replacement operations. + # @!attribute [rw] revision + # @return [::Integer] + # The index of the index into current revision's parent_ids list. + # @!attribute [rw] index + # @return [::Integer] + # The index of the parent item in the corresponding item list (eg. list + # of entities, properties within entities, etc.) in the parent revision. + # @!attribute [rw] id + # @return [::Integer] + # The id of the parent provenance. + class Parent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # If a processor or agent does an explicit operation on existing elements. + module OperationType + # Operation type unspecified. If no operation is specified a provenance + # entry is simply used to match against a `parent`. + OPERATION_TYPE_UNSPECIFIED = 0 + + # Add an element. + ADD = 1 + + # Remove an element identified by `parent`. + REMOVE = 2 + + # Replace an element identified by `parent`. + REPLACE = 3 + + # Request human review for the element identified by `parent`. + EVAL_REQUESTED = 4 + + # Element is reviewed and approved at human review, confidence will be + # set to 1.0. + EVAL_APPROVED = 5 + + # 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. Unique within the context of the document. + # @!attribute [rw] parent + # @return [::Array<::Integer>] + # The revisions that this revision is based on. This can include one or + # more parent (when documents are merged.) This field represents the + # index into the `revisions` field. + # @!attribute [rw] parent_ids + # @return [::Array<::String>] + # The revisions that this revision is based on. Must include all the ids + # that have anything to do with this revision - eg. there are + # `provenance.parent.revision` fields that index into this field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time that the revision was created. + # @!attribute [rw] human_review + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Revision::HumanReview] + # Human Review information of this revision. + class Revision + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Human Review information of the document. + # @!attribute [rw] state + # @return [::String] + # Human review state. e.g. `requested`, `succeeded`, `rejected`. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # For example, the rejection reason when the state is `rejected`. + class HumanReview + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used for text changes aka. OCR corrections. + # @!attribute [rw] text_anchor + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] + # Provenance of the correction. + # Text anchor indexing into the + # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. There + # can only be a single `TextAnchor.text_segments` element. If the start + # and end index of the text segment are the same, the text change is + # inserted before that index. + # @!attribute [rw] changed_text + # @return [::String] + # The text that replaces the text identified in the `text_anchor`. + # @!attribute [rw] provenance + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>] + # The history of this annotation. + class TextChange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb new file mode 100644 index 000000000000..5f47a5f34711 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb @@ -0,0 +1,133 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Payload message of raw document content (bytes). + # @!attribute [rw] content + # @return [::String] + # Inline document content. + # @!attribute [rw] mime_type + # @return [::String] + # An IANA MIME type (RFC6838) indicating the nature and format of the + # {::Google::Cloud::DocumentAI::V1beta3::RawDocument#content content}. + class RawDocument + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a document stored on Cloud Storage. + # @!attribute [rw] gcs_uri + # @return [::String] + # The Cloud Storage object uri. + # @!attribute [rw] mime_type + # @return [::String] + # An IANA MIME type (RFC6838) of the content. + class GcsDocument + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a set of documents on Cloud Storage. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::GcsDocument>] + # The list of documents. + class GcsDocuments + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies all documents on Cloud Storage with a common prefix. + # @!attribute [rw] gcs_uri_prefix + # @return [::String] + # The URI prefix. + class GcsPrefix + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The common config to specify a set of documents used as input. + # @!attribute [rw] gcs_prefix + # @return [::Google::Cloud::DocumentAI::V1beta3::GcsPrefix] + # The set of documents that match the specified Cloud Storage `gcs_prefix`. + # @!attribute [rw] gcs_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::GcsDocuments] + # The set of documents individually specified on Cloud Storage. + class BatchDocumentsInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config that controls the output of documents. All documents will be written + # as a JSON file. + # @!attribute [rw] gcs_output_config + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig] + # Output config to write the results to Cloud Storage. + class DocumentOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The configuration used when outputting documents. + # @!attribute [rw] gcs_uri + # @return [::String] + # The Cloud Storage uri (a directory) of the output. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies which fields to include in the output documents. + # Only supports top level document and pages field so it must be in the + # form of `{document_field_name}` or `pages.{page_field_name}`. + # @!attribute [rw] sharding_config + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig::ShardingConfig] + # Specifies the sharding config for the output document. + class GcsOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The sharding config for the output document. + # @!attribute [rw] pages_per_shard + # @return [::Integer] + # The number of pages per shard. + # @!attribute [rw] pages_overlap + # @return [::Integer] + # The number of overlapping pages between consecutive shards. + class ShardingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Config for Document OCR. + # @!attribute [rw] 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] advanced_ocr_options + # @return [::Array<::String>] + # A list of advanced OCR options to further fine-tune OCR behavior. + class OcrConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb new file mode 100644 index 000000000000..bc45447b30b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb @@ -0,0 +1,867 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # Options for Process API + # @!attribute [rw] ocr_config + # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig] + # Only applicable to "Document OCR Processor". Returns error if set on other + # processor types. + class ProcessOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the process document method. + # @!attribute [rw] inline_document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # An inline document proto. + # @!attribute [rw] raw_document + # @return [::Google::Cloud::DocumentAI::V1beta3::RawDocument] + # A raw document content (bytes). + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} + # to use for processing. If a + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the + # server will use its [default + # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # The document payload, the [content] and [mime_type] fields must be set. + # @!attribute [rw] skip_human_review + # @return [::Boolean] + # Whether Human Review feature should be skipped for this request. Default to + # false. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies which fields to include in ProcessResponse's document. + # Only supports top level document and pages field so it must be in the form + # of `{document_field_name}` or `pages.{page_field_name}`. + # @!attribute [rw] process_options + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] + # Inference-time options for the process API + class ProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The status of human review on a processed document. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus::State] + # The state of human review on the processing request. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the human review state. + # @!attribute [rw] human_review_operation + # @return [::String] + # The name of the operation triggered by the processed document. This field + # is populated only when the [state] is [HUMAN_REVIEW_IN_PROGRESS]. It has + # the same response type and metadata as the long running operation returned + # by [ReviewDocument] method. + 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 is not enabled on the processor or the processing request has + # been set to skip this document. + SKIPPED = 1 + + # Human review validation is triggered and passed, so no review is needed. + VALIDATION_PASSED = 2 + + # Human review validation is triggered and the document is under review. + IN_PROGRESS = 3 + + # Some error happened during triggering human review, see the + # [state_message] for details. + ERROR = 4 + end + end + + # Response message for the process document method. + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # The document payload, will populate fields based on the processor's + # behavior. + # @!attribute [rw] human_review_operation + # @return [::String] + # The name of the operation triggered by the processed document. If the human + # review process is not triggered, this field will be empty. It has the same + # response type and metadata as the long running operation returned by + # ReviewDocument method. + # @!attribute [rw] human_review_status + # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] + # The status of human review on the processed document. + class ProcessResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for batch process document method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. + # Format: `projects/{project}/locations/{location}/processors/{processor}`, + # or + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] input_configs + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig>] + # The input config for each single document in the batch process. + # @!attribute [rw] output_config + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig] + # The overall output config for batch process. + # @!attribute [rw] input_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The input documents for batch process. + # @!attribute [rw] document_output_config + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig] + # The overall output config for batch process. + # @!attribute [rw] skip_human_review + # @return [::Boolean] + # Whether Human Review feature should be skipped for this request. Default to + # false. + # @!attribute [rw] process_options + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] + # Inference-time options for the process API + class BatchProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The message for input config in batch process. + # @!attribute [rw] gcs_source + # @return [::String] + # The Cloud Storage location as the source of the document. + # @!attribute [rw] mime_type + # @return [::String] + # Mimetype of the input. If the input is a raw document, the supported + # mimetypes are application/pdf, image/tiff, and image/gif. + # If the input is a [Document] proto, the type should be application/json. + class BatchInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message for output config in batch process. + # @!attribute [rw] gcs_destination + # @return [::String] + # The output Cloud Storage directory to put the processed documents. + class BatchOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for batch process document method. + class BatchProcessResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long running operation metadata for batch process method. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::State] + # The state of the current batch processing. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # For example, the error message if the operation is failed. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] individual_process_statuses + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::IndividualProcessStatus>] + # The list of response details of each document. + class BatchProcessMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of a each individual document in the batch process. + # @!attribute [rw] input_gcs_source + # @return [::String] + # The source of the document, same as the [input_gcs_source] field in the + # request when the batch process started. The batch process is started by + # take snapshot of that document, since a user can move or change that + # document during the process. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status processing the document. + # @!attribute [rw] output_gcs_destination + # @return [::String] + # The output_gcs_destination (in the request as `output_gcs_destination`) + # of the processed document if it was successful, otherwise empty. + # @!attribute [rw] human_review_operation + # @return [::String] + # The name of the operation triggered by the processed document. If the + # human review process is not triggered, this field will be empty. It has + # the same response type and metadata as the long running operation + # returned by ReviewDocument method. + # @!attribute [rw] human_review_status + # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] + # The status of human review on the processed document. + class IndividualProcessStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible states of the batch processing operation. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # Request operation is waiting for scheduling. + WAITING = 1 + + # Request is being processed. + RUNNING = 2 + + # The batch processing completed successfully. + SUCCEEDED = 3 + + # The batch processing was being cancelled. + CANCELLING = 4 + + # The batch processing was cancelled. + CANCELLED = 5 + + # The batch processing has failed. + FAILED = 6 + end + end + + # Request message for fetch processor types. + # @!attribute [rw] parent + # @return [::String] + # Required. The project of processor type to list. + # The available processor types may depend on the allow-listing on projects. + # Format: `projects/{project}/locations/{location}` + class FetchProcessorTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for fetch processor types. + # @!attribute [rw] processor_types + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # The list of processor types. + class FetchProcessorTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for list processor types. + # @!attribute [rw] parent + # @return [::String] + # Required. The location of processor type to list. + # The available processor types may depend on the allow-listing on projects. + # Format: `projects/{project}/locations/{location}` + # @!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 list processor types. + # @!attribute [rw] processor_types + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] + # The processor types. + # @!attribute [rw] next_page_token + # @return [::String] + # Points to the next page, otherwise empty. + class ListProcessorTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for list all processors belongs to a project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) which owns this collection of + # Processors. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of processors to return. + # If unspecified, at most 50 processors will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # We will return the processors sorted by creation time. The page token + # will point to the next processor. + class ListProcessorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for list processors. + # @!attribute [rw] processors + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Processor>] + # The list of processors. + # @!attribute [rw] next_page_token + # @return [::String] + # Points to the next processor, otherwise empty. + class ListProcessorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for get processor. + # @!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 get processor. + # @!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 get processor version. + # @!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 list processors. + # @!attribute [rw] processor_versions + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] + # The list of processors. + # @!attribute [rw] next_page_token + # @return [::String] + # Points to the next processor, otherwise empty. + class ListProcessorVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the delete processor version 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 delete processor version method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class DeleteProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the deploy processor version 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 deploy processor version method. + class DeployProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long running operation metadata for deploy processor version method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class DeployProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the undeploy processor version 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 undeploy processor version method. + class UndeployProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long running operation metadata for the undeploy processor version + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class UndeployProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for create a processor. Notice this request is sent to + # a regionalized backend service, and if the processor type is not available + # on that region, the creation will fail. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) under which to create the + # processor. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] processor + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] + # Required. The processor to be created, requires [processor_type] and + # [display_name] to be set. Also, the processor is under CMEK if CMEK fields + # are set. + class CreateProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the delete processor 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 delete processor method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class DeleteProcessorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the enable processor 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 enable processor 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 enable processor method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class EnableProcessorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the disable processor 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 disable processor 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 disable processor method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class DisableProcessorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the set default processor version method. + # @!attribute [rw] processor + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default + # version. + # @!attribute [rw] default_processor_version + # @return [::String] + # Required. The resource name of child + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use + # as default. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + class SetDefaultProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for set default processor version method. + class SetDefaultProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The long running operation metadata for set default processor version + # method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class SetDefaultProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the create processor version method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project, location and processor) to create the new + # version for. Format: + # `projects/{project}/locations/{location}/processors/{processor}`. + # @!attribute [rw] processor_version + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # Required. The processor version to be created. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # Optional. The schema the processor version will be trained with. + # @!attribute [rw] input_data + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData] + # Optional. The input data used to train the `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 `ProcessorVersion`. + # @!attribute [rw] training_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The documents used for training the new version. + # @!attribute [rw] test_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The documents used for testing the trained version. + class InputData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response for the TrainProcessorVersion method. + # @!attribute [rw] processor_version + # @return [::String] + # The resource name of the processor version produced by training. + class TrainProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata that represents a processor version being created. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + # @!attribute [rw] training_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] + # The training dataset validation information. + # @!attribute [rw] test_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] + # The test dataset validation information. + class TrainProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The dataset validation information. + # This includes any and all errors with documents and the dataset. + # @!attribute [rw] document_error_count + # @return [::Integer] + # The total number of document errors. + # @!attribute [rw] dataset_error_count + # @return [::Integer] + # The total number of dataset errors. + # @!attribute [rw] document_errors + # @return [::Array<::Google::Rpc::Status>] + # Error information pertaining to specific documents. A maximum of 10 + # document errors will be returned. + # Any document with errors will not be used throughout training. + # @!attribute [rw] dataset_errors + # @return [::Array<::Google::Rpc::Status>] + # Error information for the dataset as a whole. A maximum of 10 dataset + # errors will be returned. + # A single dataset error is terminal for training. + class DatasetValidation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for review document method. + # @!attribute [rw] inline_document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # An inline document proto. + # @!attribute [rw] human_review_config + # @return [::String] + # Required. The resource name of the HumanReviewConfig that the document will + # be reviewed with. + # @!attribute [rw] document + # @return [::Google::Cloud::DocumentAI::V1beta3::Document] + # The document that needs human review. + # @!attribute [rw] enable_schema_validation + # @return [::Boolean] + # Whether the validation should be performed on the ad-hoc review request. + # @!attribute [rw] priority + # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] + # The priority of the human review task. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # The document schema of the human review task. + class ReviewDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The priority level of the human review task. + module Priority + # The default priority level. + DEFAULT = 0 + + # The urgent priority level. The labeling manager should allocate labeler + # resource to the urgent task queue to respect this priority level. + URGENT = 1 + end + end + + # Response message for review document method. + # @!attribute [rw] gcs_destination + # @return [::String] + # The Cloud Storage uri for the human reviewed document if the review is + # succeeded. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentResponse::State] + # The state of the review operation. + # @!attribute [rw] rejection_reason + # @return [::String] + # The reason why the review is rejected by reviewer. + class ReviewDocumentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of the review operation. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # The review operation is rejected by the reviewer. + REJECTED = 1 + + # The review operation is succeeded. + SUCCEEDED = 2 + end + end + + # The long running operation metadata for review document method. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentOperationMetadata::State] + # Used only when Operation.done is false. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # For example, the error message if the operation is failed. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + # @!attribute [rw] question_id + # @return [::String] + # The Crowd Compute question ID. + class ReviewDocumentOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the 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 + + # Evaluates the given ProcessorVersion against the supplied documents. + # @!attribute [rw] processor_version + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] evaluation_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # Optional. The documents used in the evaluation. If unspecified, use the + # processor's dataset as evaluation input. + class EvaluateProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the EvaluateProcessorVersion method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class EvaluateProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the EvaluateProcessorVersion method. + # @!attribute [rw] evaluation + # @return [::String] + # The resource name of the created evaluation. + class EvaluateProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retrieves a specific Evaluation. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + class GetEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retrieves a list of evaluations for a given ProcessorVersion. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to + # list evaluations for. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # If unspecified, at most 5 evaluations will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListEvaluations` call. + # Provide this to retrieve the subsequent page. + class ListEvaluationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response from ListEvaluations. + # @!attribute [rw] evaluations + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # The evaluations requested. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListEvaluationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb new file mode 100644 index 000000000000..a6d668f65a7a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # The schema defines the output of the processed document by a processor. + # @!attribute [rw] display_name + # @return [::String] + # Display name to show to users. + # @!attribute [rw] description + # @return [::String] + # Description of the schema. + # @!attribute [rw] entity_types + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType>] + # Entity types of the schema. + # @!attribute [rw] metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::Metadata] + # Metadata of the schema. + class DocumentSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # EntityType is the wrapper of a label of the corresponding model with + # detailed attributes and limitations for entity-based processors. Multiple + # types can also compose a dependency tree to represent nested types. + # @!attribute [rw] enum_values + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::EnumValues] + # If specified, lists all the possible values for this entity. This + # should not be more than a handful of values. If the number of values + # is >10 or could change frequently use the `EntityType.value_ontology` + # field and specify a list of all possible values in a value ontology + # file. + # @!attribute [rw] display_name + # @return [::String] + # User defined name for the type. + # @!attribute [rw] name + # @return [::String] + # Name of the type. It must be unique within the schema file and + # cannot be a 'Common Type'. Besides that we use the following naming + # conventions: + # + # - *use `snake_casing`* + # - name matching is case-sensitive + # - Maximum 64 characters. + # - Must start with a letter. + # - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + # compatibility internal infrastructure and tooling can handle any ascii + # character) + # - The `/` is sometimes used to denote a property of a type. For example + # `line_item/amount`. This convention is deprecated, but will still be + # honored for backward compatibility. + # @!attribute [rw] base_types + # @return [::Array<::String>] + # The entity type that this type is derived from. For now, one and only + # one should be set. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property>] + # Describing 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] value_type + # @return [::String] + # A reference to the value type of the property. This type is subject + # to the same conventions as the `Entity.base_types` field. + # @!attribute [rw] occurrence_type + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType] + # Occurrence type limits the number of instances an entity type appears + # in the document. + class Property + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of occurrences of the entity type in the document. Note: this + # represents the number of instances of an entity types, not number of + # mentions of a given entity instance. + module OccurrenceType + # Unspecified occurrence type. + OCCURRENCE_TYPE_UNSPECIFIED = 0 + + # There will be zero or one instance of this entity type. + OPTIONAL_ONCE = 1 + + # The entity type will appear zero or multiple times. + OPTIONAL_MULTIPLE = 2 + + # The entity type will only appear exactly once. + REQUIRED_ONCE = 3 + + # The entity type will appear once or more times. + REQUIRED_MULTIPLE = 4 + end + end + end + + # Metadata for global schema behavior. + # @!attribute [rw] document_splitter + # @return [::Boolean] + # If true, a `document` entity type can be applied to subdocument ( + # splitting). Otherwise, it can only be applied to the entire document + # (classification). + # @!attribute [rw] document_allow_multiple_labels + # @return [::Boolean] + # If true, on a given page, there can be multiple `document` annotations + # covering it. + # @!attribute [rw] prefixed_naming_on_properties + # @return [::Boolean] + # If set, all the nested entities must be prefixed with the parents. + # @!attribute [rw] skip_naming_validation + # @return [::Boolean] + # If set, we will skip the naming format validation in the schema. So the + # string values in `DocumentSchema.EntityType.name` and + # `DocumentSchema.EntityType.Property.name` will not be checked. + class Metadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb new file mode 100644 index 000000000000..969d0f6faf53 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # An evaluation of a ProcessorVersion's performance. + # @!attribute [rw] name + # @return [::String] + # The resource name of the evaluation. + # Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time that the evaluation was created. + # @!attribute [rw] document_counters + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Counters] + # Counters for the documents used in the evaluation. + # @!attribute [rw] all_entities_metrics + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] + # Metrics for all the entities in aggregate. + # @!attribute [rw] entity_metrics + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics}] + # Metrics across confidence levels, for different entities. + # @!attribute [rw] kms_key_name + # @return [::String] + # The KMS key name used for encryption. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # The KMS key version with which data is encrypted. + class Evaluation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Evaluation counters for the documents that were used. + # @!attribute [rw] input_documents_count + # @return [::Integer] + # How many documents were sent for evaluation. + # @!attribute [rw] invalid_documents_count + # @return [::Integer] + # How many documents were not included in the evaluation as they didn't + # pass validation. + # @!attribute [rw] failed_documents_count + # @return [::Integer] + # How many documents were not included in the evaluation as Document AI + # failed to process them. + # @!attribute [rw] evaluated_documents_count + # @return [::Integer] + # How many documents were used in the evaluation. + class Counters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluation metrics, either in aggregate or about a specific entity. + # @!attribute [rw] precision + # @return [::Float] + # The calculated precision. + # @!attribute [rw] recall + # @return [::Float] + # The calculated recall. + # @!attribute [rw] f1_score + # @return [::Float] + # The calculated f1 score. + # @!attribute [rw] predicted_occurrences_count + # @return [::Integer] + # The amount of occurrences in predicted documents. + # @!attribute [rw] ground_truth_occurrences_count + # @return [::Integer] + # The amount of occurrences in ground truth documents. + # @!attribute [rw] predicted_document_count + # @return [::Integer] + # The amount of documents with a predicted occurrence. + # @!attribute [rw] ground_truth_document_count + # @return [::Integer] + # The amount of documents with a ground truth occurrence. + # @!attribute [rw] true_positives_count + # @return [::Integer] + # The amount of true positives. + # @!attribute [rw] false_positives_count + # @return [::Integer] + # The amount of false positives. + # @!attribute [rw] false_negatives_count + # @return [::Integer] + # The amount of false negatives. + # @!attribute [rw] total_documents_count + # @return [::Integer] + # The amount of documents that had an occurrence of this label. + class Metrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluations metrics, at a specific confidence level. + # @!attribute [rw] confidence_level + # @return [::Float] + # The confidence level. + # @!attribute [rw] metrics + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] + # The metrics at the specific confidence level. + class ConfidenceLevelMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metrics across multiple confidence levels. + # @!attribute [rw] confidence_level_metrics + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] + # Metrics across confidence levels with fuzzy matching enabled. + # @!attribute [rw] confidence_level_metrics_exact + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] + # Metrics across confidence levels with only exact matching. + # @!attribute [rw] auprc + # @return [::Float] + # The calculated area under the precision recall curve (AUPRC), computed by + # integrating over all confidence thresholds. + # @!attribute [rw] estimated_calibration_error + # @return [::Float] + # The Estimated Calibration Error (ECE) of the confidence of the predicted + # entities. + # @!attribute [rw] auprc_exact + # @return [::Float] + # The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + # only. + # @!attribute [rw] estimated_calibration_error_exact + # @return [::Float] + # The ECE for the predicted entities with fuzzy matching disabled, i.e., + # exact matching only. + # @!attribute [rw] metrics_type + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics::MetricsType] + # The metrics type for the label. + class MultiConfidenceMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A type that determines how metrics should be interpreted. + module MetricsType + # The metrics type is unspecified. By default, metrics without a + # particular specification are for leaf entity types (i.e., top-level + # entity types without child types, or child types which are not + # parent types themselves). + METRICS_TYPE_UNSPECIFIED = 0 + + # Indicates whether metrics for this particular label type represent an + # aggregate of metrics for other types instead of being based on actual + # TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) + # entity types are an aggregate of metrics for their children. + AGGREGATE = 1 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] + class EntityMetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb new file mode 100644 index 000000000000..6beba3a11eb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # A vertex represents a 2D point in the image. + # NOTE: the vertex coordinates are in the same scale as the original image. + # @!attribute [rw] x + # @return [::Integer] + # X coordinate. + # @!attribute [rw] y + # @return [::Integer] + # Y coordinate (starts from the top of the image). + class Vertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A vertex represents a 2D point in the image. + # NOTE: the normalized vertex coordinates are relative to the original image + # and range from 0 to 1. + # @!attribute [rw] x + # @return [::Float] + # X coordinate. + # @!attribute [rw] y + # @return [::Float] + # Y coordinate (starts from the top of the image). + class NormalizedVertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A bounding polygon for the detected image annotation. + # @!attribute [rw] vertices + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Vertex>] + # The bounding polygon vertices. + # @!attribute [rw] normalized_vertices + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::NormalizedVertex>] + # The bounding polygon normalized vertices. + class BoundingPoly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb new file mode 100644 index 000000000000..663e5b3fa6b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # The common metadata for long running operations. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State] + # The state of the operation. + # @!attribute [rw] state_message + # @return [::String] + # A message providing more details about the current state of processing. + # @!attribute [rw] resource + # @return [::String] + # A related resource to this operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + class CommonOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the longrunning operation. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # Operation is still running. + RUNNING = 1 + + # Operation is being cancelled. + CANCELLING = 2 + + # Operation succeeded. + SUCCEEDED = 3 + + # Operation failed. + FAILED = 4 + + # Operation is cancelled. + CANCELLED = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb new file mode 100644 index 000000000000..8e5efec64b8a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # A processor version is an implementation of a processor. Each processor + # can have multiple versions, pre-trained by Google internally or up-trained + # by the customer. At a time, a processor can only have one default version + # version. So the processor's behavior (when processing documents) is defined + # by a default version + # @!attribute [rw] name + # @return [::String] + # The resource name of the processor version. + # Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + # @!attribute [rw] display_name + # @return [::String] + # The display name of the processor version. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # The schema of the processor version. Describes the output. + # @!attribute [rw] state + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::State] + # The state of the processor version. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the processor version was created. + # @!attribute [rw] 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 [rw] google_managed + # @return [::Boolean] + # Denotes that this ProcessorVersion is managed by google. + # @!attribute [rw] deprecation_info + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::DeprecationInfo] + # If set, information about the eventual deprecation of this version. + class ProcessorVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about the upcoming deprecation of this processor version. + # @!attribute [rw] deprecation_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this processor version will be deprecated. + # @!attribute [rw] replacement_processor_version + # @return [::String] + # If set, the processor version that will be used as a replacement. + class DeprecationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The possible states of the processor version. + module State + # The processor version is in an unspecified state. + STATE_UNSPECIFIED = 0 + + # The processor version is deployed and can be used for processing. + DEPLOYED = 1 + + # The processor version is being deployed. + DEPLOYING = 2 + + # The processor version is not deployed and cannot be used for processing. + UNDEPLOYED = 3 + + # The processor version is being undeployed. + UNDEPLOYING = 4 + + # The processor version is being created. + CREATING = 5 + + # The processor version is being deleted. + DELETING = 6 + + # The processor version failed and is in an indeterminate state. + FAILED = 7 + end + end + + # The first-class citizen for Document AI. Each processor defines how to + # extract structural information from a document. + # @!attribute [r] name + # @return [::String] + # Output only. Immutable. The resource name of the processor. + # Format: `projects/{project}/locations/{location}/processors/{processor}` + # @!attribute [rw] type + # @return [::String] + # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. + # To get a list of processors types, see + # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes}. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the processor. + # @!attribute [r] state + # @return [::Google::Cloud::DocumentAI::V1beta3::Processor::State] + # Output only. The state of the processor. + # @!attribute [rw] default_processor_version + # @return [::String] + # The default processor version. + # @!attribute [r] process_endpoint + # @return [::String] + # Output only. Immutable. The http endpoint that can be called to invoke + # processing. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the processor was created. + # @!attribute [rw] kms_key_name + # @return [::String] + # The KMS key used for encryption/decryption in CMEK scenarios. + # See https://cloud.google.com/security-key-management. + class Processor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible states of the processor. + module State + # The processor is in an unspecified state. + STATE_UNSPECIFIED = 0 + + # The processor is enabled, i.e., has an enabled version which can + # currently serve processing requests and all the feature dependencies have + # been successfully initialized. + ENABLED = 1 + + # The processor is disabled. + DISABLED = 2 + + # The processor is being enabled, will become `ENABLED` if successful. + ENABLING = 3 + + # The processor is being disabled, will become `DISABLED` if successful. + DISABLING = 4 + + # The processor is being created, will become either `ENABLED` (for + # successful creation) or `FAILED` (for failed ones). + # Once a processor is in this state, it can then be used for document + # processing, but the feature dependencies of the processor might not be + # fully created yet. + CREATING = 5 + + # The processor failed during creation or initialization of feature + # dependencies. The user should delete the processor and recreate one as + # all the functionalities of the processor are disabled. + FAILED = 6 + + # The processor is being deleted, will be removed if successful. + DELETING = 7 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb new file mode 100644 index 000000000000..7311ae079582 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # A 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, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. + # @!attribute [rw] category + # @return [::String] + # The processor category, used by UI to group processor types. + # @!attribute [rw] available_locations + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType::LocationInfo>] + # The locations in which this processor is available. + # @!attribute [rw] allow_creation + # @return [::Boolean] + # Whether the processor type allows creation. If true, users can create a + # processor of this processor type. Otherwise, users need to request access. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of the processor type + # @!attribute [rw] sample_document_uris + # @return [::Array<::String>] + # A set of Cloud Storage URIs of sample documents for this processor. + class ProcessorType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The location information about where the processor is available. + # @!attribute [rw] location_id + # @return [::String] + # The location id, currently must be one of [us, eu]. + class LocationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..08ab43c84ae9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..bd27eead4bda --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # + # JSON + # + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b4a53d0ac67f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..4c0ad96e8eb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..c437e42a7581 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..b550ca8dff38 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..3f28f1fb18f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..6f72e88c418d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb new file mode 100644 index 000000000000..139261bdf919 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a color in the RGBA color space. This representation is designed + # for simplicity of conversion to/from color representations in various + # languages over compactness. For example, the fields of this representation + # can be trivially provided to the constructor of `java.awt.Color` in Java; it + # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` + # method in iOS; and, with just a little work, it can be easily formatted into + # a CSS `rgba()` string in JavaScript. + # + # This reference page doesn't carry information about the absolute color + # space + # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, + # DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color + # space. + # + # When color equality needs to be decided, implementations, unless + # documented otherwise, treat two colors as equal if all their red, + # green, blue, and alpha values each differ by at most 1e-5. + # + # Example (Java): + # + # import com.google.type.Color; + # + # // ... + # public static java.awt.Color fromProto(Color protocolor) { + # float alpha = protocolor.hasAlpha() + # ? protocolor.getAlpha().getValue() + # : 1.0; + # + # return new java.awt.Color( + # protocolor.getRed(), + # protocolor.getGreen(), + # protocolor.getBlue(), + # alpha); + # } + # + # public static Color toProto(java.awt.Color color) { + # float red = (float) color.getRed(); + # float green = (float) color.getGreen(); + # float blue = (float) color.getBlue(); + # float denominator = 255.0; + # Color.Builder resultBuilder = + # Color + # .newBuilder() + # .setRed(red / denominator) + # .setGreen(green / denominator) + # .setBlue(blue / denominator); + # int alpha = color.getAlpha(); + # if (alpha != 255) { + # result.setAlpha( + # FloatValue + # .newBuilder() + # .setValue(((float) alpha) / denominator) + # .build()); + # } + # return resultBuilder.build(); + # } + # // ... + # + # Example (iOS / Obj-C): + # + # // ... + # static UIColor* fromProto(Color* protocolor) { + # float red = [protocolor red]; + # float green = [protocolor green]; + # float blue = [protocolor blue]; + # FloatValue* alpha_wrapper = [protocolor alpha]; + # float alpha = 1.0; + # if (alpha_wrapper != nil) { + # alpha = [alpha_wrapper value]; + # } + # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; + # } + # + # static Color* toProto(UIColor* color) { + # CGFloat red, green, blue, alpha; + # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { + # return nil; + # } + # Color* result = [[Color alloc] init]; + # [result setRed:red]; + # [result setGreen:green]; + # [result setBlue:blue]; + # if (alpha <= 0.9999) { + # [result setAlpha:floatWrapperWithValue(alpha)]; + # } + # [result autorelease]; + # return result; + # } + # // ... + # + # Example (JavaScript): + # + # // ... + # + # var protoToCssColor = function(rgb_color) { + # var redFrac = rgb_color.red || 0.0; + # var greenFrac = rgb_color.green || 0.0; + # var blueFrac = rgb_color.blue || 0.0; + # var red = Math.floor(redFrac * 255); + # var green = Math.floor(greenFrac * 255); + # var blue = Math.floor(blueFrac * 255); + # + # if (!('alpha' in rgb_color)) { + # return rgbToCssColor(red, green, blue); + # } + # + # var alphaFrac = rgb_color.alpha.value || 0.0; + # var rgbParams = [red, green, blue].join(','); + # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); + # }; + # + # var rgbToCssColor = function(red, green, blue) { + # var rgbNumber = new Number((red << 16) | (green << 8) | blue); + # var hexString = rgbNumber.toString(16); + # var missingZeros = 6 - hexString.length; + # var resultBuilder = ['#']; + # for (var i = 0; i < missingZeros; i++) { + # resultBuilder.push('0'); + # } + # resultBuilder.push(hexString); + # return resultBuilder.join(''); + # }; + # + # // ... + # @!attribute [rw] red + # @return [::Float] + # The amount of red in the color as a value in the interval [0, 1]. + # @!attribute [rw] green + # @return [::Float] + # The amount of green in the color as a value in the interval [0, 1]. + # @!attribute [rw] blue + # @return [::Float] + # The amount of blue in the color as a value in the interval [0, 1]. + # @!attribute [rw] alpha + # @return [::Google::Protobuf::FloatValue] + # The fraction of this color that should be applied to the pixel. That is, + # the final pixel color is defined by the equation: + # + # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + # + # This means that a value of 1.0 corresponds to a solid color, whereas + # a value of 0.0 corresponds to a completely transparent color. This + # uses a wrapper message rather than a simple float scalar so that it is + # possible to distinguish between a default value and the value being unset. + # If omitted, this color object is rendered as a solid color + # (as if the alpha value had been explicitly given a value of 1.0). + class Color + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..086a71b4869a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a whole or partial calendar date, such as a birthday. The time of + # day and time zone are either specified elsewhere or are insignificant. The + # date is relative to the Gregorian Calendar. This can represent one of the + # following: + # + # * A full date, with non-zero year, month, and day values + # * A month and day value, with a zero year, such as an anniversary + # * A year on its own, with zero month and day values + # * A year and month value, with a zero day, such as a credit card expiration + # date + # + # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] year + # @return [::Integer] + # Year of the date. Must be from 1 to 9999, or 0 to specify a date without + # a year. + # @!attribute [rw] month + # @return [::Integer] + # Month of a year. Must be from 1 to 12, or 0 to specify a year without a + # month and day. + # @!attribute [rw] day + # @return [::Integer] + # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + # to specify a year by itself or a year and month where the day isn't + # significant. + class Date + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb new file mode 100644 index 000000000000..2d8961edc217 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents civil time (or occasionally physical time). + # + # This type can represent a civil time in one of a few possible ways: + # + # * When utc_offset is set and time_zone is unset: a civil time on a calendar + # day with a particular offset from UTC. + # * When time_zone is set and utc_offset is unset: a civil time on a calendar + # day in a particular time zone. + # * When neither time_zone nor utc_offset is set: a civil time on a calendar + # day in local time. + # + # The date is relative to the Proleptic Gregorian Calendar. + # + # If year is 0, the DateTime is considered not to have a specific year. month + # and day must have valid, non-zero values. + # + # This type may also be used to represent a physical time if all the date and + # time fields are set and either case of the `time_offset` oneof is set. + # Consider using `Timestamp` message for physical time instead. If your use + # case also would like to store the user's timezone, that can be done in + # another field. + # + # This type is more flexible than some applications may want. Make sure to + # document and validate your application's limitations. + # @!attribute [rw] year + # @return [::Integer] + # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + # datetime without a year. + # @!attribute [rw] month + # @return [::Integer] + # Required. Month of year. Must be from 1 to 12. + # @!attribute [rw] day + # @return [::Integer] + # Required. Day of month. Must be from 1 to 31 and valid for the year and + # month. + # @!attribute [rw] hours + # @return [::Integer] + # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + # may choose to allow the value "24:00:00" for scenarios like business + # closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Required. Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + # API may allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Required. Fractions of seconds in nanoseconds. Must be from 0 to + # 999,999,999. + # @!attribute [rw] utc_offset + # @return [::Google::Protobuf::Duration] + # UTC offset. Must be whole seconds, between -18 hours and +18 hours. + # For example, a UTC offset of -4:00 would be represented as + # { seconds: -14400 }. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone. + class DateTime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a time zone from the + # [IANA Time Zone Database](https://www.iana.org/time-zones). + # @!attribute [rw] id + # @return [::String] + # IANA Time Zone Database time zone, e.g. "America/New_York". + # @!attribute [rw] version + # @return [::String] + # Optional. IANA Time Zone Database version number, e.g. "2019a". + class TimeZone + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb new file mode 100644 index 000000000000..800ef43f01cb --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents an amount of money with its currency type. + # @!attribute [rw] currency_code + # @return [::String] + # The three-letter currency code defined in ISO 4217. + # @!attribute [rw] units + # @return [::Integer] + # The whole units of the amount. + # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + # @!attribute [rw] nanos + # @return [::Integer] + # Number of nano (10^-9) units of the amount. + # The value must be between -999,999,999 and +999,999,999 inclusive. + # If `units` is positive, `nanos` must be positive or zero. + # If `units` is zero, `nanos` can be positive, zero, or negative. + # If `units` is negative, `nanos` must be negative or zero. + # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + class Money + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb new file mode 100644 index 000000000000..cd58486c563e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a postal address, e.g. for postal delivery or payments addresses. + # Given a postal address, a postal service can deliver items to a premise, P.O. + # Box or similar. + # It is not intended to model geographical locations (roads, towns, + # mountains). + # + # In typical usage an address would be created via user input or from importing + # existing data, depending on the type of process. + # + # Advice on address input / editing: + # - Use an i18n-ready address widget such as + # https://github.com/google/libaddressinput) + # - Users should not be presented with UI elements for input or editing of + # fields outside countries where that field is used. + # + # For more guidance on how to use this schema, please see: + # https://support.google.com/business/answer/6397478 + # @!attribute [rw] revision + # @return [::Integer] + # The schema revision of the `PostalAddress`. This must be set to 0, which is + # the latest revision. + # + # All new revisions **must** be backward compatible with old revisions. + # @!attribute [rw] region_code + # @return [::String] + # Required. CLDR region code of the country/region of the address. This + # is never inferred and it is up to the user to ensure the value is + # correct. See http://cldr.unicode.org/ and + # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] language_code + # @return [::String] + # Optional. BCP-47 language code of the contents of this address (if + # known). This is often the UI language of the input form or is expected + # to match one of the languages used in the address' country/region, or their + # transliterated equivalents. + # This can affect formatting in certain countries, but is not critical + # to the correctness of the data and will never affect any validation or + # other non-formatting related operations. + # + # If this value is not known, it should be omitted (rather than specifying a + # possibly incorrect default). + # + # Examples: "zh-Hant", "ja", "ja-Latn", "en". + # @!attribute [rw] postal_code + # @return [::String] + # Optional. Postal code of the address. Not all countries use or require + # postal codes to be present, but where they are used, they may trigger + # additional validation with other parts of the address (e.g. state/zip + # validation in the U.S.A.). + # @!attribute [rw] sorting_code + # @return [::String] + # Optional. Additional, country-specific, sorting code. This is not used + # in most regions. Where it is used, the value is either a string like + # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + # alone, representing the "sector code" (Jamaica), "delivery area indicator" + # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + # @!attribute [rw] administrative_area + # @return [::String] + # Optional. Highest administrative subdivision which is used for postal + # addresses of a country or region. + # For example, this can be a state, a province, an oblast, or a prefecture. + # Specifically, for Spain this is the province and not the autonomous + # community (e.g. "Barcelona" and not "Catalonia"). + # Many countries don't use an administrative area in postal addresses. E.g. + # in Switzerland this should be left unpopulated. + # @!attribute [rw] locality + # @return [::String] + # Optional. Generally refers to the city/town portion of the address. + # Examples: US city, IT comune, UK post town. + # In regions of the world where localities are not well defined or do not fit + # into this structure well, leave locality empty and use address_lines. + # @!attribute [rw] sublocality + # @return [::String] + # Optional. Sublocality of the address. + # For example, this can be neighborhoods, boroughs, districts. + # @!attribute [rw] address_lines + # @return [::Array<::String>] + # Unstructured address lines describing the lower levels of an address. + # + # Because values in address_lines do not have type information and may + # sometimes contain multiple values in a single field (e.g. + # "Austin, TX"), it is important that the line order is clear. The order of + # address lines should be "envelope order" for the country/region of the + # address. In places where this can vary (e.g. Japan), address_language is + # used to make it explicit (e.g. "ja" for large-to-small ordering and + # "ja-Latn" or "en" for small-to-large). This way, the most specific line of + # an address can be selected based on the language. + # + # The minimum permitted structural representation of an address consists + # of a region_code with all remaining information placed in the + # address_lines. It would be possible to format such an address very + # approximately without geocoding, but no semantic reasoning could be + # made about any of the address components until it was at least + # partially resolved. + # + # Creating an address only containing a region_code and address_lines, and + # then geocoding is the recommended way to handle completely unstructured + # addresses (as opposed to guessing which parts of the address should be + # localities or administrative areas). + # @!attribute [rw] recipients + # @return [::Array<::String>] + # Optional. The recipient at the address. + # This field may, under certain circumstances, contain multiline information. + # For example, it might contain "care of" information. + # @!attribute [rw] organization + # @return [::String] + # Optional. The name of the organization at the address. + class PostalAddress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile new file mode 100644 index 000000000000..83a1cdf1d4f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-document_ai-v1beta3", path: "../" +else + gem "google-cloud-document_ai-v1beta3" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb new file mode 100644 index 000000000000..59d427c3f053 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new + + # Call the batch_process_documents method. + result = client.batch_process_documents request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb new file mode 100644 index 000000000000..6314dde8366b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor +# +def create_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new + + # Call the create_processor method. + result = client.create_processor request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb new file mode 100644 index 000000000000..400fbfc6810c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor +# +def delete_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new + + # Call the delete_processor method. + result = client.delete_processor request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb new file mode 100644 index 000000000000..13c9baaead4a --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new + + # Call the delete_processor_version method. + result = client.delete_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb new file mode 100644 index 000000000000..de4004f15cdf --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new + + # Call the deploy_processor_version method. + result = client.deploy_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb new file mode 100644 index 000000000000..e13b18555893 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor +# +def disable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new + + # Call the disable_processor method. + result = client.disable_processor request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb new file mode 100644 index 000000000000..f35cc4aa42f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor +# +def enable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new + + # Call the enable_processor method. + result = client.enable_processor request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb new file mode 100644 index 000000000000..787a1f22a065 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + + # Call the evaluate_processor_version method. + result = client.evaluate_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb new file mode 100644 index 000000000000..19f574a3fd99 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new + + # Call the fetch_processor_types method. + result = client.fetch_processor_types request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb new file mode 100644 index 000000000000..f615a5e899b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation +# +def get_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + + # Call the get_evaluation method. + result = client.get_evaluation request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb new file mode 100644 index 000000000000..4ecc67faba6d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor +# +def get_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new + + # Call the get_processor method. + result = client.get_processor request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb new file mode 100644 index 000000000000..7a2a90e5aa44 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new + + # Call the get_processor_type method. + result = client.get_processor_type request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb new file mode 100644 index 000000000000..f88112b42149 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new + + # Call the get_processor_version method. + result = client.get_processor_version request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb new file mode 100644 index 000000000000..857539ae3a71 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations +# +def list_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + + # Call the list_evaluations method. + result = client.list_evaluations request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + p response + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb new file mode 100644 index 000000000000..2a2fe2f321e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new + + # Call the list_processor_types method. + result = client.list_processor_types request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. + p response + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb new file mode 100644 index 000000000000..1f8d5578e172 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new + + # Call the list_processor_versions method. + result = client.list_processor_versions request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + p response + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb new file mode 100644 index 000000000000..ed6daa6a232f --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors +# +def list_processors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new + + # Call the list_processors method. + result = client.list_processors request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. + p response + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb new file mode 100644 index 000000000000..e4072f9ac6c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document +# +def process_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new + + # Call the process_document method. + result = client.process_document request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb new file mode 100644 index 000000000000..ab37f486d1a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document +# +def review_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new + + # Call the review_document method. + result = client.review_document request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb new file mode 100644 index 000000000000..f9270e049972 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new + + # Call the set_default_processor_version method. + result = client.set_default_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb new file mode 100644 index 000000000000..987e8c359d3b --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + + # Call the train_processor_version method. + result = client.train_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb new file mode 100644 index 000000000000..ced7cfc3058d --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new + + # Call the undeploy_processor_version method. + result = client.undeploy_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json new file mode 100644 index 000000000000..c7004d05b3c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -0,0 +1,895 @@ +{ + "client_library": { + "name": "google-cloud-document_ai-v1beta3", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.documentai.v1beta3", + "version": "v1beta3" + } + ] + }, + "snippets": [ + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync", + "title": "Snippet for process_document in DocumentProcessorService", + "description": "Basic snippet for process_document in DocumentProcessorService", + "file": "document_processor_service/process_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "process_document", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ProcessDocument", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync", + "title": "Snippet for batch_process_documents in DocumentProcessorService", + "description": "Basic snippet for batch_process_documents in DocumentProcessorService", + "file": "document_processor_service/batch_process_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_process_documents", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "BatchProcessDocuments", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync", + "title": "Snippet for fetch_processor_types in DocumentProcessorService", + "description": "Basic snippet for fetch_processor_types in DocumentProcessorService", + "file": "document_processor_service/fetch_processor_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_processor_types", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "FetchProcessorTypes", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync", + "title": "Snippet for list_processor_types in DocumentProcessorService", + "description": "Basic snippet for list_processor_types in DocumentProcessorService", + "file": "document_processor_service/list_processor_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processor_types", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessorTypes", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync", + "title": "Snippet for get_processor_type in DocumentProcessorService", + "description": "Basic snippet for get_processor_type in DocumentProcessorService", + "file": "document_processor_service/get_processor_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor_type", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorType", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessorType", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync", + "title": "Snippet for list_processors in DocumentProcessorService", + "description": "Basic snippet for list_processors in DocumentProcessorService", + "file": "document_processor_service/list_processors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processors", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessors", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync", + "title": "Snippet for get_processor in DocumentProcessorService", + "description": "Basic snippet for get_processor in DocumentProcessorService", + "file": "document_processor_service/get_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync", + "title": "Snippet for train_processor_version in DocumentProcessorService", + "description": "Basic snippet for train_processor_version in DocumentProcessorService", + "file": "document_processor_service/train_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "train_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "TrainProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync", + "title": "Snippet for get_processor_version in DocumentProcessorService", + "description": "Basic snippet for get_processor_version in DocumentProcessorService", + "file": "document_processor_service/get_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync", + "title": "Snippet for list_processor_versions in DocumentProcessorService", + "description": "Basic snippet for list_processor_versions in DocumentProcessorService", + "file": "document_processor_service/list_processor_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processor_versions", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListProcessorVersions", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync", + "title": "Snippet for delete_processor_version in DocumentProcessorService", + "description": "Basic snippet for delete_processor_version in DocumentProcessorService", + "file": "document_processor_service/delete_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeleteProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync", + "title": "Snippet for deploy_processor_version in DocumentProcessorService", + "description": "Basic snippet for deploy_processor_version in DocumentProcessorService", + "file": "document_processor_service/deploy_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "deploy_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeployProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync", + "title": "Snippet for undeploy_processor_version in DocumentProcessorService", + "description": "Basic snippet for undeploy_processor_version in DocumentProcessorService", + "file": "document_processor_service/undeploy_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "undeploy_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "UndeployProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync", + "title": "Snippet for create_processor in DocumentProcessorService", + "description": "Basic snippet for create_processor in DocumentProcessorService", + "file": "document_processor_service/create_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "CreateProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync", + "title": "Snippet for delete_processor in DocumentProcessorService", + "description": "Basic snippet for delete_processor in DocumentProcessorService", + "file": "document_processor_service/delete_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DeleteProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync", + "title": "Snippet for enable_processor in DocumentProcessorService", + "description": "Basic snippet for enable_processor in DocumentProcessorService", + "file": "document_processor_service/enable_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "EnableProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync", + "title": "Snippet for disable_processor in DocumentProcessorService", + "description": "Basic snippet for disable_processor in DocumentProcessorService", + "file": "document_processor_service/disable_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_processor", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "DisableProcessor", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync", + "title": "Snippet for set_default_processor_version in DocumentProcessorService", + "description": "Basic snippet for set_default_processor_version in DocumentProcessorService", + "file": "document_processor_service/set_default_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_default_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "SetDefaultProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync", + "title": "Snippet for review_document in DocumentProcessorService", + "description": "Basic snippet for review_document in DocumentProcessorService", + "file": "document_processor_service/review_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "review_document", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ReviewDocument", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync", + "title": "Snippet for evaluate_processor_version in DocumentProcessorService", + "description": "Basic snippet for evaluate_processor_version in DocumentProcessorService", + "file": "document_processor_service/evaluate_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "evaluate_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "EvaluateProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync", + "title": "Snippet for get_evaluation in DocumentProcessorService", + "description": "Basic snippet for get_evaluation in DocumentProcessorService", + "file": "document_processor_service/get_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_evaluation", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::Evaluation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetEvaluation", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync", + "title": "Snippet for list_evaluations in DocumentProcessorService", + "description": "Basic snippet for list_evaluations in DocumentProcessorService", + "file": "document_processor_service/list_evaluations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_evaluations", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListEvaluations", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb new file mode 100644 index 000000000000..fef6ec26facd --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" +require "google/cloud/document_ai/v1beta3/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb new file mode 100644 index 000000000000..7caf5491ec9c --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/document_ai/v1beta3/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientPathsTest < Minitest::Test + def test_evaluation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.evaluation_path project: "value0", location: "value1", processor: "value2", processor_version: "value3", evaluation: "value4" + assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3/evaluations/value4", path + end + end + + def test_human_review_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.human_review_config_path project: "value0", location: "value1", processor: "value2" + assert_equal "projects/value0/locations/value1/processors/value2/humanReviewConfig", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_processor_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.processor_path project: "value0", location: "value1", processor: "value2" + assert_equal "projects/value0/locations/value1/processors/value2", path + end + end + + def test_processor_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.processor_type_path project: "value0", location: "value1", processor_type: "value2" + assert_equal "projects/value0/locations/value1/processorTypes/value2", path + end + end + + def test_processor_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.processor_version_path project: "value0", location: "value1", processor: "value2", processor_version: "value3" + assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb new file mode 100644 index 000000000000..2b2cc9d2780e --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb @@ -0,0 +1,1495 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/documentai/v1beta3/document_processor_service_pb" +require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" +require "google/cloud/document_ai/v1beta3/document_processor_service" + +class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_process_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_document = {} + name = "hello world" + document = {} + skip_human_review = true + field_mask = {} + process_options = {} + + process_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :process_document, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] + assert_equal :inline_document, request.source + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] + assert_equal true, request["skip_human_review"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, process_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.process_document inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.process_document ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.process_document(::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, process_document_client_stub.call_rpc_count + end + end + + def test_batch_process_documents + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + input_configs = [{}] + output_config = {} + input_documents = {} + document_output_config = {} + skip_human_review = true + process_options = {} + + batch_process_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_process_documents, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, request["input_configs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig), request["output_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["input_documents"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig), request["document_output_config"] + assert_equal true, request["skip_human_review"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_process_documents_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_process_documents name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_process_documents ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_process_documents(::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_process_documents_client_stub.call_rpc_count + end + end + + def test_fetch_processor_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + fetch_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_processor_types, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_processor_types_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_processor_types({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_processor_types parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_processor_types ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_processor_types({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_processor_types(::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_processor_types_client_stub.call_rpc_count + end + end + + def test_list_processor_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processor_types, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_processor_types_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_processor_types parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_processor_types ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_processor_types(::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_processor_types_client_stub.call_rpc_count + end + end + + def test_get_processor_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_processor_type, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_processor_type_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_processor_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_processor_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_processor_type ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_processor_type({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_processor_type(::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_processor_type_client_stub.call_rpc_count + end + end + + def test_list_processors + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processors, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_processors_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_processors parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_processors ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_processors(::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_processors_client_stub.call_rpc_count + end + end + + def test_get_processor + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_processor({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_processor name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_processor ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_processor({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_processor(::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_processor_client_stub.call_rpc_count + end + end + + def test_train_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + processor_version = {} + document_schema = {} + input_data = {} + base_processor_version = "hello world" + + train_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :train_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion), request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData), request["input_data"] + assert_equal "hello world", request["base_processor_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, train_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.train_processor_version({ 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 parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.train_processor_version ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(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({ parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.train_processor_version(::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, train_processor_version_client_stub.call_rpc_count + end + end + + def test_get_processor_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_processor_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_processor_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_processor_version ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_processor_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_processor_version(::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_processor_version_client_stub.call_rpc_count + end + end + + def test_list_processor_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_processor_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processor_versions, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_processor_versions_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_processor_versions parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_processor_versions ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_processor_versions(::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_processor_versions_client_stub.call_rpc_count + end + end + + def test_delete_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_processor_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_processor_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_processor_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_processor_version_client_stub.call_rpc_count + end + end + + def test_deploy_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + deploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :deploy_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, deploy_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.deploy_processor_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.deploy_processor_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.deploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.deploy_processor_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.deploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, deploy_processor_version_client_stub.call_rpc_count + end + end + + def test_undeploy_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + undeploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undeploy_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undeploy_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undeploy_processor_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undeploy_processor_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undeploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undeploy_processor_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undeploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, undeploy_processor_version_client_stub.call_rpc_count + end + end + + def test_create_processor + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + processor = {} + + create_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Processor), request["processor"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_processor({ parent: parent, processor: processor }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_processor parent: parent, processor: processor do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_processor ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_processor({ parent: parent, processor: processor }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_processor(::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_processor_client_stub.call_rpc_count + end + end + + def test_delete_processor + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_processor({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_processor name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_processor ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_processor({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_processor(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_processor_client_stub.call_rpc_count + end + end + + def test_enable_processor + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + enable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_processor({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_processor name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_processor ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_processor({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_processor(::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_processor_client_stub.call_rpc_count + end + end + + def test_disable_processor + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + disable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_processor, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_processor_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_processor({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_processor name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_processor ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_processor({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_processor(::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_processor_client_stub.call_rpc_count + end + end + + def test_set_default_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + processor = "hello world" + default_processor_version = "hello world" + + set_default_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_default_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, request + assert_equal "hello world", request["processor"] + assert_equal "hello world", request["default_processor_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_default_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_default_processor_version processor: processor, default_processor_version: default_processor_version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_default_processor_version ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_default_processor_version(::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_default_processor_version_client_stub.call_rpc_count + end + end + + def test_review_document + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_document = {} + human_review_config = "hello world" + document = {} + enable_schema_validation = true + priority = :DEFAULT + document_schema = {} + + review_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :review_document, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] + assert_equal :inline_document, request.source + assert_equal "hello world", request["human_review_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] + assert_equal true, request["enable_schema_validation"] + assert_equal :DEFAULT, request["priority"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, review_document_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.review_document inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.review_document ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.review_document(::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, review_document_client_stub.call_rpc_count + end + end + + def test_evaluate_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + processor_version = "hello world" + evaluation_documents = {} + + evaluate_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :evaluate_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, request + assert_equal "hello world", request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["evaluation_documents"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, evaluate_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.evaluate_processor_version processor_version: processor_version, evaluation_documents: evaluation_documents do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.evaluate_processor_version ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.evaluate_processor_version(::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, evaluate_processor_version_client_stub.call_rpc_count + end + end + + def test_get_evaluation + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_evaluation, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_evaluation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_evaluation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_evaluation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_evaluation ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_evaluation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_evaluation(::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_evaluation_client_stub.call_rpc_count + end + end + + def test_list_evaluations + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_evaluations, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_evaluations_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_evaluations parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_evaluations ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_evaluations(::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_evaluations_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb new file mode 100644 index 000000000000..b5db6a24f8e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" From f74361bfc41b1f4ebdace84162888fbd39fd6d79 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 20:54:55 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../documentai/v1beta3/document_io_pb.rb | 1 + .../cloud/documentai/v1beta3/document_io.rb | 3 + .../.gitignore | 22 - .../.repo-metadata.json | 19 - .../.rubocop.yml | 33 - .../.yardopts | 12 - .../AUTHENTICATION.md | 151 - .../CHANGELOG.md | 2 - .../google-cloud-document_ai-v1beta3/Gemfile | 3 - .../LICENSE.md | 201 -- .../README.md | 144 - .../google-cloud-document_ai-v1beta3/Rakefile | 201 -- .../gapic_metadata.json | 128 - .../google-cloud-document_ai-v1beta3.gemspec | 38 - .../lib/google-cloud-document_ai-v1beta3.rb | 21 - .../lib/google/cloud/document_ai/v1beta3.rb | 40 - .../v1beta3/document_processor_service.rb | 53 - .../document_processor_service/client.rb | 2615 ----------------- .../document_processor_service/credentials.rb | 51 - .../document_processor_service/operations.rb | 770 ----- .../document_processor_service/paths.rb | 151 - .../cloud/document_ai/v1beta3/version.rb | 28 - .../cloud/documentai/v1beta3/barcode_pb.rb | 24 - .../documentai/v1beta3/document_io_pb.rb | 67 - .../cloud/documentai/v1beta3/document_pb.rb | 332 --- .../v1beta3/document_processor_service_pb.rb | 352 --- .../document_processor_service_services_pb.rb | 103 - .../documentai/v1beta3/document_schema_pb.rb | 60 - .../cloud/documentai/v1beta3/evaluation_pb.rb | 72 - .../cloud/documentai/v1beta3/geometry_pb.rb | 33 - .../v1beta3/operation_metadata_pb.rb | 37 - .../cloud/documentai/v1beta3/processor_pb.rb | 73 - .../documentai/v1beta3/processor_type_pb.rb | 35 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 318 -- .../proto_docs/google/api/field_behavior.rb | 71 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 -- .../cloud/documentai/v1beta3/barcode.rb | 73 - .../cloud/documentai/v1beta3/document.rb | 969 ------ .../cloud/documentai/v1beta3/document_io.rb | 133 - .../v1beta3/document_processor_service.rb | 867 ------ .../documentai/v1beta3/document_schema.rb | 155 - .../cloud/documentai/v1beta3/evaluation.rb | 181 -- .../cloud/documentai/v1beta3/geometry.rb | 65 - .../documentai/v1beta3/operation_metadata.rb | 68 - .../cloud/documentai/v1beta3/processor.rb | 175 -- .../documentai/v1beta3/processor_type.rb | 65 - .../google/longrunning/operations.rb | 164 -- .../proto_docs/google/protobuf/any.rb | 141 - .../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 | 129 - .../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 | 46 - .../create_processor.rb | 39 - .../delete_processor.rb | 46 - .../delete_processor_version.rb | 46 - .../deploy_processor_version.rb | 46 - .../disable_processor.rb | 46 - .../enable_processor.rb | 46 - .../evaluate_processor_version.rb | 46 - .../fetch_processor_types.rb | 39 - .../get_evaluation.rb | 39 - .../get_processor.rb | 39 - .../get_processor_type.rb | 39 - .../get_processor_version.rb | 39 - .../list_evaluations.rb | 45 - .../list_processor_types.rb | 45 - .../list_processor_versions.rb | 45 - .../list_processors.rb | 45 - .../process_document.rb | 39 - .../review_document.rb | 46 - .../set_default_processor_version.rb | 46 - .../train_processor_version.rb | 46 - .../undeploy_processor_version.rb | 46 - ...adata_google.cloud.documentai.v1beta3.json | 895 ------ ...ument_processor_service_operations_test.rb | 380 --- .../document_processor_service_paths_test.rb | 97 - .../document_processor_service_test.rb | 1495 ---------- .../test/helper.rb | 23 - 89 files changed, 4 insertions(+), 14656 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/README.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb index 6b5129fe00b0..5ce071b07181 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb @@ -43,6 +43,7 @@ end add_message "google.cloud.documentai.v1beta3.OcrConfig" do optional :enable_native_pdf_parsing, :bool, 3 + repeated :advanced_ocr_options, :string, 5 end end end diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb index c1f5b61cefcf..9cd2d22bab51 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb @@ -120,6 +120,9 @@ class ShardingConfig # @return [::Boolean] # Enables special handling for PDFs with existing text information. Results # in better text extraction quality in such PDF inputs. + # @!attribute [rw] advanced_ocr_options + # @return [::Array<::String>] + # A list of advanced OCR options to further fine-tune OCR behavior. class OcrConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore b/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json deleted file mode 100644 index e4eca1154624..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.repo-metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "api_id": "us-documentai.googleapis.com", - "api_shortname": "documentai", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest", - "distribution_name": "google-cloud-document_ai-v1beta3", - "is_cloud": true, - "language": "ruby", - "name": "documentai", - "name_pretty": "Document AI V1beta3 API", - "product_documentation": "https://cloud.google.com/document-ai/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details.", - "ruby-cloud-env-prefix": "DOCUMENT_AI", - "ruby-cloud-product-url": "https://cloud.google.com/document-ai/", - "ruby-cloud-namespace-override": "DocumentAi=DocumentAI", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml b/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml deleted file mode 100644 index 945616d355d4..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-document_ai-v1beta3.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-document_ai-v1beta3.rb" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts b/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts deleted file mode 100644 index fd21d6f25a32..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Document AI V1beta3 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md deleted file mode 100644 index ebe733081f48..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/AUTHENTICATION.md +++ /dev/null @@ -1,151 +0,0 @@ -# Authentication - -In general, the google-cloud-document_ai-v1beta3 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. - -## Quickstart - -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). - -```sh -export DOCUMENT_AI_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. - -```ruby -require "google/cloud/document_ai/v1beta3" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -``` - -## Credential Lookup - -The google-cloud-document_ai-v1beta3 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. -Code should be written as if already authenticated. - -### Environment Variables - -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. - -The environment variables that google-cloud-document_ai-v1beta3 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials}): - -* `DOCUMENT_AI_CREDENTIALS` - Path to JSON file, or JSON contents -* `DOCUMENT_AI_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/document_ai/v1beta3" - -ENV["DOCUMENT_AI_CREDENTIALS"] = "path/to/keyfile.json" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -``` - -### Configuration - -The path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: - -```ruby -require "google/cloud/document_ai/v1beta3" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = "path/to/keyfile.json" -end -``` - -Or globally for all clients: - -```ruby -require "google/cloud/document_ai/v1beta3" - -::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| - config.credentials = "path/to/keyfile.json" -end - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -``` - -### Cloud SDK - -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. - -To configure your system for this, simply: - -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. - -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. - -## Creating a Service Account - -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-document_ai-v1beta3. - -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. - -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. - - *Note: You may need to enable billing in order to use these services.* - -4. Select **Credentials** from the side navigation. - - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. - - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. - - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile deleted file mode 100644 index b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md deleted file mode 100644 index 9995e975266b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Document AI V1beta3 API - -API Client library for the Document AI V1beta3 API - -Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Document AI V1beta3 API. Most users should consider using -the main client gem, -[google-cloud-document_ai](https://rubygems.org/gems/google-cloud-document_ai). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-document_ai-v1beta3 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/us-documentai.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/document_ai/v1beta3" - -client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -request = ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new # (request fields as keyword arguments...) -response = client.process_document request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/document-ai/) -for general usage information. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-document_ai`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-document_ai-v1beta3`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-document_ai`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-document_ai-v1beta3`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile b/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile deleted file mode 100644 index eefce4d611cb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-document_ai-v1beta3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-document_ai-v1beta3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -end - -# Acceptance tests -desc "Run the google-cloud-document_ai-v1beta3 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["DOCUMENT_AI_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["DOCUMENT_AI_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["DOCUMENT_AI_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or DOCUMENT_AI_TEST_PROJECT=test123 DOCUMENT_AI_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["DOCUMENT_AI_PROJECT"] = project - ENV["DOCUMENT_AI_TEST_PROJECT"] = project - ENV["DOCUMENT_AI_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-document_ai-v1beta3 gem has no acceptance tests." - end - end - - desc "Run acceptance tests with coverage." - task :coverage do - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-document_ai-v1beta3 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-document_ai-v1beta3 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-document_ai-v1beta3" - header "google-cloud-document_ai-v1beta3 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-document_ai-v1beta3 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-document_ai-v1beta3 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-document_ai-v1beta3 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-document_ai-v1beta3 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/gapic_metadata.json deleted file mode 100644 index c84135811a7e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/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.v1beta3", - "libraryPackage": "::Google::Cloud::DocumentAI::V1beta3", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client", - "rpcs": { - "ProcessDocument": { - "methods": [ - "process_document" - ] - }, - "BatchProcessDocuments": { - "methods": [ - "batch_process_documents" - ] - }, - "FetchProcessorTypes": { - "methods": [ - "fetch_processor_types" - ] - }, - "ListProcessorTypes": { - "methods": [ - "list_processor_types" - ] - }, - "GetProcessorType": { - "methods": [ - "get_processor_type" - ] - }, - "ListProcessors": { - "methods": [ - "list_processors" - ] - }, - "GetProcessor": { - "methods": [ - "get_processor" - ] - }, - "TrainProcessorVersion": { - "methods": [ - "train_processor_version" - ] - }, - "GetProcessorVersion": { - "methods": [ - "get_processor_version" - ] - }, - "ListProcessorVersions": { - "methods": [ - "list_processor_versions" - ] - }, - "DeleteProcessorVersion": { - "methods": [ - "delete_processor_version" - ] - }, - "DeployProcessorVersion": { - "methods": [ - "deploy_processor_version" - ] - }, - "UndeployProcessorVersion": { - "methods": [ - "undeploy_processor_version" - ] - }, - "CreateProcessor": { - "methods": [ - "create_processor" - ] - }, - "DeleteProcessor": { - "methods": [ - "delete_processor" - ] - }, - "EnableProcessor": { - "methods": [ - "enable_processor" - ] - }, - "DisableProcessor": { - "methods": [ - "disable_processor" - ] - }, - "SetDefaultProcessorVersion": { - "methods": [ - "set_default_processor_version" - ] - }, - "ReviewDocument": { - "methods": [ - "review_document" - ] - }, - "EvaluateProcessorVersion": { - "methods": [ - "evaluate_processor_version" - ] - }, - "GetEvaluation": { - "methods": [ - "get_evaluation" - ] - }, - "ListEvaluations": { - "methods": [ - "list_evaluations" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec b/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec deleted file mode 100644 index 6b14859505c5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/document_ai/v1beta3/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-document_ai-v1beta3" - gem.version = Google::Cloud::DocumentAI::V1beta3::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights. Note that google-cloud-document_ai-v1beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-document_ai instead. See the readme for more details." - gem.summary = "API Client library for the Document AI V1beta3 API" - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.16.0", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.3", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb deleted file mode 100644 index 8aad94dd490d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google-cloud-document_ai-v1beta3.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/document_ai/v1beta3" diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb deleted file mode 100644 index f78e79c9c9b5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/document_ai/v1beta3/document_processor_service" -require "google/cloud/document_ai/v1beta3/version" - -module Google - module Cloud - module DocumentAI - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/document_ai/v1beta3" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - module V1beta3 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta3", "_helpers.rb" -require "google/cloud/document_ai/v1beta3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb deleted file mode 100644 index 93cf8666fcbf..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/document_ai/v1beta3/version" - -require "google/cloud/document_ai/v1beta3/document_processor_service/credentials" -require "google/cloud/document_ai/v1beta3/document_processor_service/paths" -require "google/cloud/document_ai/v1beta3/document_processor_service/operations" -require "google/cloud/document_ai/v1beta3/document_processor_service/client" - -module Google - module Cloud - module DocumentAI - module V1beta3 - ## - # Service to call Cloud DocumentAI to process documents according to the - # processor's definition. Processors are built using state-of-the-art Google - # AI such as natural language, computer vision, and translation to extract - # structured information from unstructured or semi-structured documents. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/document_ai/v1beta3/document_processor_service" - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - module DocumentProcessorService - end - end - end - end -end - -helper_path = ::File.join __dir__, "document_processor_service", "helpers.rb" -require "google/cloud/document_ai/v1beta3/document_processor_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb deleted file mode 100644 index c8e34658ba30..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +++ /dev/null @@ -1,2615 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - ## - # Client for the DocumentProcessorService service. - # - # Service to call Cloud DocumentAI to process documents according to the - # processor's definition. Processors are built using state-of-the-art Google - # AI such as natural language, computer vision, and translation to extract - # structured information from unstructured or semi-structured documents. - # - class Client - include Paths - - # @private - attr_reader :document_processor_service_stub - - ## - # Configure the DocumentProcessorService Client class. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentProcessorService clients - # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.process_document.timeout = 120.0 - default_config.rpcs.process_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_process_documents.timeout = 120.0 - default_config.rpcs.batch_process_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.review_document.timeout = 120.0 - default_config.rpcs.review_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentProcessorService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new DocumentProcessorService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DocumentProcessorService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && - !@config.endpoint.split(".").first.include?("-") - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @document_processor_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - channel_args: @config.channel_args, - interceptors: @config.interceptors - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Processes a single document. - # - # @overload process_document(request, options = nil) - # Pass arguments to `process_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload process_document(inline_document: nil, raw_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil) - # Pass arguments to `process_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # An inline document proto. - # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash] - # A raw document content (bytes). - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the - # server will use its [default - # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # The document payload, the [content] and [mime_type] fields must be set. - # @param skip_human_review [::Boolean] - # Whether Human Review feature should be skipped for this request. Default to - # false. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Specifies which fields to include in ProcessResponse's document. - # Only supports top level document and pages field so it must be in the form - # of `{document_field_name}` or `pages.{page_field_name}`. - # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] - # Inference-time options for the process API - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new - # - # # Call the process_document method. - # result = client.process_document request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. - # p result - # - def process_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.process_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.process_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.process_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :process_document, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # LRO endpoint to batch process many documents. The output is written - # to Cloud Storage as JSON in the [Document] format. - # - # @overload batch_process_documents(request, options = nil) - # Pass arguments to `batch_process_documents` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil) - # Pass arguments to `batch_process_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param input_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, ::Hash>] - # The input config for each single document in the batch process. - # @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash] - # The overall output config for batch process. - # @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] - # The input documents for batch process. - # @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash] - # The overall output config for batch process. - # @param skip_human_review [::Boolean] - # Whether Human Review feature should be skipped for this request. Default to - # false. - # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash] - # Inference-time options for the process API - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new - # - # # Call the batch_process_documents method. - # result = client.batch_process_documents request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def batch_process_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_process_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_process_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :batch_process_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Fetches processor types. Note that we do not use ListProcessorTypes here - # because it is not paginated. - # - # @overload fetch_processor_types(request, options = nil) - # Pass arguments to `fetch_processor_types` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_processor_types(parent: nil) - # Pass arguments to `fetch_processor_types` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project of processor type to list. - # The available processor types may depend on the allow-listing on projects. - # Format: `projects/{project}/locations/{location}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new - # - # # Call the fetch_processor_types method. - # result = client.fetch_processor_types request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. - # p result - # - def fetch_processor_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.fetch_processor_types.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_processor_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :fetch_processor_types, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the processor types that exist. - # - # @overload list_processor_types(request, options = nil) - # Pass arguments to `list_processor_types` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_processor_types(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processor_types` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of processor type to list. - # The available processor types may depend on the allow-listing on projects. - # Format: `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # The maximum number of processor types to return. - # If unspecified, at most 100 processor types will be returned. - # The maximum value is 500; values above 500 will be coerced to 500. - # @param page_token [::String] - # Used to retrieve the next page of results, empty if at the end of the list. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new - # - # # Call the list_processor_types method. - # result = client.list_processor_types request - # - # # The returned object is of type Gapic::PagedEnumerable. You can - # # iterate over all elements by calling #each, and the enumerable - # # will lazily make API calls to fetch subsequent pages. Other - # # methods are also available for managing paging directly. - # result.each do |response| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. - # p response - # end - # - def list_processor_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_processor_types.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_processor_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processor_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_processor_types, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor type detail. - # - # @overload get_processor_type(request, options = nil) - # Pass arguments to `get_processor_type` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_processor_type(name: nil) - # Pass arguments to `get_processor_type` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor type resource name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new - # - # # Call the get_processor_type method. - # result = client.get_processor_type request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. - # p result - # - def get_processor_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_processor_type.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_processor_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_processor_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_processor_type, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all processors which belong to this project. - # - # @overload list_processors(request, options = nil) - # Pass arguments to `list_processors` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_processors(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processors` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project and location) which owns this collection of - # Processors. Format: `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # The maximum number of processors to return. - # If unspecified, at most 50 processors will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # We will return the processors sorted by creation time. The page token - # will point to the next processor. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new - # - # # Call the list_processors method. - # result = client.list_processors request - # - # # The returned object is of type Gapic::PagedEnumerable. You can - # # iterate over all elements by calling #each, and the enumerable - # # will lazily make API calls to fetch subsequent pages. Other - # # methods are also available for managing paging directly. - # result.each do |response| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. - # p response - # end - # - def list_processors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_processors.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_processors.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_processors, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processors, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor detail. - # - # @overload get_processor(request, options = nil) - # Pass arguments to `get_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_processor(name: nil) - # Pass arguments to `get_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new - # - # # Call the get_processor method. - # result = client.get_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - # p result - # - def get_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_processor, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Trains a new processor version. - # Operation metadata is returned as - # cloud_documentai_core.TrainProcessorVersionMetadata. - # - # @overload train_processor_version(request, options = nil) - # Pass arguments to `train_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload train_processor_version(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 parent [::String] - # Required. The parent (project, location and processor) to create the new - # version for. Format: - # `projects/{project}/locations/{location}/processors/{processor}`. - # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash] - # Required. The processor version to be created. - # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] - # Optional. The schema the processor version will be trained with. - # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash] - # Optional. The input data used to train the `ProcessorVersion`. - # @param base_processor_version [::String] - # Optional. The processor version to use as a base for training. This - # processor version must be a child of `parent`. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new - # - # # Call the train_processor_version method. - # result = client.train_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def train_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.train_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.train_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a processor version detail. - # - # @overload get_processor_version(request, options = nil) - # Pass arguments to `get_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_processor_version(name: nil) - # Pass arguments to `get_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new - # - # # Call the get_processor_version method. - # result = client.get_processor_version request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - # p result - # - def get_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_processor_version, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all versions of a processor. - # - # @overload list_processor_versions(request, options = nil) - # Pass arguments to `list_processor_versions` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_processor_versions(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_processor_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project, location and processor) to list all - # versions. Format: - # `projects/{project}/locations/{location}/processors/{processor}` - # @param page_size [::Integer] - # The maximum number of processor versions to return. - # If unspecified, at most 10 processor versions will be returned. - # The maximum value is 20; values above 20 will be coerced to 20. - # @param page_token [::String] - # We will return the processor versions sorted by creation time. The page - # token will point to the next processor version. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new - # - # # Call the list_processor_versions method. - # result = client.list_processor_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can - # # iterate over all elements by calling #each, and the enumerable - # # will lazily make API calls to fetch subsequent pages. Other - # # methods are also available for managing paging directly. - # result.each do |response| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - # p response - # end - # - def list_processor_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_processor_versions.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_processor_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processor_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_processor_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the processor version, all artifacts under the processor version - # will be deleted. - # - # @overload delete_processor_version(request, options = nil) - # Pass arguments to `delete_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_processor_version(name: nil) - # Pass arguments to `delete_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new - # - # # Call the delete_processor_version method. - # result = client.delete_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def delete_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :delete_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deploys the processor version. - # - # @overload deploy_processor_version(request, options = nil) - # Pass arguments to `deploy_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload deploy_processor_version(name: nil) - # Pass arguments to `deploy_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be deployed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new - # - # # Call the deploy_processor_version method. - # result = client.deploy_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def deploy_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.deploy_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.deploy_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deploy_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :deploy_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeploys the processor version. - # - # @overload undeploy_processor_version(request, options = nil) - # Pass arguments to `undeploy_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undeploy_processor_version(name: nil) - # Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor version resource name to be undeployed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new - # - # # Call the undeploy_processor_version method. - # result = client.undeploy_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def undeploy_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.undeploy_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.undeploy_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undeploy_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :undeploy_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a processor from the type processor that the user chose. - # The processor will be at "ENABLED" state by default after its creation. - # - # @overload create_processor(request, options = nil) - # Pass arguments to `create_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_processor(parent: nil, processor: nil) - # Pass arguments to `create_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent (project and location) under which to create the - # processor. Format: `projects/{project}/locations/{location}` - # @param processor [::Google::Cloud::DocumentAI::V1beta3::Processor, ::Hash] - # Required. The processor to be created, requires [processor_type] and - # [display_name] to be set. Also, the processor is under CMEK if CMEK fields - # are set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Processor] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new - # - # # Call the create_processor method. - # result = client.create_processor request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - # p result - # - def create_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :create_processor, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the processor, unloads all deployed model artifacts if it was - # enabled and then deletes all artifacts associated with this processor. - # - # @overload delete_processor(request, options = nil) - # Pass arguments to `delete_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_processor(name: nil) - # Pass arguments to `delete_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new - # - # # Call the delete_processor method. - # result = client.delete_processor request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def delete_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :delete_processor, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a processor - # - # @overload enable_processor(request, options = nil) - # Pass arguments to `enable_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_processor(name: nil) - # Pass arguments to `enable_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be enabled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new - # - # # Call the enable_processor method. - # result = client.enable_processor request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def enable_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :enable_processor, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a processor - # - # @overload disable_processor(request, options = nil) - # Pass arguments to `disable_processor` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_processor(name: nil) - # Pass arguments to `disable_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The processor resource name to be disabled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new - # - # # Call the disable_processor method. - # result = client.disable_processor request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def disable_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_processor.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :disable_processor, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Set the default (active) version of a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} that will be used in - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document ProcessDocument} - # and - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}. - # - # @overload set_default_processor_version(request, options = nil) - # Pass arguments to `set_default_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_default_processor_version(processor: nil, default_processor_version: nil) - # Pass arguments to `set_default_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default - # version. - # @param default_processor_version [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use - # as default. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new - # - # # Call the set_default_processor_version method. - # result = client.set_default_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def set_default_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_default_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.processor - header_params["processor"] = request.processor - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_default_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_default_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :set_default_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Send a document for Human Review. The input document should be processed by - # the specified processor. - # - # @overload review_document(request, options = nil) - # Pass arguments to `review_document` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload review_document(inline_document: nil, human_review_config: nil, document: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) - # Pass arguments to `review_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # An inline document proto. - # @param human_review_config [::String] - # Required. The resource name of the HumanReviewConfig that the document will - # be reviewed with. - # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash] - # The document that needs human review. - # @param enable_schema_validation [::Boolean] - # Whether the validation should be performed on the ad-hoc review request. - # @param priority [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] - # The document schema of the human review task. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new - # - # # Call the review_document method. - # result = client.review_document request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def review_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.review_document.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.human_review_config - header_params["human_review_config"] = request.human_review_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.review_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.review_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :review_document, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Evaluates a ProcessorVersion against annotated documents, producing an - # Evaluation. - # - # @overload evaluate_processor_version(request, options = nil) - # Pass arguments to `evaluate_processor_version` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil) - # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param processor_version [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] - # Optional. The documents used in the evaluation. If unspecified, use the - # processor's dataset as evaluation input. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new - # - # # Call the evaluate_processor_version method. - # result = client.evaluate_processor_version request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def evaluate_processor_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.evaluate_processor_version.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.processor_version - header_params["processor_version"] = request.processor_version - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.evaluate_processor_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a specific evaluation. - # - # @overload get_evaluation(request, options = nil) - # Pass arguments to `get_evaluation` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_evaluation(name: nil) - # Pass arguments to `get_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new - # - # # Call the get_evaluation method. - # result = client.get_evaluation request - # - # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. - # p result - # - def get_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_evaluation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a set of evaluations for a given processor version. - # - # @overload list_evaluations(request, options = nil) - # Pass arguments to `list_evaluations` via a request object, either of type - # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_evaluations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # list evaluations for. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @param page_size [::Integer] - # The standard list page size. - # If unspecified, at most 5 evaluations will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous `ListEvaluations` call. - # Provide this to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/document_ai/v1beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new - # - # # Call the list_evaluations method. - # result = client.list_evaluations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can - # # iterate over all elements by calling #each, and the enumerable - # # will lazily make API calls to fetch subsequent pages. Other - # # methods are also available for managing paging directly. - # result.each do |response| - # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. - # p response - # end - # - def list_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_evaluations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DocumentProcessorService API. - # - # This class represents the configuration for DocumentProcessorService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # process_document to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.process_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - config_attr :endpoint, "documentai.googleapis.com", ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration 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-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb deleted file mode 100644 index 75ae5a98a886..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Credentials for the DocumentProcessorService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DOCUMENT_AI_CREDENTIALS", - "DOCUMENT_AI_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DOCUMENT_AI_CREDENTIALS_JSON", - "DOCUMENT_AI_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb deleted file mode 100644 index 8cccabfc0815..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +++ /dev/null @@ -1,770 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Service that implements Longrunning Operations API. - class Operations - # @private - attr_reader :operations_stub - - ## - # Configuration for the DocumentProcessorService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentProcessorService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - channel_args: @config.channel_args, - interceptors: @config.interceptors - ) - - # 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 all elements by calling #each, and the enumerable - # # will lazily make API calls to fetch subsequent pages. Other - # # methods are also available for managing paging directly. - # result.each do |response| - # # Each element is of type ::Google::Longrunning::Operation. - # p response - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use this - # # object to check the status of an operation, cancel it, or wait - # # for results. Here is how to block until completion: - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "Error!" - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"documentai.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - config_attr :endpoint, "documentai.googleapis.com", ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb deleted file mode 100644 index bd199612e369..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb +++ /dev/null @@ -1,151 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Path helper methods for the DocumentProcessorService API. - module Paths - ## - # Create a fully-qualified Evaluation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # @param processor_version [String] - # @param evaluation [String] - # - # @return [::String] - def evaluation_path project:, location:, processor:, processor_version:, evaluation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" - raise ::ArgumentError, "processor_version cannot contain /" if processor_version.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}/evaluations/#{evaluation}" - end - - ## - # Create a fully-qualified HumanReviewConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # - # @return [::String] - def human_review_config_path project:, location:, processor: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/humanReviewConfig" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Processor resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # - # @return [::String] - def processor_path project:, location:, processor: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}" - end - - ## - # Create a fully-qualified ProcessorType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processorTypes/{processor_type}` - # - # @param project [String] - # @param location [String] - # @param processor_type [String] - # - # @return [::String] - def processor_type_path project:, location:, processor_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processorTypes/#{processor_type}" - end - - ## - # Create a fully-qualified ProcessorVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # @param processor_version [String] - # - # @return [::String] - def processor_version_path project:, location:, processor:, processor_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb deleted file mode 100644 index 9b6a7dd5f7d1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb deleted file mode 100644 index acd8965b3081..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/barcode_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/barcode.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/barcode.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.Barcode" do - optional :format, :string, 1 - optional :value_format, :string, 2 - optional :raw_value, :string, 3 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Barcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Barcode").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb deleted file mode 100644 index 5ce071b07181..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document_io.proto - -require 'google/protobuf' - -require 'google/protobuf/field_mask_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/document_io.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.RawDocument" do - optional :content, :bytes, 1 - optional :mime_type, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.GcsDocument" do - optional :gcs_uri, :string, 1 - optional :mime_type, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.GcsDocuments" do - repeated :documents, :message, 1, "google.cloud.documentai.v1beta3.GcsDocument" - end - add_message "google.cloud.documentai.v1beta3.GcsPrefix" do - optional :gcs_uri_prefix, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" do - oneof :source do - optional :gcs_prefix, :message, 1, "google.cloud.documentai.v1beta3.GcsPrefix" - optional :gcs_documents, :message, 2, "google.cloud.documentai.v1beta3.GcsDocuments" - end - end - add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig" do - oneof :destination do - optional :gcs_output_config, :message, 1, "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig" - end - end - add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig" do - optional :gcs_uri, :string, 1 - optional :field_mask, :message, 2, "google.protobuf.FieldMask" - optional :sharding_config, :message, 3, "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig" - end - add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig" do - optional :pages_per_shard, :int32, 1 - optional :pages_overlap, :int32, 2 - end - add_message "google.cloud.documentai.v1beta3.OcrConfig" do - optional :enable_native_pdf_parsing, :bool, 3 - repeated :advanced_ocr_options, :string, 5 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - RawDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RawDocument").msgclass - GcsDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocument").msgclass - GcsDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocuments").msgclass - GcsPrefix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsPrefix").msgclass - BatchDocumentsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDocumentsInputConfig").msgclass - DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig").msgclass - DocumentOutputConfig::GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig").msgclass - DocumentOutputConfig::GcsOutputConfig::ShardingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig").msgclass - OcrConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.OcrConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb deleted file mode 100644 index daeabd9479e9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb +++ /dev/null @@ -1,332 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/documentai/v1beta3/barcode_pb' -require 'google/cloud/documentai/v1beta3/geometry_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/color_pb' -require 'google/type/date_pb' -require 'google/type/datetime_pb' -require 'google/type/money_pb' -require 'google/type/postal_address_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/document.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.Document" do - optional :mime_type, :string, 3 - optional :text, :string, 4 - repeated :text_styles, :message, 5, "google.cloud.documentai.v1beta3.Document.Style" - repeated :pages, :message, 6, "google.cloud.documentai.v1beta3.Document.Page" - repeated :entities, :message, 7, "google.cloud.documentai.v1beta3.Document.Entity" - repeated :entity_relations, :message, 8, "google.cloud.documentai.v1beta3.Document.EntityRelation" - repeated :text_changes, :message, 14, "google.cloud.documentai.v1beta3.Document.TextChange" - optional :shard_info, :message, 9, "google.cloud.documentai.v1beta3.Document.ShardInfo" - optional :error, :message, 10, "google.rpc.Status" - repeated :revisions, :message, 13, "google.cloud.documentai.v1beta3.Document.Revision" - oneof :source do - optional :uri, :string, 1 - optional :content, :bytes, 2 - end - end - add_message "google.cloud.documentai.v1beta3.Document.ShardInfo" do - optional :shard_index, :int64, 1 - optional :shard_count, :int64, 2 - optional :text_offset, :int64, 3 - end - add_message "google.cloud.documentai.v1beta3.Document.Style" do - optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" - optional :color, :message, 2, "google.type.Color" - optional :background_color, :message, 3, "google.type.Color" - optional :font_weight, :string, 4 - optional :text_style, :string, 5 - optional :text_decoration, :string, 6 - optional :font_size, :message, 7, "google.cloud.documentai.v1beta3.Document.Style.FontSize" - optional :font_family, :string, 8 - end - add_message "google.cloud.documentai.v1beta3.Document.Style.FontSize" do - optional :size, :float, 1 - optional :unit, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.Document.Page" do - optional :page_number, :int32, 1 - optional :image, :message, 13, "google.cloud.documentai.v1beta3.Document.Page.Image" - repeated :transforms, :message, 14, "google.cloud.documentai.v1beta3.Document.Page.Matrix" - optional :dimension, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Dimension" - optional :layout, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.Layout" - repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - repeated :blocks, :message, 5, "google.cloud.documentai.v1beta3.Document.Page.Block" - repeated :paragraphs, :message, 6, "google.cloud.documentai.v1beta3.Document.Page.Paragraph" - repeated :lines, :message, 7, "google.cloud.documentai.v1beta3.Document.Page.Line" - repeated :tokens, :message, 8, "google.cloud.documentai.v1beta3.Document.Page.Token" - repeated :visual_elements, :message, 9, "google.cloud.documentai.v1beta3.Document.Page.VisualElement" - repeated :tables, :message, 10, "google.cloud.documentai.v1beta3.Document.Page.Table" - repeated :form_fields, :message, 11, "google.cloud.documentai.v1beta3.Document.Page.FormField" - repeated :symbols, :message, 12, "google.cloud.documentai.v1beta3.Document.Page.Symbol" - repeated :detected_barcodes, :message, 15, "google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode" - optional :image_quality_scores, :message, 17, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores" - optional :provenance, :message, 16, "google.cloud.documentai.v1beta3.Document.Provenance" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Dimension" do - optional :width, :float, 1 - optional :height, :float, 2 - optional :unit, :string, 3 - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Image" do - optional :content, :bytes, 1 - optional :mime_type, :string, 2 - optional :width, :int32, 3 - optional :height, :int32, 4 - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Matrix" do - optional :rows, :int32, 1 - optional :cols, :int32, 2 - optional :type, :int32, 3 - optional :data, :bytes, 4 - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Layout" do - optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" - optional :confidence, :float, 2 - optional :bounding_poly, :message, 3, "google.cloud.documentai.v1beta3.BoundingPoly" - optional :orientation, :enum, 4, "google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation" - end - add_enum "google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation" do - value :ORIENTATION_UNSPECIFIED, 0 - value :PAGE_UP, 1 - value :PAGE_RIGHT, 2 - value :PAGE_DOWN, 3 - value :PAGE_LEFT, 4 - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Block" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - optional :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Paragraph" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - optional :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Line" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - optional :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Token" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - optional :detected_break, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak" - repeated :detected_languages, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - optional :provenance, :message, 4, "google.cloud.documentai.v1beta3.Document.Provenance" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak" do - optional :type, :enum, 1, "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type" - end - add_enum "google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type" do - value :TYPE_UNSPECIFIED, 0 - value :SPACE, 1 - value :WIDE_SPACE, 2 - value :HYPHEN, 3 - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Symbol" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - repeated :detected_languages, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.VisualElement" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - optional :type, :string, 2 - repeated :detected_languages, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Table" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - repeated :header_rows, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" - repeated :body_rows, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" - repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - optional :provenance, :message, 5, "google.cloud.documentai.v1beta3.Document.Provenance" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" do - repeated :cells, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Table.TableCell" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.Table.TableCell" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - optional :row_span, :int32, 2 - optional :col_span, :int32, 3 - repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.FormField" do - optional :field_name, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - optional :field_value, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Layout" - repeated :name_detected_languages, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - repeated :value_detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" - optional :value_type, :string, 5 - optional :corrected_key_text, :string, 6 - optional :corrected_value_text, :string, 7 - optional :provenance, :message, 8, "google.cloud.documentai.v1beta3.Document.Provenance" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode" do - optional :layout, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Layout" - optional :barcode, :message, 2, "google.cloud.documentai.v1beta3.Barcode" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" do - optional :language_code, :string, 1 - optional :confidence, :float, 2 - end - add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores" do - optional :quality_score, :float, 1 - repeated :detected_defects, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect" - end - add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect" do - optional :type, :string, 1 - optional :confidence, :float, 2 - end - add_message "google.cloud.documentai.v1beta3.Document.Entity" do - optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" - optional :type, :string, 2 - optional :mention_text, :string, 3 - optional :mention_id, :string, 4 - optional :confidence, :float, 5 - optional :page_anchor, :message, 6, "google.cloud.documentai.v1beta3.Document.PageAnchor" - optional :id, :string, 7 - optional :normalized_value, :message, 9, "google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue" - repeated :properties, :message, 10, "google.cloud.documentai.v1beta3.Document.Entity" - optional :provenance, :message, 11, "google.cloud.documentai.v1beta3.Document.Provenance" - optional :redacted, :bool, 12 - end - add_message "google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue" do - optional :text, :string, 1 - oneof :structured_value do - optional :money_value, :message, 2, "google.type.Money" - optional :date_value, :message, 3, "google.type.Date" - optional :datetime_value, :message, 4, "google.type.DateTime" - optional :address_value, :message, 5, "google.type.PostalAddress" - optional :boolean_value, :bool, 6 - optional :integer_value, :int32, 7 - optional :float_value, :float, 8 - end - end - add_message "google.cloud.documentai.v1beta3.Document.EntityRelation" do - optional :subject_id, :string, 1 - optional :object_id, :string, 2 - optional :relation, :string, 3 - end - add_message "google.cloud.documentai.v1beta3.Document.TextAnchor" do - repeated :text_segments, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment" - optional :content, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment" do - optional :start_index, :int64, 1 - optional :end_index, :int64, 2 - end - add_message "google.cloud.documentai.v1beta3.Document.PageAnchor" do - repeated :page_refs, :message, 1, "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef" - end - add_message "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef" do - optional :page, :int64, 1 - optional :layout_type, :enum, 2, "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType" - optional :layout_id, :string, 3 - optional :bounding_poly, :message, 4, "google.cloud.documentai.v1beta3.BoundingPoly" - optional :confidence, :float, 5 - end - add_enum "google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType" do - value :LAYOUT_TYPE_UNSPECIFIED, 0 - value :BLOCK, 1 - value :PARAGRAPH, 2 - value :LINE, 3 - value :TOKEN, 4 - value :VISUAL_ELEMENT, 5 - value :TABLE, 6 - value :FORM_FIELD, 7 - end - add_message "google.cloud.documentai.v1beta3.Document.Provenance" do - optional :revision, :int32, 1 - optional :id, :int32, 2 - repeated :parents, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance.Parent" - optional :type, :enum, 4, "google.cloud.documentai.v1beta3.Document.Provenance.OperationType" - end - add_message "google.cloud.documentai.v1beta3.Document.Provenance.Parent" do - optional :revision, :int32, 1 - optional :index, :int32, 3 - optional :id, :int32, 2 - end - add_enum "google.cloud.documentai.v1beta3.Document.Provenance.OperationType" do - value :OPERATION_TYPE_UNSPECIFIED, 0 - value :ADD, 1 - value :REMOVE, 2 - value :REPLACE, 3 - value :EVAL_REQUESTED, 4 - value :EVAL_APPROVED, 5 - value :EVAL_SKIPPED, 6 - end - add_message "google.cloud.documentai.v1beta3.Document.Revision" do - optional :id, :string, 1 - repeated :parent, :int32, 2 - repeated :parent_ids, :string, 7 - optional :create_time, :message, 3, "google.protobuf.Timestamp" - optional :human_review, :message, 6, "google.cloud.documentai.v1beta3.Document.Revision.HumanReview" - oneof :source do - optional :agent, :string, 4 - optional :processor, :string, 5 - end - end - add_message "google.cloud.documentai.v1beta3.Document.Revision.HumanReview" do - optional :state, :string, 1 - optional :state_message, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.Document.TextChange" do - optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" - optional :changed_text, :string, 2 - repeated :provenance, :message, 3, "google.cloud.documentai.v1beta3.Document.Provenance" - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document").msgclass - Document::ShardInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.ShardInfo").msgclass - Document::Style = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style").msgclass - Document::Style::FontSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Style.FontSize").msgclass - Document::Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page").msgclass - Document::Page::Dimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Dimension").msgclass - Document::Page::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Image").msgclass - Document::Page::Matrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Matrix").msgclass - Document::Page::Layout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout").msgclass - Document::Page::Layout::Orientation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation").enummodule - Document::Page::Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Block").msgclass - Document::Page::Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Paragraph").msgclass - Document::Page::Line = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Line").msgclass - Document::Page::Token = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token").msgclass - Document::Page::Token::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak").msgclass - Document::Page::Token::DetectedBreak::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type").enummodule - Document::Page::Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Symbol").msgclass - Document::Page::VisualElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.VisualElement").msgclass - Document::Page::Table = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table").msgclass - Document::Page::Table::TableRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableRow").msgclass - Document::Page::Table::TableCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.Table.TableCell").msgclass - Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.FormField").msgclass - Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode").msgclass - Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage").msgclass - Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores").msgclass - Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect").msgclass - Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity").msgclass - Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue").msgclass - Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.EntityRelation").msgclass - Document::TextAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor").msgclass - Document::TextAnchor::TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment").msgclass - Document::PageAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor").msgclass - Document::PageAnchor::PageRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef").msgclass - Document::PageAnchor::PageRef::LayoutType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType").enummodule - Document::Provenance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance").msgclass - Document::Provenance::Parent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.Parent").msgclass - Document::Provenance::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Provenance.OperationType").enummodule - Document::Revision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision").msgclass - Document::Revision::HumanReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Revision.HumanReview").msgclass - Document::TextChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextChange").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb deleted file mode 100644 index 5bd3f7760f63..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +++ /dev/null @@ -1,352 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document_processor_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/documentai/v1beta3/document_pb' -require 'google/cloud/documentai/v1beta3/document_io_pb' -require 'google/cloud/documentai/v1beta3/document_schema_pb' -require 'google/cloud/documentai/v1beta3/evaluation_pb' -require 'google/cloud/documentai/v1beta3/operation_metadata_pb' -require 'google/cloud/documentai/v1beta3/processor_pb' -require 'google/cloud/documentai/v1beta3/processor_type_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/document_processor_service.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.ProcessOptions" do - optional :ocr_config, :message, 1, "google.cloud.documentai.v1beta3.OcrConfig" - end - add_message "google.cloud.documentai.v1beta3.ProcessRequest" do - optional :name, :string, 1 - optional :document, :message, 2, "google.cloud.documentai.v1beta3.Document" - optional :skip_human_review, :bool, 3 - optional :field_mask, :message, 6, "google.protobuf.FieldMask" - optional :process_options, :message, 7, "google.cloud.documentai.v1beta3.ProcessOptions" - oneof :source do - optional :inline_document, :message, 4, "google.cloud.documentai.v1beta3.Document" - optional :raw_document, :message, 5, "google.cloud.documentai.v1beta3.RawDocument" - end - end - add_message "google.cloud.documentai.v1beta3.HumanReviewStatus" do - optional :state, :enum, 1, "google.cloud.documentai.v1beta3.HumanReviewStatus.State" - optional :state_message, :string, 2 - optional :human_review_operation, :string, 3 - end - add_enum "google.cloud.documentai.v1beta3.HumanReviewStatus.State" do - value :STATE_UNSPECIFIED, 0 - value :SKIPPED, 1 - value :VALIDATION_PASSED, 2 - value :IN_PROGRESS, 3 - value :ERROR, 4 - end - add_message "google.cloud.documentai.v1beta3.ProcessResponse" do - optional :document, :message, 1, "google.cloud.documentai.v1beta3.Document" - optional :human_review_operation, :string, 2 - optional :human_review_status, :message, 3, "google.cloud.documentai.v1beta3.HumanReviewStatus" - end - add_message "google.cloud.documentai.v1beta3.BatchProcessRequest" do - optional :name, :string, 1 - repeated :input_configs, :message, 2, "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig" - optional :output_config, :message, 3, "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig" - optional :input_documents, :message, 5, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" - optional :document_output_config, :message, 6, "google.cloud.documentai.v1beta3.DocumentOutputConfig" - optional :skip_human_review, :bool, 4 - optional :process_options, :message, 7, "google.cloud.documentai.v1beta3.ProcessOptions" - end - add_message "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig" do - optional :gcs_source, :string, 1 - optional :mime_type, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig" do - optional :gcs_destination, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.BatchProcessResponse" do - end - add_message "google.cloud.documentai.v1beta3.BatchProcessMetadata" do - optional :state, :enum, 1, "google.cloud.documentai.v1beta3.BatchProcessMetadata.State" - optional :state_message, :string, 2 - optional :create_time, :message, 3, "google.protobuf.Timestamp" - optional :update_time, :message, 4, "google.protobuf.Timestamp" - repeated :individual_process_statuses, :message, 5, "google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus" - end - add_message "google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus" do - optional :input_gcs_source, :string, 1 - optional :status, :message, 2, "google.rpc.Status" - optional :output_gcs_destination, :string, 3 - optional :human_review_operation, :string, 4 - optional :human_review_status, :message, 5, "google.cloud.documentai.v1beta3.HumanReviewStatus" - end - add_enum "google.cloud.documentai.v1beta3.BatchProcessMetadata.State" do - value :STATE_UNSPECIFIED, 0 - value :WAITING, 1 - value :RUNNING, 2 - value :SUCCEEDED, 3 - value :CANCELLING, 4 - value :CANCELLED, 5 - value :FAILED, 6 - end - add_message "google.cloud.documentai.v1beta3.FetchProcessorTypesRequest" do - optional :parent, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.FetchProcessorTypesResponse" do - repeated :processor_types, :message, 1, "google.cloud.documentai.v1beta3.ProcessorType" - end - add_message "google.cloud.documentai.v1beta3.ListProcessorTypesRequest" do - optional :parent, :string, 1 - optional :page_size, :int32, 2 - optional :page_token, :string, 3 - end - add_message "google.cloud.documentai.v1beta3.ListProcessorTypesResponse" do - repeated :processor_types, :message, 1, "google.cloud.documentai.v1beta3.ProcessorType" - optional :next_page_token, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.ListProcessorsRequest" do - optional :parent, :string, 1 - optional :page_size, :int32, 2 - optional :page_token, :string, 3 - end - add_message "google.cloud.documentai.v1beta3.ListProcessorsResponse" do - repeated :processors, :message, 1, "google.cloud.documentai.v1beta3.Processor" - optional :next_page_token, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.GetProcessorTypeRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.GetProcessorRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.GetProcessorVersionRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.ListProcessorVersionsRequest" do - optional :parent, :string, 1 - optional :page_size, :int32, 2 - optional :page_token, :string, 3 - end - add_message "google.cloud.documentai.v1beta3.ListProcessorVersionsResponse" do - repeated :processor_versions, :message, 1, "google.cloud.documentai.v1beta3.ProcessorVersion" - optional :next_page_token, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata" do - optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.DeployProcessorVersionRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.DeployProcessorVersionResponse" do - end - add_message "google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata" do - optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse" do - end - add_message "google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata" do - optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.CreateProcessorRequest" do - optional :parent, :string, 1 - optional :processor, :message, 2, "google.cloud.documentai.v1beta3.Processor" - end - add_message "google.cloud.documentai.v1beta3.DeleteProcessorRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.DeleteProcessorMetadata" do - optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.EnableProcessorRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.EnableProcessorResponse" do - end - add_message "google.cloud.documentai.v1beta3.EnableProcessorMetadata" do - optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.DisableProcessorRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.DisableProcessorResponse" do - end - add_message "google.cloud.documentai.v1beta3.DisableProcessorMetadata" do - optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest" do - optional :processor, :string, 1 - optional :default_processor_version, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse" do - end - add_message "google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata" do - optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest" do - optional :parent, :string, 1 - optional :processor_version, :message, 2, "google.cloud.documentai.v1beta3.ProcessorVersion" - optional :document_schema, :message, 10, "google.cloud.documentai.v1beta3.DocumentSchema" - optional :input_data, :message, 4, "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" - optional :base_processor_version, :string, 8 - end - add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" do - optional :training_documents, :message, 3, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" - optional :test_documents, :message, 4, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" - end - add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionResponse" do - optional :processor_version, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata" do - optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - optional :training_dataset_validation, :message, 2, "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" - optional :test_dataset_validation, :message, 3, "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" - end - add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" do - optional :document_error_count, :int32, 3 - optional :dataset_error_count, :int32, 4 - repeated :document_errors, :message, 1, "google.rpc.Status" - repeated :dataset_errors, :message, 2, "google.rpc.Status" - end - add_message "google.cloud.documentai.v1beta3.ReviewDocumentRequest" do - optional :human_review_config, :string, 1 - optional :document, :message, 2, "google.cloud.documentai.v1beta3.Document" - optional :enable_schema_validation, :bool, 3 - optional :priority, :enum, 5, "google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority" - optional :document_schema, :message, 6, "google.cloud.documentai.v1beta3.DocumentSchema" - oneof :source do - optional :inline_document, :message, 4, "google.cloud.documentai.v1beta3.Document" - end - end - add_enum "google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority" do - value :DEFAULT, 0 - value :URGENT, 1 - end - add_message "google.cloud.documentai.v1beta3.ReviewDocumentResponse" do - optional :gcs_destination, :string, 1 - optional :state, :enum, 2, "google.cloud.documentai.v1beta3.ReviewDocumentResponse.State" - optional :rejection_reason, :string, 3 - end - add_enum "google.cloud.documentai.v1beta3.ReviewDocumentResponse.State" do - value :STATE_UNSPECIFIED, 0 - value :REJECTED, 1 - value :SUCCEEDED, 2 - end - add_message "google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata" do - optional :state, :enum, 1, "google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State" - optional :state_message, :string, 2 - optional :create_time, :message, 3, "google.protobuf.Timestamp" - optional :update_time, :message, 4, "google.protobuf.Timestamp" - optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - optional :question_id, :string, 6 - end - add_enum "google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State" do - value :STATE_UNSPECIFIED, 0 - value :RUNNING, 1 - value :CANCELLING, 2 - value :SUCCEEDED, 3 - value :FAILED, 4 - value :CANCELLED, 5 - end - add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest" do - optional :processor_version, :string, 1 - optional :evaluation_documents, :message, 3, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" - end - add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata" do - optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" - end - add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse" do - optional :evaluation, :string, 2 - end - add_message "google.cloud.documentai.v1beta3.GetEvaluationRequest" do - optional :name, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.ListEvaluationsRequest" do - optional :parent, :string, 1 - optional :page_size, :int32, 2 - optional :page_token, :string, 3 - end - add_message "google.cloud.documentai.v1beta3.ListEvaluationsResponse" do - repeated :evaluations, :message, 1, "google.cloud.documentai.v1beta3.Evaluation" - optional :next_page_token, :string, 2 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - ProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessOptions").msgclass - ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessRequest").msgclass - HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus").msgclass - HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus.State").enummodule - ProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessResponse").msgclass - BatchProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest").msgclass - BatchProcessRequest::BatchInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig").msgclass - BatchProcessRequest::BatchOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig").msgclass - BatchProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessResponse").msgclass - BatchProcessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata").msgclass - BatchProcessMetadata::IndividualProcessStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus").msgclass - BatchProcessMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessMetadata.State").enummodule - FetchProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesRequest").msgclass - FetchProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.FetchProcessorTypesResponse").msgclass - ListProcessorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesRequest").msgclass - ListProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorTypesResponse").msgclass - ListProcessorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsRequest").msgclass - ListProcessorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorsResponse").msgclass - GetProcessorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorTypeRequest").msgclass - GetProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorRequest").msgclass - GetProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetProcessorVersionRequest").msgclass - ListProcessorVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsRequest").msgclass - ListProcessorVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListProcessorVersionsResponse").msgclass - DeleteProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest").msgclass - DeleteProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata").msgclass - DeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionRequest").msgclass - DeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionResponse").msgclass - DeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata").msgclass - UndeployProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest").msgclass - UndeployProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse").msgclass - UndeployProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata").msgclass - CreateProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CreateProcessorRequest").msgclass - DeleteProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorRequest").msgclass - DeleteProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DeleteProcessorMetadata").msgclass - EnableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorRequest").msgclass - EnableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorResponse").msgclass - EnableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EnableProcessorMetadata").msgclass - DisableProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorRequest").msgclass - DisableProcessorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorResponse").msgclass - DisableProcessorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DisableProcessorMetadata").msgclass - SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest").msgclass - SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse").msgclass - SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata").msgclass - TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest").msgclass - TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData").msgclass - TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionResponse").msgclass - TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata").msgclass - TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation").msgclass - ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest").msgclass - ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority").enummodule - ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse").msgclass - ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse.State").enummodule - ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata").msgclass - ReviewDocumentOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State").enummodule - EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest").msgclass - EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata").msgclass - EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse").msgclass - GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetEvaluationRequest").msgclass - ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsRequest").msgclass - ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb deleted file mode 100644 index 1fc786835088..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +++ /dev/null @@ -1,103 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/documentai/v1beta3/document_processor_service.proto for package 'Google.Cloud.DocumentAI.V1beta3' -# Original file comments: -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/documentai/v1beta3/document_processor_service_pb' - -module Google - module Cloud - module DocumentAI - module V1beta3 - module DocumentProcessorService - # Service to call Cloud DocumentAI to process documents according to the - # processor's definition. Processors are built using state-of-the-art Google - # AI such as natural language, computer vision, and translation to extract - # structured information from unstructured or semi-structured documents. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.documentai.v1beta3.DocumentProcessorService' - - # Processes a single document. - rpc :ProcessDocument, ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse - # LRO endpoint to batch process many documents. The output is written - # to Cloud Storage as JSON in the [Document] format. - rpc :BatchProcessDocuments, ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Google::Longrunning::Operation - # Fetches processor types. Note that we do not use ListProcessorTypes here - # because it is not paginated. - rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse - # Lists the processor types that exist. - rpc :ListProcessorTypes, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse - # Gets a processor type detail. - rpc :GetProcessorType, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorType - # Lists all processors which belong to this project. - rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse - # Gets a processor detail. - rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor - # Trains a new processor version. - # Operation metadata is returned as - # cloud_documentai_core.TrainProcessorVersionMetadata. - rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Google::Longrunning::Operation - # Gets a processor version detail. - rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion - # Lists all versions of a processor. - rpc :ListProcessorVersions, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse - # Deletes the processor version, all artifacts under the processor version - # will be deleted. - rpc :DeleteProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Google::Longrunning::Operation - # Deploys the processor version. - rpc :DeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Google::Longrunning::Operation - # Undeploys the processor version. - rpc :UndeployProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Google::Longrunning::Operation - # Creates a processor from the type processor that the user chose. - # The processor will be at "ENABLED" state by default after its creation. - rpc :CreateProcessor, ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor - # Deletes the processor, unloads all deployed model artifacts if it was - # enabled and then deletes all artifacts associated with this processor. - rpc :DeleteProcessor, ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Google::Longrunning::Operation - # Enables a processor - rpc :EnableProcessor, ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Google::Longrunning::Operation - # Disables a processor - rpc :DisableProcessor, ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Google::Longrunning::Operation - # Set the default (active) version of a - # [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in - # [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] - # and - # [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. - rpc :SetDefaultProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Google::Longrunning::Operation - # Send a document for Human Review. The input document should be processed by - # the specified processor. - rpc :ReviewDocument, ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Google::Longrunning::Operation - # Evaluates a ProcessorVersion against annotated documents, producing an - # Evaluation. - rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation - # Retrieves a specific evaluation. - rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1beta3::Evaluation - # Retrieves a set of evaluations for a given processor version. - rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb deleted file mode 100644 index 0c49482c6eb2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/document_schema.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/document_schema.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.DocumentSchema" do - optional :display_name, :string, 1 - optional :description, :string, 2 - repeated :entity_types, :message, 3, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType" - optional :metadata, :message, 4, "google.cloud.documentai.v1beta3.DocumentSchema.Metadata" - end - add_message "google.cloud.documentai.v1beta3.DocumentSchema.EntityType" do - optional :display_name, :string, 13 - optional :name, :string, 1 - repeated :base_types, :string, 2 - repeated :properties, :message, 6, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property" - oneof :value_source do - optional :enum_values, :message, 14, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues" - end - end - add_message "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues" do - repeated :values, :string, 1 - end - add_message "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property" do - optional :name, :string, 1 - optional :value_type, :string, 2 - optional :occurrence_type, :enum, 3, "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType" - end - add_enum "google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType" do - value :OCCURRENCE_TYPE_UNSPECIFIED, 0 - value :OPTIONAL_ONCE, 1 - value :OPTIONAL_MULTIPLE, 2 - value :REQUIRED_ONCE, 3 - value :REQUIRED_MULTIPLE, 4 - end - add_message "google.cloud.documentai.v1beta3.DocumentSchema.Metadata" do - optional :document_splitter, :bool, 1 - optional :document_allow_multiple_labels, :bool, 2 - optional :prefixed_naming_on_properties, :bool, 6 - optional :skip_naming_validation, :bool, 7 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - DocumentSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema").msgclass - DocumentSchema::EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType").msgclass - DocumentSchema::EntityType::EnumValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues").msgclass - DocumentSchema::EntityType::Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property").msgclass - DocumentSchema::EntityType::Property::OccurrenceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType").enummodule - DocumentSchema::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentSchema.Metadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb deleted file mode 100644 index a0aacac71687..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/evaluation.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/evaluation.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.Evaluation" do - optional :name, :string, 1 - optional :create_time, :message, 2, "google.protobuf.Timestamp" - optional :document_counters, :message, 5, "google.cloud.documentai.v1beta3.Evaluation.Counters" - optional :all_entities_metrics, :message, 3, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" - map :entity_metrics, :string, :message, 4, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" - optional :kms_key_name, :string, 6 - optional :kms_key_version_name, :string, 7 - end - add_message "google.cloud.documentai.v1beta3.Evaluation.Counters" do - optional :input_documents_count, :int32, 1 - optional :invalid_documents_count, :int32, 2 - optional :failed_documents_count, :int32, 3 - optional :evaluated_documents_count, :int32, 4 - end - add_message "google.cloud.documentai.v1beta3.Evaluation.Metrics" do - optional :precision, :float, 1 - optional :recall, :float, 2 - optional :f1_score, :float, 3 - optional :predicted_occurrences_count, :int32, 4 - optional :ground_truth_occurrences_count, :int32, 5 - optional :predicted_document_count, :int32, 10 - optional :ground_truth_document_count, :int32, 11 - optional :true_positives_count, :int32, 6 - optional :false_positives_count, :int32, 7 - optional :false_negatives_count, :int32, 8 - optional :total_documents_count, :int32, 9 - end - add_message "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" do - optional :confidence_level, :float, 1 - optional :metrics, :message, 2, "google.cloud.documentai.v1beta3.Evaluation.Metrics" - end - add_message "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" do - repeated :confidence_level_metrics, :message, 1, "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" - repeated :confidence_level_metrics_exact, :message, 4, "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" - optional :auprc, :float, 2 - optional :estimated_calibration_error, :float, 3 - optional :auprc_exact, :float, 5 - optional :estimated_calibration_error_exact, :float, 6 - optional :metrics_type, :enum, 7, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType" - end - add_enum "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType" do - value :METRICS_TYPE_UNSPECIFIED, 0 - value :AGGREGATE, 1 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation").msgclass - Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Counters").msgclass - Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Metrics").msgclass - Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics").msgclass - Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics").msgclass - Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb deleted file mode 100644 index 8f0daac3bc3d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/geometry_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/geometry.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/geometry.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.Vertex" do - optional :x, :int32, 1 - optional :y, :int32, 2 - end - add_message "google.cloud.documentai.v1beta3.NormalizedVertex" do - optional :x, :float, 1 - optional :y, :float, 2 - end - add_message "google.cloud.documentai.v1beta3.BoundingPoly" do - repeated :vertices, :message, 1, "google.cloud.documentai.v1beta3.Vertex" - repeated :normalized_vertices, :message, 2, "google.cloud.documentai.v1beta3.NormalizedVertex" - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Vertex").msgclass - NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.NormalizedVertex").msgclass - BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BoundingPoly").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb deleted file mode 100644 index d63483a7c733..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/operation_metadata.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/operation_metadata.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.CommonOperationMetadata" do - optional :state, :enum, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata.State" - optional :state_message, :string, 2 - optional :resource, :string, 5 - optional :create_time, :message, 3, "google.protobuf.Timestamp" - optional :update_time, :message, 4, "google.protobuf.Timestamp" - end - add_enum "google.cloud.documentai.v1beta3.CommonOperationMetadata.State" do - value :STATE_UNSPECIFIED, 0 - value :RUNNING, 1 - value :CANCELLING, 2 - value :SUCCEEDED, 3 - value :FAILED, 4 - value :CANCELLED, 5 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - CommonOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata").msgclass - CommonOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb deleted file mode 100644 index 4989e6d25e9a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/processor.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/documentai/v1beta3/document_schema_pb' -require 'google/protobuf/timestamp_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/processor.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.ProcessorVersion" do - optional :name, :string, 1 - optional :display_name, :string, 2 - optional :document_schema, :message, 12, "google.cloud.documentai.v1beta3.DocumentSchema" - optional :state, :enum, 6, "google.cloud.documentai.v1beta3.ProcessorVersion.State" - optional :create_time, :message, 7, "google.protobuf.Timestamp" - optional :kms_key_name, :string, 9 - optional :kms_key_version_name, :string, 10 - optional :google_managed, :bool, 11 - optional :deprecation_info, :message, 13, "google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo" - end - add_message "google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo" do - optional :deprecation_time, :message, 1, "google.protobuf.Timestamp" - optional :replacement_processor_version, :string, 2 - end - add_enum "google.cloud.documentai.v1beta3.ProcessorVersion.State" do - value :STATE_UNSPECIFIED, 0 - value :DEPLOYED, 1 - value :DEPLOYING, 2 - value :UNDEPLOYED, 3 - value :UNDEPLOYING, 4 - value :CREATING, 5 - value :DELETING, 6 - value :FAILED, 7 - end - add_message "google.cloud.documentai.v1beta3.Processor" do - optional :name, :string, 1 - optional :type, :string, 2 - optional :display_name, :string, 3 - optional :state, :enum, 4, "google.cloud.documentai.v1beta3.Processor.State" - optional :default_processor_version, :string, 9 - optional :process_endpoint, :string, 6 - optional :create_time, :message, 7, "google.protobuf.Timestamp" - optional :kms_key_name, :string, 8 - end - add_enum "google.cloud.documentai.v1beta3.Processor.State" do - value :STATE_UNSPECIFIED, 0 - value :ENABLED, 1 - value :DISABLED, 2 - value :ENABLING, 3 - value :DISABLING, 4 - value :CREATING, 5 - value :FAILED, 6 - value :DELETING, 7 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - ProcessorVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion").msgclass - ProcessorVersion::DeprecationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo").msgclass - ProcessorVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorVersion.State").enummodule - Processor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor").msgclass - Processor::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Processor.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb deleted file mode 100644 index abeaa4eb4964..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai/v1beta3/processor_type.proto - -require 'google/protobuf' - -require 'google/api/launch_stage_pb' -require 'google/api/resource_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/documentai/v1beta3/processor_type.proto", :syntax => :proto3) do - add_message "google.cloud.documentai.v1beta3.ProcessorType" do - optional :name, :string, 1 - optional :type, :string, 2 - optional :category, :string, 3 - repeated :available_locations, :message, 4, "google.cloud.documentai.v1beta3.ProcessorType.LocationInfo" - optional :allow_creation, :bool, 6 - optional :launch_stage, :enum, 8, "google.api.LaunchStage" - repeated :sample_document_uris, :string, 9 - end - add_message "google.cloud.documentai.v1beta3.ProcessorType.LocationInfo" do - optional :location_id, :string, 1 - end - end -end - -module Google - module Cloud - module DocumentAI - module V1beta3 - ProcessorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType").msgclass - ProcessorType::LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType.LocationInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md deleted file mode 100644 index 9445d5bb62be..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Document AI V1beta3 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb deleted file mode 100644 index 763d8b39a50a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,318 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. - # @!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 place that API 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. - 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. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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_behavior: - # - selector: CreateAdDomain - # long_running: - # initial_poll_delay: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index ca8d9e343c83..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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 - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 173c5c85f5dc..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb deleted file mode 100644 index 522e181c4702..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same - # concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb deleted file mode 100644 index 1d305e47d2b8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Encodes the detailed information of a barcode. - # @!attribute [rw] format - # @return [::String] - # Format of a barcode. - # The supported formats are: - # - # - `CODE_128`: Code 128 type. - # - `CODE_39`: Code 39 type. - # - `CODE_93`: Code 93 type. - # - `CODABAR`: Codabar type. - # - `DATA_MATRIX`: 2D Data Matrix type. - # - `ITF`: ITF type. - # - `EAN_13`: EAN-13 type. - # - `EAN_8`: EAN-8 type. - # - `QR_CODE`: 2D QR code type. - # - `UPC_A`: UPC-A type. - # - `UPC_E`: UPC-E type. - # - `PDF417`: PDF417 type. - # - `AZTEC`: 2D Aztec code type. - # - `DATABAR`: GS1 DataBar code type. - # @!attribute [rw] value_format - # @return [::String] - # Value format describes the format of the value that a barcode - # encodes. - # The supported formats are: - # - # - `CONTACT_INFO`: Contact information. - # - `EMAIL`: Email address. - # - `ISBN`: ISBN identifier. - # - `PHONE`: Phone number. - # - `PRODUCT`: Product. - # - `SMS`: SMS message. - # - `TEXT`: Text string. - # - `URL`: URL address. - # - `WIFI`: Wifi information. - # - `GEO`: Geo-localization. - # - `CALENDAR_EVENT`: Calendar event. - # - `DRIVER_LICENSE`: Driver's license. - # @!attribute [rw] raw_value - # @return [::String] - # Raw value encoded in the barcode. - # For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - class Barcode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb deleted file mode 100644 index e1f285a84ad5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb +++ /dev/null @@ -1,969 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Document represents the canonical document resource in Document AI. It is an - # interchange format that provides insights into documents and allows for - # collaboration between users and Document AI to iterate and optimize for - # quality. - # @!attribute [rw] uri - # @return [::String] - # Optional. Currently supports Google Cloud Storage URI of the form - # `gs://bucket_name/object_name`. Object versioning is not supported. - # See [Google Cloud Storage Request - # URIs](https://cloud.google.com/storage/docs/reference-uris) for more - # info. - # @!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 MIME type (also referred to as media type). For more - # information, see - # https://www.iana.org/assignments/media-types/media-types.xhtml. - # @!attribute [rw] text - # @return [::String] - # Optional. UTF-8 encoded text in reading order from the document. - # @!attribute [rw] text_styles - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Style>] - # Styles for the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] pages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page>] - # Visual page layout for the - # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] - # A list of entities detected on - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. For - # document shards, entities in this list may cross shard boundaries. - # @!attribute [rw] entity_relations - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::EntityRelation>] - # Placeholder. Relationship among - # {::Google::Cloud::DocumentAI::V1beta3::Document#entities Document.entities}. - # @!attribute [rw] text_changes - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextChange>] - # Placeholder. A list of text corrections made to - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. This is - # usually used for annotating corrections to OCR mistakes. Text changes for - # a given revision may not overlap with each other. - # @!attribute [rw] shard_info - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo] - # Information about the sharding if this document is sharded part of a larger - # document. If the document is not sharded, this message is not specified. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Any error that occurred while processing this document. - # @!attribute [rw] revisions - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Revision>] - # Placeholder. Revision history of this document. - class Document - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # For a large document, sharding may be performed to produce several - # document shards. Each document shard contains this field to detail which - # shard it is. - # @!attribute [rw] shard_index - # @return [::Integer] - # The 0-based index of this shard. - # @!attribute [rw] shard_count - # @return [::Integer] - # Total number of shards. - # @!attribute [rw] text_offset - # @return [::Integer] - # The index of the first character in - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text} in the - # overall document global text. - class ShardInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Annotation for common text style attributes. This adheres to CSS - # conventions as much as possible. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] color - # @return [::Google::Type::Color] - # Text color. - # @!attribute [rw] background_color - # @return [::Google::Type::Color] - # Text background color. - # @!attribute [rw] font_weight - # @return [::String] - # Font weight. Possible values are normal, bold, bolder, and lighter. - # https://www.w3schools.com/cssref/pr_font_weight.asp - # @!attribute [rw] text_style - # @return [::String] - # Text style. Possible values are normal, italic, and oblique. - # https://www.w3schools.com/cssref/pr_font_font-style.asp - # @!attribute [rw] text_decoration - # @return [::String] - # Text decoration. Follows CSS standard. - # - # https://www.w3schools.com/cssref/pr_text_text-decoration.asp - # @!attribute [rw] font_size - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Style::FontSize] - # Font size. - # @!attribute [rw] font_family - # @return [::String] - # Font family such as `Arial`, `Times New Roman`. - # https://www.w3schools.com/cssref/pr_font_font-family.asp - class Style - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Font size with unit. - # @!attribute [rw] size - # @return [::Float] - # Font size for the text. - # @!attribute [rw] unit - # @return [::String] - # Unit for the font size. Follows CSS naming (in, px, pt, etc.). - class FontSize - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A page in a {::Google::Cloud::DocumentAI::V1beta3::Document Document}. - # @!attribute [rw] page_number - # @return [::Integer] - # 1-based index for current - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page Page} in a parent - # {::Google::Cloud::DocumentAI::V1beta3::Document Document}. Useful when a page - # is taken out of a {::Google::Cloud::DocumentAI::V1beta3::Document Document} - # for individual processing. - # @!attribute [rw] image - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Image] - # Rendered image for this page. This image is preprocessed to remove any - # skew, rotation, and distortions such that the annotation bounding boxes - # can be upright and axis-aligned. - # @!attribute [rw] transforms - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Matrix>] - # Transformation matrices that were applied to the original document image - # to produce - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#image Page.image}. - # @!attribute [rw] dimension - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Dimension] - # Physical dimension of the page. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the - # page. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] blocks - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block>] - # A list of visually detected text blocks on the page. - # A block has a set of lines (collected into paragraphs) that have a common - # line-spacing and orientation. - # @!attribute [rw] paragraphs - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph>] - # A list of visually detected text paragraphs on the page. - # A collection of lines that a human would perceive as a paragraph. - # @!attribute [rw] lines - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line>] - # A list of visually detected text lines on the page. - # A collection of tokens that a human would perceive as a line. - # @!attribute [rw] tokens - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token>] - # A list of visually detected tokens on the page. - # @!attribute [rw] visual_elements - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement>] - # A list of detected non-text visual elements e.g. checkbox, - # signature etc. on the page. - # @!attribute [rw] tables - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table>] - # A list of visually detected tables on the page. - # @!attribute [rw] form_fields - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField>] - # A list of visually detected form fields on the page. - # @!attribute [rw] symbols - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol>] - # A list of visually detected symbols on the page. - # @!attribute [rw] detected_barcodes - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode>] - # A list of detected barcodes. - # @!attribute [rw] image_quality_scores - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores] - # Image Quality Scores. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this page. - class Page - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Dimension for the page. - # @!attribute [rw] width - # @return [::Float] - # Page width. - # @!attribute [rw] height - # @return [::Float] - # Page height. - # @!attribute [rw] unit - # @return [::String] - # Dimension unit. - class Dimension - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Rendered image contents for this page. - # @!attribute [rw] content - # @return [::String] - # Raw byte content of the image. - # @!attribute [rw] mime_type - # @return [::String] - # Encoding mime type for the image. - # @!attribute [rw] width - # @return [::Integer] - # Width of the image in pixels. - # @!attribute [rw] height - # @return [::Integer] - # Height of the image in pixels. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Representation for transformation matrix, intended to be compatible and - # used with OpenCV format for image manipulation. - # @!attribute [rw] rows - # @return [::Integer] - # Number of rows in the matrix. - # @!attribute [rw] cols - # @return [::Integer] - # Number of columns in the matrix. - # @!attribute [rw] type - # @return [::Integer] - # This encodes information about what data type the matrix uses. - # For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - # of OpenCV primitive data types, please refer to - # https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - # @!attribute [rw] data - # @return [::String] - # The matrix data. - class Matrix - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Visual element describing a layout unit on a page. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the current - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} within - # context of the object this layout is for. e.g. confidence can be for a - # single token, a table, a visual element, etc. depending on context. - # Range `[0, 1]`. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] - # The bounding polygon for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. - # @!attribute [rw] orientation - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout::Orientation] - # Detected orientation for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. - class Layout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Detected human reading orientation. - module Orientation - # Unspecified orientation. - ORIENTATION_UNSPECIFIED = 0 - - # Orientation is aligned with page up. - PAGE_UP = 1 - - # Orientation is aligned with page right. - # Turn the head 90 degrees clockwise from upright to read. - PAGE_RIGHT = 2 - - # Orientation is aligned with page down. - # Turn the head 180 degrees from upright to read. - PAGE_DOWN = 3 - - # Orientation is aligned with page left. - # Turn the head 90 degrees counterclockwise from upright to read. - PAGE_LEFT = 4 - end - end - - # A block has a set of lines (collected into paragraphs) that have a - # common line-spacing and orientation. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block Block}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class Block - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of lines that a human would perceive as a paragraph. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph Paragraph}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class Paragraph - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of tokens that a human would perceive as a line. - # Does not cross column boundaries, can be horizontal, vertical, etc. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line Line}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class Line - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A detected token. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. - # @!attribute [rw] detected_break - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak] - # Detected break at the end of a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class Token - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Detected break at the end of a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}. - # @!attribute [rw] type - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak::Type] - # Detected break type. - class DetectedBreak - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to denote the type of break found. - module Type - # Unspecified break type. - TYPE_UNSPECIFIED = 0 - - # A single whitespace. - SPACE = 1 - - # A wider whitespace. - WIDE_SPACE = 2 - - # A hyphen that indicates that a token has been split across lines. - HYPHEN = 3 - end - end - end - - # A detected symbol. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Symbol Symbol}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - class Symbol - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detected non-text visual elements e.g. checkbox, signature etc. on the - # page. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. - # @!attribute [rw] type - # @return [::String] - # Type of the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - class VisualElement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A table representation similar to HTML table structure. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table Table}. - # @!attribute [rw] header_rows - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] - # Header rows of the table. - # @!attribute [rw] body_rows - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>] - # Body rows of the table. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this table. - class Table - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A row of table cells. - # @!attribute [rw] cells - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell>] - # Cells that make up this row. - class TableRow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A cell representation inside the table. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell TableCell}. - # @!attribute [rw] row_span - # @return [::Integer] - # How many rows this cell spans. - # @!attribute [rw] col_span - # @return [::Integer] - # How many columns this cell spans. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages together with confidence. - class TableCell - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A form field detected on the page. - # @!attribute [rw] field_name - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} - # name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - # @!attribute [rw] field_value - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} - # value. - # @!attribute [rw] name_detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages for name together with confidence. - # @!attribute [rw] value_detected_languages - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] - # A list of detected languages for value together with confidence. - # @!attribute [rw] value_type - # @return [::String] - # If the value is non-textual, this field represents the type. Current - # valid values are: - # - # - blank (this indicates the `field_value` is normal text) - # - `unfilled_checkbox` - # - `filled_checkbox` - # @!attribute [rw] corrected_key_text - # @return [::String] - # Created for Labeling UI to export key text. - # If corrections were made to the text identified by the - # `field_name.text_anchor`, this field will contain the correction. - # @!attribute [rw] corrected_value_text - # @return [::String] - # Created for Labeling UI to export value text. - # If corrections were made to the text identified by the - # `field_value.text_anchor`, this field will contain the correction. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. - class FormField - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A detected barcode. - # @!attribute [rw] layout - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout] - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. - # @!attribute [rw] barcode - # @return [::Google::Cloud::DocumentAI::V1beta3::Barcode] - # Detailed barcode information of the - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode DetectedBarcode}. - class DetectedBarcode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detected language for a structural component. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as `en-US` or `sr-Latn`. For more - # information, see - # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of detected language. Range `[0, 1]`. - class DetectedLanguage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Image Quality Scores for the page image - # @!attribute [rw] quality_score - # @return [::Float] - # The overall quality score. Range `[0, 1]` where 1 is perfect quality. - # @!attribute [rw] detected_defects - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores::DetectedDefect>] - # A list of detected defects. - class ImageQualityScores - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Image Quality Defects - # @!attribute [rw] type - # @return [::String] - # Name of the defect type. Supported values are: - # - # - `quality/defect_blurry` - # - `quality/defect_noisy` - # - `quality/defect_dark` - # - `quality/defect_faint` - # - `quality/defect_text_too_small` - # - `quality/defect_document_cutoff` - # - `quality/defect_text_cutoff` - # - `quality/defect_glare` - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of detected defect. Range `[0, 1]` where 1 indicates - # strong confidence of that the defect exists. - class DetectedDefect - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # An entity that could be a phrase in the text or a property that belongs to - # the document. It is a known entity type, such as a person, an organization, - # or location. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Optional. Provenance of the entity. - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] type - # @return [::String] - # Required. Entity type from a schema e.g. `Address`. - # @!attribute [rw] mention_text - # @return [::String] - # Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. - # @!attribute [rw] mention_id - # @return [::String] - # Optional. Deprecated. Use `id` field instead. - # @!attribute [rw] confidence - # @return [::Float] - # Optional. Confidence of detected Schema entity. Range `[0, 1]`. - # @!attribute [rw] page_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor] - # Optional. Represents the provenance of this entity wrt. the location on - # the page where it was found. - # @!attribute [rw] id - # @return [::String] - # Optional. Canonical id. This will be a unique value in the entity list - # for this document. - # @!attribute [rw] normalized_value - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Entity::NormalizedValue] - # Optional. Normalized entity value. Absent if the extracted value could - # not be converted or the type (e.g. address) is not supported for certain - # parsers. This field is also only populated for certain supported document - # types. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>] - # Optional. Entities can be nested to form a hierarchical data structure - # representing the content in the document. - # @!attribute [rw] provenance - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # Optional. The history of this annotation. - # @!attribute [rw] redacted - # @return [::Boolean] - # Optional. Whether the entity will be redacted for de-identification - # purposes. - class Entity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Parsed and normalized entity value. - # @!attribute [rw] money_value - # @return [::Google::Type::Money] - # Money value. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - # @!attribute [rw] date_value - # @return [::Google::Type::Date] - # Date value. Includes year, month, day. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - # @!attribute [rw] datetime_value - # @return [::Google::Type::DateTime] - # DateTime value. Includes date, time, and timezone. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - # @!attribute [rw] address_value - # @return [::Google::Type::PostalAddress] - # Postal address. See also: - # https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - # @!attribute [rw] boolean_value - # @return [::Boolean] - # Boolean value. Can be used for entities with binary values, or for - # checkboxes. - # @!attribute [rw] integer_value - # @return [::Integer] - # Integer value. - # @!attribute [rw] float_value - # @return [::Float] - # Float value. - # @!attribute [rw] text - # @return [::String] - # Optional. An optional field to store a normalized string. - # For some entity types, one of respective `structured_value` fields may - # also be populated. Also not all the types of `structured_value` will be - # normalized. For example, some processors may not generate `float` - # or `integer` normalized text by default. - # - # Below are sample formats mapped to structured values. - # - # - Money/Currency type (`money_value`) is in the ISO 4217 text format. - # - Date type (`date_value`) is in the ISO 8601 text format. - # - Datetime type (`datetime_value`) is in the ISO 8601 text format. - class NormalizedValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Relationship between - # {::Google::Cloud::DocumentAI::V1beta3::Document::Entity Entities}. - # @!attribute [rw] subject_id - # @return [::String] - # Subject entity id. - # @!attribute [rw] object_id - # @return [::String] - # Object entity id. - # @!attribute [rw] relation - # @return [::String] - # Relationship description. - class EntityRelation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Text reference indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] text_segments - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment>] - # The text segments from the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] content - # @return [::String] - # Contains the content of the text span so that users do - # not have to look it up in the text_segments. It is always - # populated for formFields. - class TextAnchor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A text segment in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. The - # indices may be out of bounds which indicate that the text extends into - # another document shard for large sharded documents. See - # {::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo#text_offset ShardInfo.text_offset} - # @!attribute [rw] start_index - # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} - # start UTF-8 char index in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - # @!attribute [rw] end_index - # @return [::Integer] - # {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} - # half open end UTF-8 char index in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. - class TextSegment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Referencing the visual context of the entity in the - # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages}. Page - # anchors can be cross-page, consist of multiple bounding polygons and - # optionally reference specific layout element types. - # @!attribute [rw] page_refs - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef>] - # One or more references to visual page elements - class PageAnchor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a weak reference to a page element within a document. - # @!attribute [rw] page - # @return [::Integer] - # Required. Index into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages} - # element, for example using - # `[Document.pages][page_refs.page]` to locate the related page element. - # This field is skipped when its value is the default `0`. See - # https://developers.google.com/protocol-buffers/docs/proto3#json. - # @!attribute [rw] layout_type - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef::LayoutType] - # Optional. The type of the layout element that is being referenced if - # any. - # @!attribute [rw] layout_id - # @return [::String] - # Optional. Deprecated. Use - # {::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} - # instead. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] - # Optional. Identifies the bounding polygon of a layout element on the - # page. - # @!attribute [rw] confidence - # @return [::Float] - # Optional. Confidence of detected page element, if applicable. Range - # `[0, 1]`. - class PageRef - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of layout that is being referenced. - module LayoutType - # Layout Unspecified. - LAYOUT_TYPE_UNSPECIFIED = 0 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#blocks Page.blocks} - # element. - BLOCK = 1 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#paragraphs Page.paragraphs} - # element. - PARAGRAPH = 2 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#lines Page.lines} - # element. - LINE = 3 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tokens Page.tokens} - # element. - TOKEN = 4 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#visual_elements Page.visual_elements} - # element. - VISUAL_ELEMENT = 5 - - # Refrrences a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tables Page.tables} - # element. - TABLE = 6 - - # References a - # {::Google::Cloud::DocumentAI::V1beta3::Document::Page#form_fields Page.form_fields} - # element. - FORM_FIELD = 7 - end - end - end - - # Structure to identify provenance relationships between annotations in - # different revisions. - # @!attribute [rw] revision - # @return [::Integer] - # The index of the revision that produced this element. - # @!attribute [rw] id - # @return [::Integer] - # The Id of this operation. Needs to be unique within the scope of the - # revision. - # @!attribute [rw] parents - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::Parent>] - # References to the original elements that are replaced. - # @!attribute [rw] type - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::OperationType] - # The type of provenance operation. - class Provenance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The parent element the current element is based on. Used for - # referencing/aligning, removal and replacement operations. - # @!attribute [rw] revision - # @return [::Integer] - # The index of the index into current revision's parent_ids list. - # @!attribute [rw] index - # @return [::Integer] - # The index of the parent item in the corresponding item list (eg. list - # of entities, properties within entities, etc.) in the parent revision. - # @!attribute [rw] id - # @return [::Integer] - # The id of the parent provenance. - class Parent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # If a processor or agent does an explicit operation on existing elements. - module OperationType - # Operation type unspecified. If no operation is specified a provenance - # entry is simply used to match against a `parent`. - OPERATION_TYPE_UNSPECIFIED = 0 - - # Add an element. - ADD = 1 - - # Remove an element identified by `parent`. - REMOVE = 2 - - # Replace an element identified by `parent`. - REPLACE = 3 - - # Request human review for the element identified by `parent`. - EVAL_REQUESTED = 4 - - # Element is reviewed and approved at human review, confidence will be - # set to 1.0. - EVAL_APPROVED = 5 - - # 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. Unique within the context of the document. - # @!attribute [rw] parent - # @return [::Array<::Integer>] - # The revisions that this revision is based on. This can include one or - # more parent (when documents are merged.) This field represents the - # index into the `revisions` field. - # @!attribute [rw] parent_ids - # @return [::Array<::String>] - # The revisions that this revision is based on. Must include all the ids - # that have anything to do with this revision - eg. there are - # `provenance.parent.revision` fields that index into this field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time that the revision was created. - # @!attribute [rw] human_review - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Revision::HumanReview] - # Human Review information of this revision. - class Revision - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Human Review information of the document. - # @!attribute [rw] state - # @return [::String] - # Human review state. e.g. `requested`, `succeeded`, `rejected`. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # For example, the rejection reason when the state is `rejected`. - class HumanReview - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used for text changes aka. OCR corrections. - # @!attribute [rw] text_anchor - # @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor] - # Provenance of the correction. - # Text anchor indexing into the - # {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. There - # can only be a single `TextAnchor.text_segments` element. If the start - # and end index of the text segment are the same, the text change is - # inserted before that index. - # @!attribute [rw] changed_text - # @return [::String] - # The text that replaces the text identified in the `text_anchor`. - # @!attribute [rw] provenance - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>] - # The history of this annotation. - class TextChange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb deleted file mode 100644 index 5f47a5f34711..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +++ /dev/null @@ -1,133 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Payload message of raw document content (bytes). - # @!attribute [rw] content - # @return [::String] - # Inline document content. - # @!attribute [rw] mime_type - # @return [::String] - # An IANA MIME type (RFC6838) indicating the nature and format of the - # {::Google::Cloud::DocumentAI::V1beta3::RawDocument#content content}. - class RawDocument - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a document stored on Cloud Storage. - # @!attribute [rw] gcs_uri - # @return [::String] - # The Cloud Storage object uri. - # @!attribute [rw] mime_type - # @return [::String] - # An IANA MIME type (RFC6838) of the content. - class GcsDocument - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a set of documents on Cloud Storage. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::GcsDocument>] - # The list of documents. - class GcsDocuments - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies all documents on Cloud Storage with a common prefix. - # @!attribute [rw] gcs_uri_prefix - # @return [::String] - # The URI prefix. - class GcsPrefix - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The common config to specify a set of documents used as input. - # @!attribute [rw] gcs_prefix - # @return [::Google::Cloud::DocumentAI::V1beta3::GcsPrefix] - # The set of documents that match the specified Cloud Storage `gcs_prefix`. - # @!attribute [rw] gcs_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::GcsDocuments] - # The set of documents individually specified on Cloud Storage. - class BatchDocumentsInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Config that controls the output of documents. All documents will be written - # as a JSON file. - # @!attribute [rw] gcs_output_config - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig] - # Output config to write the results to Cloud Storage. - class DocumentOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The configuration used when outputting documents. - # @!attribute [rw] gcs_uri - # @return [::String] - # The Cloud Storage uri (a directory) of the output. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Specifies which fields to include in the output documents. - # Only supports top level document and pages field so it must be in the - # form of `{document_field_name}` or `pages.{page_field_name}`. - # @!attribute [rw] sharding_config - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig::GcsOutputConfig::ShardingConfig] - # Specifies the sharding config for the output document. - class GcsOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The sharding config for the output document. - # @!attribute [rw] pages_per_shard - # @return [::Integer] - # The number of pages per shard. - # @!attribute [rw] pages_overlap - # @return [::Integer] - # The number of overlapping pages between consecutive shards. - class ShardingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Config for Document OCR. - # @!attribute [rw] 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] advanced_ocr_options - # @return [::Array<::String>] - # A list of advanced OCR options to further fine-tune OCR behavior. - class OcrConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb deleted file mode 100644 index bc45447b30b1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +++ /dev/null @@ -1,867 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # Options for Process API - # @!attribute [rw] ocr_config - # @return [::Google::Cloud::DocumentAI::V1beta3::OcrConfig] - # Only applicable to "Document OCR Processor". Returns error if set on other - # processor types. - class ProcessOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the process document method. - # @!attribute [rw] inline_document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # An inline document proto. - # @!attribute [rw] raw_document - # @return [::Google::Cloud::DocumentAI::V1beta3::RawDocument] - # A raw document content (bytes). - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} - # to use for processing. If a - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the - # server will use its [default - # version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # The document payload, the [content] and [mime_type] fields must be set. - # @!attribute [rw] skip_human_review - # @return [::Boolean] - # Whether Human Review feature should be skipped for this request. Default to - # false. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Specifies which fields to include in ProcessResponse's document. - # Only supports top level document and pages field so it must be in the form - # of `{document_field_name}` or `pages.{page_field_name}`. - # @!attribute [rw] process_options - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] - # Inference-time options for the process API - class ProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The status of human review on a processed document. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus::State] - # The state of human review on the processing request. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the human review state. - # @!attribute [rw] human_review_operation - # @return [::String] - # The name of the operation triggered by the processed document. This field - # is populated only when the [state] is [HUMAN_REVIEW_IN_PROGRESS]. It has - # the same response type and metadata as the long running operation returned - # by [ReviewDocument] method. - 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 is not enabled on the processor or the processing request has - # been set to skip this document. - SKIPPED = 1 - - # Human review validation is triggered and passed, so no review is needed. - VALIDATION_PASSED = 2 - - # Human review validation is triggered and the document is under review. - IN_PROGRESS = 3 - - # Some error happened during triggering human review, see the - # [state_message] for details. - ERROR = 4 - end - end - - # Response message for the process document method. - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # The document payload, will populate fields based on the processor's - # behavior. - # @!attribute [rw] human_review_operation - # @return [::String] - # The name of the operation triggered by the processed document. If the human - # review process is not triggered, this field will be empty. It has the same - # response type and metadata as the long running operation returned by - # ReviewDocument method. - # @!attribute [rw] human_review_status - # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] - # The status of human review on the processed document. - class ProcessResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for batch process document method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}. - # Format: `projects/{project}/locations/{location}/processors/{processor}`, - # or - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] input_configs - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig>] - # The input config for each single document in the batch process. - # @!attribute [rw] output_config - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig] - # The overall output config for batch process. - # @!attribute [rw] input_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # The input documents for batch process. - # @!attribute [rw] document_output_config - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig] - # The overall output config for batch process. - # @!attribute [rw] skip_human_review - # @return [::Boolean] - # Whether Human Review feature should be skipped for this request. Default to - # false. - # @!attribute [rw] process_options - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions] - # Inference-time options for the process API - class BatchProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The message for input config in batch process. - # @!attribute [rw] gcs_source - # @return [::String] - # The Cloud Storage location as the source of the document. - # @!attribute [rw] mime_type - # @return [::String] - # Mimetype of the input. If the input is a raw document, the supported - # mimetypes are application/pdf, image/tiff, and image/gif. - # If the input is a [Document] proto, the type should be application/json. - class BatchInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message for output config in batch process. - # @!attribute [rw] gcs_destination - # @return [::String] - # The output Cloud Storage directory to put the processed documents. - class BatchOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for batch process document method. - class BatchProcessResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long running operation metadata for batch process method. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::State] - # The state of the current batch processing. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # For example, the error message if the operation is failed. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] individual_process_statuses - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::IndividualProcessStatus>] - # The list of response details of each document. - class BatchProcessMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of a each individual document in the batch process. - # @!attribute [rw] input_gcs_source - # @return [::String] - # The source of the document, same as the [input_gcs_source] field in the - # request when the batch process started. The batch process is started by - # take snapshot of that document, since a user can move or change that - # document during the process. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status processing the document. - # @!attribute [rw] output_gcs_destination - # @return [::String] - # The output_gcs_destination (in the request as `output_gcs_destination`) - # of the processed document if it was successful, otherwise empty. - # @!attribute [rw] human_review_operation - # @return [::String] - # The name of the operation triggered by the processed document. If the - # human review process is not triggered, this field will be empty. It has - # the same response type and metadata as the long running operation - # returned by ReviewDocument method. - # @!attribute [rw] human_review_status - # @return [::Google::Cloud::DocumentAI::V1beta3::HumanReviewStatus] - # The status of human review on the processed document. - class IndividualProcessStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible states of the batch processing operation. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # Request operation is waiting for scheduling. - WAITING = 1 - - # Request is being processed. - RUNNING = 2 - - # The batch processing completed successfully. - SUCCEEDED = 3 - - # The batch processing was being cancelled. - CANCELLING = 4 - - # The batch processing was cancelled. - CANCELLED = 5 - - # The batch processing has failed. - FAILED = 6 - end - end - - # Request message for fetch processor types. - # @!attribute [rw] parent - # @return [::String] - # Required. The project of processor type to list. - # The available processor types may depend on the allow-listing on projects. - # Format: `projects/{project}/locations/{location}` - class FetchProcessorTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for fetch processor types. - # @!attribute [rw] processor_types - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # The list of processor types. - class FetchProcessorTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for list processor types. - # @!attribute [rw] parent - # @return [::String] - # Required. The location of processor type to list. - # The available processor types may depend on the allow-listing on projects. - # Format: `projects/{project}/locations/{location}` - # @!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 list processor types. - # @!attribute [rw] processor_types - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] - # The processor types. - # @!attribute [rw] next_page_token - # @return [::String] - # Points to the next page, otherwise empty. - class ListProcessorTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for list all processors belongs to a project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent (project and location) which owns this collection of - # Processors. Format: `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of processors to return. - # If unspecified, at most 50 processors will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # We will return the processors sorted by creation time. The page token - # will point to the next processor. - class ListProcessorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for list processors. - # @!attribute [rw] processors - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Processor>] - # The list of processors. - # @!attribute [rw] next_page_token - # @return [::String] - # Points to the next processor, otherwise empty. - class ListProcessorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for get processor. - # @!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 get processor. - # @!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 get processor version. - # @!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 list processors. - # @!attribute [rw] processor_versions - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] - # The list of processors. - # @!attribute [rw] next_page_token - # @return [::String] - # Points to the next processor, otherwise empty. - class ListProcessorVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the delete processor version 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 delete processor version method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class DeleteProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the deploy processor version 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 deploy processor version method. - class DeployProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long running operation metadata for deploy processor version method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class DeployProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the undeploy processor version 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 undeploy processor version method. - class UndeployProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long running operation metadata for the undeploy processor version - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class UndeployProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for create a processor. Notice this request is sent to - # a regionalized backend service, and if the processor type is not available - # on that region, the creation will fail. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent (project and location) under which to create the - # processor. Format: `projects/{project}/locations/{location}` - # @!attribute [rw] processor - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] - # Required. The processor to be created, requires [processor_type] and - # [display_name] to be set. Also, the processor is under CMEK if CMEK fields - # are set. - class CreateProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the delete processor 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 delete processor method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class DeleteProcessorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the enable processor 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 enable processor 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 enable processor method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class EnableProcessorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the disable processor 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 disable processor 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 disable processor method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class DisableProcessorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the set default processor version method. - # @!attribute [rw] processor - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default - # version. - # @!attribute [rw] default_processor_version - # @return [::String] - # Required. The resource name of child - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use - # as default. Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - class SetDefaultProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for set default processor version method. - class SetDefaultProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The long running operation metadata for set default processor version - # method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class SetDefaultProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the create processor version method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent (project, location and processor) to create the new - # version for. Format: - # `projects/{project}/locations/{location}/processors/{processor}`. - # @!attribute [rw] processor_version - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] - # Required. The processor version to be created. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] - # Optional. The schema the processor version will be trained with. - # @!attribute [rw] input_data - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData] - # Optional. The input data used to train the `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 `ProcessorVersion`. - # @!attribute [rw] training_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # The documents used for training the new version. - # @!attribute [rw] test_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # The documents used for testing the trained version. - class InputData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response for the TrainProcessorVersion method. - # @!attribute [rw] processor_version - # @return [::String] - # The resource name of the processor version produced by training. - class TrainProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metadata that represents a processor version being created. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - # @!attribute [rw] training_dataset_validation - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] - # The training dataset validation information. - # @!attribute [rw] test_dataset_validation - # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] - # The test dataset validation information. - class TrainProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The dataset validation information. - # This includes any and all errors with documents and the dataset. - # @!attribute [rw] document_error_count - # @return [::Integer] - # The total number of document errors. - # @!attribute [rw] dataset_error_count - # @return [::Integer] - # The total number of dataset errors. - # @!attribute [rw] document_errors - # @return [::Array<::Google::Rpc::Status>] - # Error information pertaining to specific documents. A maximum of 10 - # document errors will be returned. - # Any document with errors will not be used throughout training. - # @!attribute [rw] dataset_errors - # @return [::Array<::Google::Rpc::Status>] - # Error information for the dataset as a whole. A maximum of 10 dataset - # errors will be returned. - # A single dataset error is terminal for training. - class DatasetValidation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for review document method. - # @!attribute [rw] inline_document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # An inline document proto. - # @!attribute [rw] human_review_config - # @return [::String] - # Required. The resource name of the HumanReviewConfig that the document will - # be reviewed with. - # @!attribute [rw] document - # @return [::Google::Cloud::DocumentAI::V1beta3::Document] - # The document that needs human review. - # @!attribute [rw] enable_schema_validation - # @return [::Boolean] - # Whether the validation should be performed on the ad-hoc review request. - # @!attribute [rw] priority - # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority] - # The priority of the human review task. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] - # The document schema of the human review task. - class ReviewDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The priority level of the human review task. - module Priority - # The default priority level. - DEFAULT = 0 - - # The urgent priority level. The labeling manager should allocate labeler - # resource to the urgent task queue to respect this priority level. - URGENT = 1 - end - end - - # Response message for review document method. - # @!attribute [rw] gcs_destination - # @return [::String] - # The Cloud Storage uri for the human reviewed document if the review is - # succeeded. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentResponse::State] - # The state of the review operation. - # @!attribute [rw] rejection_reason - # @return [::String] - # The reason why the review is rejected by reviewer. - class ReviewDocumentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of the review operation. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # The review operation is rejected by the reviewer. - REJECTED = 1 - - # The review operation is succeeded. - SUCCEEDED = 2 - end - end - - # The long running operation metadata for review document method. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentOperationMetadata::State] - # Used only when Operation.done is false. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # For example, the error message if the operation is failed. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - # @!attribute [rw] question_id - # @return [::String] - # The Crowd Compute question ID. - class ReviewDocumentOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the 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 - - # Evaluates the given ProcessorVersion against the supplied documents. - # @!attribute [rw] processor_version - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # evaluate. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] evaluation_documents - # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] - # Optional. The documents used in the evaluation. If unspecified, use the - # processor's dataset as evaluation input. - class EvaluateProcessorVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of the EvaluateProcessorVersion method. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] - # The basic metadata of the long running operation. - class EvaluateProcessorVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of the EvaluateProcessorVersion method. - # @!attribute [rw] evaluation - # @return [::String] - # The resource name of the created evaluation. - class EvaluateProcessorVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retrieves a specific Evaluation. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - class GetEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retrieves a list of evaluations for a given ProcessorVersion. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to - # list evaluations for. - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # If unspecified, at most 5 evaluations will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListEvaluations` call. - # Provide this to retrieve the subsequent page. - class ListEvaluationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response from ListEvaluations. - # @!attribute [rw] evaluations - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] - # The evaluations requested. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListEvaluationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb deleted file mode 100644 index a6d668f65a7a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # The schema defines the output of the processed document by a processor. - # @!attribute [rw] display_name - # @return [::String] - # Display name to show to users. - # @!attribute [rw] description - # @return [::String] - # Description of the schema. - # @!attribute [rw] entity_types - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType>] - # Entity types of the schema. - # @!attribute [rw] metadata - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::Metadata] - # Metadata of the schema. - class DocumentSchema - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # EntityType is the wrapper of a label of the corresponding model with - # detailed attributes and limitations for entity-based processors. Multiple - # types can also compose a dependency tree to represent nested types. - # @!attribute [rw] enum_values - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::EnumValues] - # If specified, lists all the possible values for this entity. This - # should not be more than a handful of values. If the number of values - # is >10 or could change frequently use the `EntityType.value_ontology` - # field and specify a list of all possible values in a value ontology - # file. - # @!attribute [rw] display_name - # @return [::String] - # User defined name for the type. - # @!attribute [rw] name - # @return [::String] - # Name of the type. It must be unique within the schema file and - # cannot be a 'Common Type'. Besides that we use the following naming - # conventions: - # - # - *use `snake_casing`* - # - name matching is case-sensitive - # - Maximum 64 characters. - # - Must start with a letter. - # - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward - # compatibility internal infrastructure and tooling can handle any ascii - # character) - # - The `/` is sometimes used to denote a property of a type. For example - # `line_item/amount`. This convention is deprecated, but will still be - # honored for backward compatibility. - # @!attribute [rw] base_types - # @return [::Array<::String>] - # The entity type that this type is derived from. For now, one and only - # one should be set. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property>] - # Describing 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] value_type - # @return [::String] - # A reference to the value type of the property. This type is subject - # to the same conventions as the `Entity.base_types` field. - # @!attribute [rw] occurrence_type - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType] - # Occurrence type limits the number of instances an entity type appears - # in the document. - class Property - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of occurrences of the entity type in the document. Note: this - # represents the number of instances of an entity types, not number of - # mentions of a given entity instance. - module OccurrenceType - # Unspecified occurrence type. - OCCURRENCE_TYPE_UNSPECIFIED = 0 - - # There will be zero or one instance of this entity type. - OPTIONAL_ONCE = 1 - - # The entity type will appear zero or multiple times. - OPTIONAL_MULTIPLE = 2 - - # The entity type will only appear exactly once. - REQUIRED_ONCE = 3 - - # The entity type will appear once or more times. - REQUIRED_MULTIPLE = 4 - end - end - end - - # Metadata for global schema behavior. - # @!attribute [rw] document_splitter - # @return [::Boolean] - # If true, a `document` entity type can be applied to subdocument ( - # splitting). Otherwise, it can only be applied to the entire document - # (classification). - # @!attribute [rw] document_allow_multiple_labels - # @return [::Boolean] - # If true, on a given page, there can be multiple `document` annotations - # covering it. - # @!attribute [rw] prefixed_naming_on_properties - # @return [::Boolean] - # If set, all the nested entities must be prefixed with the parents. - # @!attribute [rw] skip_naming_validation - # @return [::Boolean] - # If set, we will skip the naming format validation in the schema. So the - # string values in `DocumentSchema.EntityType.name` and - # `DocumentSchema.EntityType.Property.name` will not be checked. - class Metadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb deleted file mode 100644 index 969d0f6faf53..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb +++ /dev/null @@ -1,181 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # An evaluation of a ProcessorVersion's performance. - # @!attribute [rw] name - # @return [::String] - # The resource name of the evaluation. - # Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time that the evaluation was created. - # @!attribute [rw] document_counters - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Counters] - # Counters for the documents used in the evaluation. - # @!attribute [rw] all_entities_metrics - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] - # Metrics for all the entities in aggregate. - # @!attribute [rw] entity_metrics - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics}] - # Metrics across confidence levels, for different entities. - # @!attribute [rw] kms_key_name - # @return [::String] - # The KMS key name used for encryption. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # The KMS key version with which data is encrypted. - class Evaluation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Evaluation counters for the documents that were used. - # @!attribute [rw] input_documents_count - # @return [::Integer] - # How many documents were sent for evaluation. - # @!attribute [rw] invalid_documents_count - # @return [::Integer] - # How many documents were not included in the evaluation as they didn't - # pass validation. - # @!attribute [rw] failed_documents_count - # @return [::Integer] - # How many documents were not included in the evaluation as Document AI - # failed to process them. - # @!attribute [rw] evaluated_documents_count - # @return [::Integer] - # How many documents were used in the evaluation. - class Counters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluation metrics, either in aggregate or about a specific entity. - # @!attribute [rw] precision - # @return [::Float] - # The calculated precision. - # @!attribute [rw] recall - # @return [::Float] - # The calculated recall. - # @!attribute [rw] f1_score - # @return [::Float] - # The calculated f1 score. - # @!attribute [rw] predicted_occurrences_count - # @return [::Integer] - # The amount of occurrences in predicted documents. - # @!attribute [rw] ground_truth_occurrences_count - # @return [::Integer] - # The amount of occurrences in ground truth documents. - # @!attribute [rw] predicted_document_count - # @return [::Integer] - # The amount of documents with a predicted occurrence. - # @!attribute [rw] ground_truth_document_count - # @return [::Integer] - # The amount of documents with a ground truth occurrence. - # @!attribute [rw] true_positives_count - # @return [::Integer] - # The amount of true positives. - # @!attribute [rw] false_positives_count - # @return [::Integer] - # The amount of false positives. - # @!attribute [rw] false_negatives_count - # @return [::Integer] - # The amount of false negatives. - # @!attribute [rw] total_documents_count - # @return [::Integer] - # The amount of documents that had an occurrence of this label. - class Metrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluations metrics, at a specific confidence level. - # @!attribute [rw] confidence_level - # @return [::Float] - # The confidence level. - # @!attribute [rw] metrics - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] - # The metrics at the specific confidence level. - class ConfidenceLevelMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metrics across multiple confidence levels. - # @!attribute [rw] confidence_level_metrics - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] - # Metrics across confidence levels with fuzzy matching enabled. - # @!attribute [rw] confidence_level_metrics_exact - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] - # Metrics across confidence levels with only exact matching. - # @!attribute [rw] auprc - # @return [::Float] - # The calculated area under the precision recall curve (AUPRC), computed by - # integrating over all confidence thresholds. - # @!attribute [rw] estimated_calibration_error - # @return [::Float] - # The Estimated Calibration Error (ECE) of the confidence of the predicted - # entities. - # @!attribute [rw] auprc_exact - # @return [::Float] - # The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching - # only. - # @!attribute [rw] estimated_calibration_error_exact - # @return [::Float] - # The ECE for the predicted entities with fuzzy matching disabled, i.e., - # exact matching only. - # @!attribute [rw] metrics_type - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics::MetricsType] - # The metrics type for the label. - class MultiConfidenceMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A type that determines how metrics should be interpreted. - module MetricsType - # The metrics type is unspecified. By default, metrics without a - # particular specification are for leaf entity types (i.e., top-level - # entity types without child types, or child types which are not - # parent types themselves). - METRICS_TYPE_UNSPECIFIED = 0 - - # Indicates whether metrics for this particular label type represent an - # aggregate of metrics for other types instead of being based on actual - # TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) - # entity types are an aggregate of metrics for their children. - AGGREGATE = 1 - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] - class EntityMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb deleted file mode 100644 index 6beba3a11eb1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/geometry.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # A vertex represents a 2D point in the image. - # NOTE: the vertex coordinates are in the same scale as the original image. - # @!attribute [rw] x - # @return [::Integer] - # X coordinate. - # @!attribute [rw] y - # @return [::Integer] - # Y coordinate (starts from the top of the image). - class Vertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A vertex represents a 2D point in the image. - # NOTE: the normalized vertex coordinates are relative to the original image - # and range from 0 to 1. - # @!attribute [rw] x - # @return [::Float] - # X coordinate. - # @!attribute [rw] y - # @return [::Float] - # Y coordinate (starts from the top of the image). - class NormalizedVertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A bounding polygon for the detected image annotation. - # @!attribute [rw] vertices - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Vertex>] - # The bounding polygon vertices. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::NormalizedVertex>] - # The bounding polygon normalized vertices. - class BoundingPoly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb deleted file mode 100644 index 663e5b3fa6b1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # The common metadata for long running operations. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State] - # The state of the operation. - # @!attribute [rw] state_message - # @return [::String] - # A message providing more details about the current state of processing. - # @!attribute [rw] resource - # @return [::String] - # A related resource to this operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - class CommonOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the longrunning operation. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # Operation is still running. - RUNNING = 1 - - # Operation is being cancelled. - CANCELLING = 2 - - # Operation succeeded. - SUCCEEDED = 3 - - # Operation failed. - FAILED = 4 - - # Operation is cancelled. - CANCELLED = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb deleted file mode 100644 index 8e5efec64b8a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb +++ /dev/null @@ -1,175 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # A processor version is an implementation of a processor. Each processor - # can have multiple versions, pre-trained by Google internally or up-trained - # by the customer. At a time, a processor can only have one default version - # version. So the processor's behavior (when processing documents) is defined - # by a default version - # @!attribute [rw] name - # @return [::String] - # The resource name of the processor version. - # Format: - # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - # @!attribute [rw] display_name - # @return [::String] - # The display name of the processor version. - # @!attribute [rw] document_schema - # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] - # The schema of the processor version. Describes the output. - # @!attribute [rw] state - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::State] - # The state of the processor version. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the processor version was created. - # @!attribute [rw] 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 [rw] google_managed - # @return [::Boolean] - # Denotes that this ProcessorVersion is managed by google. - # @!attribute [rw] deprecation_info - # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::DeprecationInfo] - # If set, information about the eventual deprecation of this version. - class ProcessorVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about the upcoming deprecation of this processor version. - # @!attribute [rw] deprecation_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this processor version will be deprecated. - # @!attribute [rw] replacement_processor_version - # @return [::String] - # If set, the processor version that will be used as a replacement. - class DeprecationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The possible states of the processor version. - module State - # The processor version is in an unspecified state. - STATE_UNSPECIFIED = 0 - - # The processor version is deployed and can be used for processing. - DEPLOYED = 1 - - # The processor version is being deployed. - DEPLOYING = 2 - - # The processor version is not deployed and cannot be used for processing. - UNDEPLOYED = 3 - - # The processor version is being undeployed. - UNDEPLOYING = 4 - - # The processor version is being created. - CREATING = 5 - - # The processor version is being deleted. - DELETING = 6 - - # The processor version failed and is in an indeterminate state. - FAILED = 7 - end - end - - # The first-class citizen for Document AI. Each processor defines how to - # extract structural information from a document. - # @!attribute [r] name - # @return [::String] - # Output only. Immutable. The resource name of the processor. - # Format: `projects/{project}/locations/{location}/processors/{processor}` - # @!attribute [rw] type - # @return [::String] - # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. - # To get a list of processors types, see - # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes}. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the processor. - # @!attribute [r] state - # @return [::Google::Cloud::DocumentAI::V1beta3::Processor::State] - # Output only. The state of the processor. - # @!attribute [rw] default_processor_version - # @return [::String] - # The default processor version. - # @!attribute [r] process_endpoint - # @return [::String] - # Output only. Immutable. The http endpoint that can be called to invoke - # processing. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the processor was created. - # @!attribute [rw] kms_key_name - # @return [::String] - # The KMS key used for encryption/decryption in CMEK scenarios. - # See https://cloud.google.com/security-key-management. - class Processor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible states of the processor. - module State - # The processor is in an unspecified state. - STATE_UNSPECIFIED = 0 - - # The processor is enabled, i.e., has an enabled version which can - # currently serve processing requests and all the feature dependencies have - # been successfully initialized. - ENABLED = 1 - - # The processor is disabled. - DISABLED = 2 - - # The processor is being enabled, will become `ENABLED` if successful. - ENABLING = 3 - - # The processor is being disabled, will become `DISABLED` if successful. - DISABLING = 4 - - # The processor is being created, will become either `ENABLED` (for - # successful creation) or `FAILED` (for failed ones). - # Once a processor is in this state, it can then be used for document - # processing, but the feature dependencies of the processor might not be - # fully created yet. - CREATING = 5 - - # The processor failed during creation or initialization of feature - # dependencies. The user should delete the processor and recreate one as - # all the functionalities of the processor are disabled. - FAILED = 6 - - # The processor is being deleted, will be removed if successful. - DELETING = 7 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb deleted file mode 100644 index 7311ae079582..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DocumentAI - module V1beta3 - # A 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, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. - # @!attribute [rw] category - # @return [::String] - # The processor category, used by UI to group processor types. - # @!attribute [rw] available_locations - # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType::LocationInfo>] - # The locations in which this processor is available. - # @!attribute [rw] allow_creation - # @return [::Boolean] - # Whether the processor type allows creation. If true, users can create a - # processor of this processor type. Otherwise, users need to request access. - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of the processor type - # @!attribute [rw] sample_document_uris - # @return [::Array<::String>] - # A set of Cloud Storage URIs of sample documents for this processor. - class ProcessorType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The location information about where the processor is available. - # @!attribute [rw] location_id - # @return [::String] - # The location id, currently must be one of [us, eu]. - class LocationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 08ab43c84ae9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb deleted file mode 100644 index bd27eead4bda..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,141 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # - # JSON - # - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b4a53d0ac67f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 4c0ad96e8eb9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index c437e42a7581..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index b550ca8dff38..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,129 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 3f28f1fb18f6..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb deleted file mode 100644 index 6f72e88c418d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb deleted file mode 100644 index 139261bdf919..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/color.rb +++ /dev/null @@ -1,173 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a color in the RGBA color space. This representation is designed - # for simplicity of conversion to/from color representations in various - # languages over compactness. For example, the fields of this representation - # can be trivially provided to the constructor of `java.awt.Color` in Java; it - # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` - # method in iOS; and, with just a little work, it can be easily formatted into - # a CSS `rgba()` string in JavaScript. - # - # This reference page doesn't carry information about the absolute color - # space - # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, - # DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color - # space. - # - # When color equality needs to be decided, implementations, unless - # documented otherwise, treat two colors as equal if all their red, - # green, blue, and alpha values each differ by at most 1e-5. - # - # Example (Java): - # - # import com.google.type.Color; - # - # // ... - # public static java.awt.Color fromProto(Color protocolor) { - # float alpha = protocolor.hasAlpha() - # ? protocolor.getAlpha().getValue() - # : 1.0; - # - # return new java.awt.Color( - # protocolor.getRed(), - # protocolor.getGreen(), - # protocolor.getBlue(), - # alpha); - # } - # - # public static Color toProto(java.awt.Color color) { - # float red = (float) color.getRed(); - # float green = (float) color.getGreen(); - # float blue = (float) color.getBlue(); - # float denominator = 255.0; - # Color.Builder resultBuilder = - # Color - # .newBuilder() - # .setRed(red / denominator) - # .setGreen(green / denominator) - # .setBlue(blue / denominator); - # int alpha = color.getAlpha(); - # if (alpha != 255) { - # result.setAlpha( - # FloatValue - # .newBuilder() - # .setValue(((float) alpha) / denominator) - # .build()); - # } - # return resultBuilder.build(); - # } - # // ... - # - # Example (iOS / Obj-C): - # - # // ... - # static UIColor* fromProto(Color* protocolor) { - # float red = [protocolor red]; - # float green = [protocolor green]; - # float blue = [protocolor blue]; - # FloatValue* alpha_wrapper = [protocolor alpha]; - # float alpha = 1.0; - # if (alpha_wrapper != nil) { - # alpha = [alpha_wrapper value]; - # } - # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; - # } - # - # static Color* toProto(UIColor* color) { - # CGFloat red, green, blue, alpha; - # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - # return nil; - # } - # Color* result = [[Color alloc] init]; - # [result setRed:red]; - # [result setGreen:green]; - # [result setBlue:blue]; - # if (alpha <= 0.9999) { - # [result setAlpha:floatWrapperWithValue(alpha)]; - # } - # [result autorelease]; - # return result; - # } - # // ... - # - # Example (JavaScript): - # - # // ... - # - # var protoToCssColor = function(rgb_color) { - # var redFrac = rgb_color.red || 0.0; - # var greenFrac = rgb_color.green || 0.0; - # var blueFrac = rgb_color.blue || 0.0; - # var red = Math.floor(redFrac * 255); - # var green = Math.floor(greenFrac * 255); - # var blue = Math.floor(blueFrac * 255); - # - # if (!('alpha' in rgb_color)) { - # return rgbToCssColor(red, green, blue); - # } - # - # var alphaFrac = rgb_color.alpha.value || 0.0; - # var rgbParams = [red, green, blue].join(','); - # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); - # }; - # - # var rgbToCssColor = function(red, green, blue) { - # var rgbNumber = new Number((red << 16) | (green << 8) | blue); - # var hexString = rgbNumber.toString(16); - # var missingZeros = 6 - hexString.length; - # var resultBuilder = ['#']; - # for (var i = 0; i < missingZeros; i++) { - # resultBuilder.push('0'); - # } - # resultBuilder.push(hexString); - # return resultBuilder.join(''); - # }; - # - # // ... - # @!attribute [rw] red - # @return [::Float] - # The amount of red in the color as a value in the interval [0, 1]. - # @!attribute [rw] green - # @return [::Float] - # The amount of green in the color as a value in the interval [0, 1]. - # @!attribute [rw] blue - # @return [::Float] - # The amount of blue in the color as a value in the interval [0, 1]. - # @!attribute [rw] alpha - # @return [::Google::Protobuf::FloatValue] - # The fraction of this color that should be applied to the pixel. That is, - # the final pixel color is defined by the equation: - # - # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` - # - # This means that a value of 1.0 corresponds to a solid color, whereas - # a value of 0.0 corresponds to a completely transparent color. This - # uses a wrapper message rather than a simple float scalar so that it is - # possible to distinguish between a default value and the value being unset. - # If omitted, this color object is rendered as a solid color - # (as if the alpha value had been explicitly given a value of 1.0). - class Color - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb deleted file mode 100644 index 086a71b4869a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a whole or partial calendar date, such as a birthday. The time of - # day and time zone are either specified elsewhere or are insignificant. The - # date is relative to the Gregorian Calendar. This can represent one of the - # following: - # - # * A full date, with non-zero year, month, and day values - # * A month and day value, with a zero year, such as an anniversary - # * A year on its own, with zero month and day values - # * A year and month value, with a zero day, such as a credit card expiration - # date - # - # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] year - # @return [::Integer] - # Year of the date. Must be from 1 to 9999, or 0 to specify a date without - # a year. - # @!attribute [rw] month - # @return [::Integer] - # Month of a year. Must be from 1 to 12, or 0 to specify a year without a - # month and day. - # @!attribute [rw] day - # @return [::Integer] - # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 - # to specify a year by itself or a year and month where the day isn't - # significant. - class Date - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb deleted file mode 100644 index 2d8961edc217..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/datetime.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents civil time (or occasionally physical time). - # - # This type can represent a civil time in one of a few possible ways: - # - # * When utc_offset is set and time_zone is unset: a civil time on a calendar - # day with a particular offset from UTC. - # * When time_zone is set and utc_offset is unset: a civil time on a calendar - # day in a particular time zone. - # * When neither time_zone nor utc_offset is set: a civil time on a calendar - # day in local time. - # - # The date is relative to the Proleptic Gregorian Calendar. - # - # If year is 0, the DateTime is considered not to have a specific year. month - # and day must have valid, non-zero values. - # - # This type may also be used to represent a physical time if all the date and - # time fields are set and either case of the `time_offset` oneof is set. - # Consider using `Timestamp` message for physical time instead. If your use - # case also would like to store the user's timezone, that can be done in - # another field. - # - # This type is more flexible than some applications may want. Make sure to - # document and validate your application's limitations. - # @!attribute [rw] year - # @return [::Integer] - # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a - # datetime without a year. - # @!attribute [rw] month - # @return [::Integer] - # Required. Month of year. Must be from 1 to 12. - # @!attribute [rw] day - # @return [::Integer] - # Required. Day of month. Must be from 1 to 31 and valid for the year and - # month. - # @!attribute [rw] hours - # @return [::Integer] - # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API - # may choose to allow the value "24:00:00" for scenarios like business - # closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Required. Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An - # API may allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Required. Fractions of seconds in nanoseconds. Must be from 0 to - # 999,999,999. - # @!attribute [rw] utc_offset - # @return [::Google::Protobuf::Duration] - # UTC offset. Must be whole seconds, between -18 hours and +18 hours. - # For example, a UTC offset of -4:00 would be represented as - # { seconds: -14400 }. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone. - class DateTime - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a time zone from the - # [IANA Time Zone Database](https://www.iana.org/time-zones). - # @!attribute [rw] id - # @return [::String] - # IANA Time Zone Database time zone, e.g. "America/New_York". - # @!attribute [rw] version - # @return [::String] - # Optional. IANA Time Zone Database version number, e.g. "2019a". - class TimeZone - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb deleted file mode 100644 index 800ef43f01cb..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/money.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents an amount of money with its currency type. - # @!attribute [rw] currency_code - # @return [::String] - # The three-letter currency code defined in ISO 4217. - # @!attribute [rw] units - # @return [::Integer] - # The whole units of the amount. - # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - # @!attribute [rw] nanos - # @return [::Integer] - # Number of nano (10^-9) units of the amount. - # The value must be between -999,999,999 and +999,999,999 inclusive. - # If `units` is positive, `nanos` must be positive or zero. - # If `units` is zero, `nanos` can be positive, zero, or negative. - # If `units` is negative, `nanos` must be negative or zero. - # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - class Money - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb deleted file mode 100644 index cd58486c563e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/proto_docs/google/type/postal_address.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a postal address, e.g. for postal delivery or payments addresses. - # Given a postal address, a postal service can deliver items to a premise, P.O. - # Box or similar. - # It is not intended to model geographical locations (roads, towns, - # mountains). - # - # In typical usage an address would be created via user input or from importing - # existing data, depending on the type of process. - # - # Advice on address input / editing: - # - Use an i18n-ready address widget such as - # https://github.com/google/libaddressinput) - # - Users should not be presented with UI elements for input or editing of - # fields outside countries where that field is used. - # - # For more guidance on how to use this schema, please see: - # https://support.google.com/business/answer/6397478 - # @!attribute [rw] revision - # @return [::Integer] - # The schema revision of the `PostalAddress`. This must be set to 0, which is - # the latest revision. - # - # All new revisions **must** be backward compatible with old revisions. - # @!attribute [rw] region_code - # @return [::String] - # Required. CLDR region code of the country/region of the address. This - # is never inferred and it is up to the user to ensure the value is - # correct. See http://cldr.unicode.org/ and - # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] language_code - # @return [::String] - # Optional. BCP-47 language code of the contents of this address (if - # known). This is often the UI language of the input form or is expected - # to match one of the languages used in the address' country/region, or their - # transliterated equivalents. - # This can affect formatting in certain countries, but is not critical - # to the correctness of the data and will never affect any validation or - # other non-formatting related operations. - # - # If this value is not known, it should be omitted (rather than specifying a - # possibly incorrect default). - # - # Examples: "zh-Hant", "ja", "ja-Latn", "en". - # @!attribute [rw] postal_code - # @return [::String] - # Optional. Postal code of the address. Not all countries use or require - # postal codes to be present, but where they are used, they may trigger - # additional validation with other parts of the address (e.g. state/zip - # validation in the U.S.A.). - # @!attribute [rw] sorting_code - # @return [::String] - # Optional. Additional, country-specific, sorting code. This is not used - # in most regions. Where it is used, the value is either a string like - # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number - # alone, representing the "sector code" (Jamaica), "delivery area indicator" - # (Malawi) or "post office indicator" (e.g. CĂ´te d'Ivoire). - # @!attribute [rw] administrative_area - # @return [::String] - # Optional. Highest administrative subdivision which is used for postal - # addresses of a country or region. - # For example, this can be a state, a province, an oblast, or a prefecture. - # Specifically, for Spain this is the province and not the autonomous - # community (e.g. "Barcelona" and not "Catalonia"). - # Many countries don't use an administrative area in postal addresses. E.g. - # in Switzerland this should be left unpopulated. - # @!attribute [rw] locality - # @return [::String] - # Optional. Generally refers to the city/town portion of the address. - # Examples: US city, IT comune, UK post town. - # In regions of the world where localities are not well defined or do not fit - # into this structure well, leave locality empty and use address_lines. - # @!attribute [rw] sublocality - # @return [::String] - # Optional. Sublocality of the address. - # For example, this can be neighborhoods, boroughs, districts. - # @!attribute [rw] address_lines - # @return [::Array<::String>] - # Unstructured address lines describing the lower levels of an address. - # - # Because values in address_lines do not have type information and may - # sometimes contain multiple values in a single field (e.g. - # "Austin, TX"), it is important that the line order is clear. The order of - # address lines should be "envelope order" for the country/region of the - # address. In places where this can vary (e.g. Japan), address_language is - # used to make it explicit (e.g. "ja" for large-to-small ordering and - # "ja-Latn" or "en" for small-to-large). This way, the most specific line of - # an address can be selected based on the language. - # - # The minimum permitted structural representation of an address consists - # of a region_code with all remaining information placed in the - # address_lines. It would be possible to format such an address very - # approximately without geocoding, but no semantic reasoning could be - # made about any of the address components until it was at least - # partially resolved. - # - # Creating an address only containing a region_code and address_lines, and - # then geocoding is the recommended way to handle completely unstructured - # addresses (as opposed to guessing which parts of the address should be - # localities or administrative areas). - # @!attribute [rw] recipients - # @return [::Array<::String>] - # Optional. The recipient at the address. - # This field may, under certain circumstances, contain multiline information. - # For example, it might contain "care of" information. - # @!attribute [rw] organization - # @return [::String] - # Optional. The name of the organization at the address. - class PostalAddress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile deleted file mode 100644 index 83a1cdf1d4f1..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-document_ai-v1beta3", path: "../" -else - gem "google-cloud-document_ai-v1beta3" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb deleted file mode 100644 index 59d427c3f053..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new - - # Call the batch_process_documents method. - result = client.batch_process_documents request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb deleted file mode 100644 index 6314dde8366b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor -# -def create_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new - - # Call the create_processor method. - result = client.create_processor request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb deleted file mode 100644 index 400fbfc6810c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor -# -def delete_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new - - # Call the delete_processor method. - result = client.delete_processor request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb deleted file mode 100644 index 13c9baaead4a..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new - - # Call the delete_processor_version method. - result = client.delete_processor_version request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb deleted file mode 100644 index de4004f15cdf..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new - - # Call the deploy_processor_version method. - result = client.deploy_processor_version request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb deleted file mode 100644 index e13b18555893..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor -# -def disable_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new - - # Call the disable_processor method. - result = client.disable_processor request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb deleted file mode 100644 index f35cc4aa42f2..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor -# -def enable_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new - - # Call the enable_processor method. - result = client.enable_processor request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb deleted file mode 100644 index 787a1f22a065..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new - - # Call the evaluate_processor_version method. - result = client.evaluate_processor_version request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb deleted file mode 100644 index 19f574a3fd99..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new - - # Call the fetch_processor_types method. - result = client.fetch_processor_types request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb deleted file mode 100644 index f615a5e899b3..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation -# -def get_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new - - # Call the get_evaluation method. - result = client.get_evaluation request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb deleted file mode 100644 index 4ecc67faba6d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor -# -def get_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new - - # Call the get_processor method. - result = client.get_processor request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb deleted file mode 100644 index 7a2a90e5aa44..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new - - # Call the get_processor_type method. - result = client.get_processor_type request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb deleted file mode 100644 index f88112b42149..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new - - # Call the get_processor_version method. - result = client.get_processor_version request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb deleted file mode 100644 index 857539ae3a71..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations -# -def list_evaluations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new - - # Call the list_evaluations method. - result = client.list_evaluations request - - # The returned object is of type Gapic::PagedEnumerable. You can - # iterate over all elements by calling #each, and the enumerable - # will lazily make API calls to fetch subsequent pages. Other - # methods are also available for managing paging directly. - result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. - p response - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb deleted file mode 100644 index 2a2fe2f321e6..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new - - # Call the list_processor_types method. - result = client.list_processor_types request - - # The returned object is of type Gapic::PagedEnumerable. You can - # iterate over all elements by calling #each, and the enumerable - # will lazily make API calls to fetch subsequent pages. Other - # methods are also available for managing paging directly. - result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. - p response - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb deleted file mode 100644 index 1f8d5578e172..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new - - # Call the list_processor_versions method. - result = client.list_processor_versions request - - # The returned object is of type Gapic::PagedEnumerable. You can - # iterate over all elements by calling #each, and the enumerable - # will lazily make API calls to fetch subsequent pages. Other - # methods are also available for managing paging directly. - result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - p response - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb deleted file mode 100644 index ed6daa6a232f..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors -# -def list_processors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new - - # Call the list_processors method. - result = client.list_processors request - - # The returned object is of type Gapic::PagedEnumerable. You can - # iterate over all elements by calling #each, and the enumerable - # will lazily make API calls to fetch subsequent pages. Other - # methods are also available for managing paging directly. - result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. - p response - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb deleted file mode 100644 index e4072f9ac6c0..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document -# -def process_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new - - # Call the process_document method. - result = client.process_document request - - # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. - p result -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb deleted file mode 100644 index ab37f486d1a8..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document -# -def review_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new - - # Call the review_document method. - result = client.review_document request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb deleted file mode 100644 index f9270e049972..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new - - # Call the set_default_processor_version method. - result = client.set_default_processor_version request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb deleted file mode 100644 index 987e8c359d3b..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new - - # Call the train_processor_version method. - result = client.train_processor_version request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb deleted file mode 100644 index ced7cfc3058d..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] -require "google/cloud/document_ai/v1beta3" - -## -# Example demonstrating basic usage of -# Google::Cloud::DocumentAI::V1beta3::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::V1beta3::DocumentProcessorService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new - - # Call the undeploy_processor_version method. - result = client.undeploy_processor_version request - - # The returned object is of type Gapic::Operation. You can use this - # object to check the status of an operation, cancel it, or wait - # for results. Here is how to block until completion: - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "Error!" - end -end -# [END documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json b/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json deleted file mode 100644 index c7004d05b3c5..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-document_ai-v1beta3", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.documentai.v1beta3", - "version": "v1beta3" - } - ] - }, - "snippets": [ - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync", - "title": "Snippet for process_document in DocumentProcessorService", - "description": "Basic snippet for process_document in DocumentProcessorService", - "file": "document_processor_service/process_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "process_document", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ProcessDocument", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 38, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync", - "title": "Snippet for batch_process_documents in DocumentProcessorService", - "description": "Basic snippet for batch_process_documents in DocumentProcessorService", - "file": "document_processor_service/batch_process_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_process_documents", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "BatchProcessDocuments", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync", - "title": "Snippet for fetch_processor_types in DocumentProcessorService", - "description": "Basic snippet for fetch_processor_types in DocumentProcessorService", - "file": "document_processor_service/fetch_processor_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_processor_types", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "FetchProcessorTypes", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 38, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync", - "title": "Snippet for list_processor_types in DocumentProcessorService", - "description": "Basic snippet for list_processor_types in DocumentProcessorService", - "file": "document_processor_service/list_processor_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processor_types", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessorTypes", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 44, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_sync", - "title": "Snippet for get_processor_type in DocumentProcessorService", - "description": "Basic snippet for get_processor_type in DocumentProcessorService", - "file": "document_processor_service/get_processor_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor_type", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorType", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessorType", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 38, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync", - "title": "Snippet for list_processors in DocumentProcessorService", - "description": "Basic snippet for list_processors in DocumentProcessorService", - "file": "document_processor_service/list_processors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processors", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessors", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 44, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync", - "title": "Snippet for get_processor in DocumentProcessorService", - "description": "Basic snippet for get_processor in DocumentProcessorService", - "file": "document_processor_service/get_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 38, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync", - "title": "Snippet for train_processor_version in DocumentProcessorService", - "description": "Basic snippet for train_processor_version in DocumentProcessorService", - "file": "document_processor_service/train_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "train_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "TrainProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync", - "title": "Snippet for get_processor_version in DocumentProcessorService", - "description": "Basic snippet for get_processor_version in DocumentProcessorService", - "file": "document_processor_service/get_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 38, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync", - "title": "Snippet for list_processor_versions in DocumentProcessorService", - "description": "Basic snippet for list_processor_versions in DocumentProcessorService", - "file": "document_processor_service/list_processor_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processor_versions", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListProcessorVersions", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 44, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync", - "title": "Snippet for delete_processor_version in DocumentProcessorService", - "description": "Basic snippet for delete_processor_version in DocumentProcessorService", - "file": "document_processor_service/delete_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeleteProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync", - "title": "Snippet for deploy_processor_version in DocumentProcessorService", - "description": "Basic snippet for deploy_processor_version in DocumentProcessorService", - "file": "document_processor_service/deploy_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeployProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync", - "title": "Snippet for undeploy_processor_version in DocumentProcessorService", - "description": "Basic snippet for undeploy_processor_version in DocumentProcessorService", - "file": "document_processor_service/undeploy_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "undeploy_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "UndeployProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync", - "title": "Snippet for create_processor in DocumentProcessorService", - "description": "Basic snippet for create_processor in DocumentProcessorService", - "file": "document_processor_service/create_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::Processor", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "CreateProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 38, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync", - "title": "Snippet for delete_processor in DocumentProcessorService", - "description": "Basic snippet for delete_processor in DocumentProcessorService", - "file": "document_processor_service/delete_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DeleteProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync", - "title": "Snippet for enable_processor in DocumentProcessorService", - "description": "Basic snippet for enable_processor in DocumentProcessorService", - "file": "document_processor_service/enable_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "EnableProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync", - "title": "Snippet for disable_processor in DocumentProcessorService", - "description": "Basic snippet for disable_processor in DocumentProcessorService", - "file": "document_processor_service/disable_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_processor", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "DisableProcessor", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync", - "title": "Snippet for set_default_processor_version in DocumentProcessorService", - "description": "Basic snippet for set_default_processor_version in DocumentProcessorService", - "file": "document_processor_service/set_default_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_default_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "SetDefaultProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync", - "title": "Snippet for review_document in DocumentProcessorService", - "description": "Basic snippet for review_document in DocumentProcessorService", - "file": "document_processor_service/review_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "review_document", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ReviewDocument", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync", - "title": "Snippet for evaluate_processor_version in DocumentProcessorService", - "description": "Basic snippet for evaluate_processor_version in DocumentProcessorService", - "file": "document_processor_service/evaluate_processor_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "evaluate_processor_version", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "EvaluateProcessorVersion", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync", - "title": "Snippet for get_evaluation in DocumentProcessorService", - "description": "Basic snippet for get_evaluation in DocumentProcessorService", - "file": "document_processor_service/get_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_evaluation", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::Evaluation", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "GetEvaluation", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 38, - "type": "FULL" - } - ] - }, - { - "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync", - "title": "Snippet for list_evaluations in DocumentProcessorService", - "description": "Basic snippet for list_evaluations in DocumentProcessorService", - "file": "document_processor_service/list_evaluations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_evaluations", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse", - "client": { - "short_name": "DocumentProcessorService::Client", - "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" - }, - "method": { - "short_name": "ListEvaluations", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", - "service": { - "short_name": "DocumentProcessorService", - "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 44, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb deleted file mode 100644 index fef6ec26facd..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" -require "google/cloud/document_ai/v1beta3/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb deleted file mode 100644 index 7caf5491ec9c..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/document_ai/v1beta3/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientPathsTest < Minitest::Test - def test_evaluation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.evaluation_path project: "value0", location: "value1", processor: "value2", processor_version: "value3", evaluation: "value4" - assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3/evaluations/value4", path - end - end - - def test_human_review_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.human_review_config_path project: "value0", location: "value1", processor: "value2" - assert_equal "projects/value0/locations/value1/processors/value2/humanReviewConfig", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_processor_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.processor_path project: "value0", location: "value1", processor: "value2" - assert_equal "projects/value0/locations/value1/processors/value2", path - end - end - - def test_processor_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.processor_type_path project: "value0", location: "value1", processor_type: "value2" - assert_equal "projects/value0/locations/value1/processorTypes/value2", path - end - end - - def test_processor_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.processor_version_path project: "value0", location: "value1", processor: "value2", processor_version: "value3" - assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb deleted file mode 100644 index 2b2cc9d2780e..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb +++ /dev/null @@ -1,1495 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/documentai/v1beta3/document_processor_service_pb" -require "google/cloud/documentai/v1beta3/document_processor_service_services_pb" -require "google/cloud/document_ai/v1beta3/document_processor_service" - -class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - end - - def test_process_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_document = {} - name = "hello world" - document = {} - skip_human_review = true - field_mask = {} - process_options = {} - - process_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :process_document, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] - assert_equal :inline_document, request.source - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] - assert_equal true, request["skip_human_review"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, process_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.process_document inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.process_document ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.process_document({ inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.process_document(::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new(inline_document: inline_document, name: name, document: document, skip_human_review: skip_human_review, field_mask: field_mask, process_options: process_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, process_document_client_stub.call_rpc_count - end - end - - def test_batch_process_documents - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - input_configs = [{}] - output_config = {} - input_documents = {} - document_output_config = {} - skip_human_review = true - process_options = {} - - batch_process_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_process_documents, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, request["input_configs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig), request["output_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["input_documents"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig), request["document_output_config"] - assert_equal true, request["skip_human_review"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessOptions), request["process_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_process_documents_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_process_documents name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_process_documents ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_process_documents({ name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_process_documents(::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new(name: name, input_configs: input_configs, output_config: output_config, input_documents: input_documents, document_output_config: document_output_config, skip_human_review: skip_human_review, process_options: process_options), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_process_documents_client_stub.call_rpc_count - end - end - - def test_fetch_processor_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - fetch_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_processor_types, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_processor_types_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_processor_types({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_processor_types parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_processor_types ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_processor_types({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_processor_types(::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fetch_processor_types_client_stub.call_rpc_count - end - end - - def test_list_processor_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processor_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processor_types, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_processor_types_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_processor_types parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_processor_types ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_processor_types({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_processor_types(::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_processor_types_client_stub.call_rpc_count - end - end - - def test_get_processor_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_processor_type, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_processor_type_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_processor_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_processor_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_processor_type ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_processor_type({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_processor_type(::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_processor_type_client_stub.call_rpc_count - end - end - - def test_list_processors - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processors, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_processors_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_processors parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_processors ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_processors({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_processors(::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_processors_client_stub.call_rpc_count - end - end - - def test_get_processor - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_processor({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_processor name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_processor ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_processor({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_processor(::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_processor_client_stub.call_rpc_count - end - end - - def test_train_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - processor_version = {} - document_schema = {} - input_data = {} - base_processor_version = "hello world" - - train_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :train_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion), request["processor_version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData), request["input_data"] - assert_equal "hello world", request["base_processor_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, train_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.train_processor_version({ 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 parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.train_processor_version ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(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({ parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.train_processor_version(::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, train_processor_version_client_stub.call_rpc_count - end - end - - def test_get_processor_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_processor_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_processor_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_processor_version ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_processor_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_processor_version(::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_processor_version_client_stub.call_rpc_count - end - end - - def test_list_processor_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_processor_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processor_versions, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_processor_versions_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_processor_versions parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_processor_versions ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_processor_versions({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_processor_versions(::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_processor_versions_client_stub.call_rpc_count - end - end - - def test_delete_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_processor_version({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_processor_version name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_processor_version({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_processor_version_client_stub.call_rpc_count - end - end - - def test_deploy_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - deploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deploy_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deploy_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.deploy_processor_version({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.deploy_processor_version name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.deploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.deploy_processor_version({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.deploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, deploy_processor_version_client_stub.call_rpc_count - end - end - - def test_undeploy_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - undeploy_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undeploy_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undeploy_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undeploy_processor_version({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undeploy_processor_version name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undeploy_processor_version ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undeploy_processor_version({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undeploy_processor_version(::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, undeploy_processor_version_client_stub.call_rpc_count - end - end - - def test_create_processor - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Processor.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - processor = {} - - create_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Processor), request["processor"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_processor({ parent: parent, processor: processor }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_processor parent: parent, processor: processor do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_processor ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_processor({ parent: parent, processor: processor }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_processor(::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new(parent: parent, processor: processor), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_processor_client_stub.call_rpc_count - end - end - - def test_delete_processor - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_processor({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_processor name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_processor ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_processor({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_processor(::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_processor_client_stub.call_rpc_count - end - end - - def test_enable_processor - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - enable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_processor({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_processor name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_processor ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_processor({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_processor(::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_processor_client_stub.call_rpc_count - end - end - - def test_disable_processor - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - disable_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_processor, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_processor_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_processor({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_processor name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_processor ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_processor({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_processor(::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_processor_client_stub.call_rpc_count - end - end - - def test_set_default_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - processor = "hello world" - default_processor_version = "hello world" - - set_default_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_default_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, request - assert_equal "hello world", request["processor"] - assert_equal "hello world", request["default_processor_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_default_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_default_processor_version processor: processor, default_processor_version: default_processor_version do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_default_processor_version ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_default_processor_version({ processor: processor, default_processor_version: default_processor_version }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_default_processor_version(::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new(processor: processor, default_processor_version: default_processor_version), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_default_processor_version_client_stub.call_rpc_count - end - end - - def test_review_document - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_document = {} - human_review_config = "hello world" - document = {} - enable_schema_validation = true - priority = :DEFAULT - document_schema = {} - - review_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :review_document, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["inline_document"] - assert_equal :inline_document, request.source - assert_equal "hello world", request["human_review_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::Document), request["document"] - assert_equal true, request["enable_schema_validation"] - assert_equal :DEFAULT, request["priority"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, review_document_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.review_document inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.review_document ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.review_document({ inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.review_document(::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new(inline_document: inline_document, human_review_config: human_review_config, document: document, enable_schema_validation: enable_schema_validation, priority: priority, document_schema: document_schema), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, review_document_client_stub.call_rpc_count - end - end - - def test_evaluate_processor_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - processor_version = "hello world" - evaluation_documents = {} - - evaluate_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :evaluate_processor_version, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, request - assert_equal "hello world", request["processor_version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["evaluation_documents"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, evaluate_processor_version_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.evaluate_processor_version processor_version: processor_version, evaluation_documents: evaluation_documents do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.evaluate_processor_version ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.evaluate_processor_version(::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, evaluate_processor_version_client_stub.call_rpc_count - end - end - - def test_get_evaluation - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_evaluation, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_evaluation_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_evaluation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_evaluation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_evaluation ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_evaluation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_evaluation(::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_evaluation_client_stub.call_rpc_count - end - end - - def test_list_evaluations - # Create GRPC objects. - grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_evaluations, name - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_evaluations_client_stub do - # Create client - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_evaluations parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_evaluations ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_evaluations(::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_evaluations_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb b/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb deleted file mode 100644 index b5db6a24f8e9..000000000000 --- a/owl-bot-staging/google-cloud-document_ai-v1beta3/test/helper.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg"