From b0caa17bc2f5af2449dc9de7d7d85f8405124e95 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 18 Sep 2026 16:37:05 -0400 Subject: [PATCH 1/3] feat!: Replace google-cloud-automl-v1 with a tombstone --- google-cloud-automl-v1/.gitignore | 20 - google-cloud-automl-v1/.repo-metadata.json | 20 - google-cloud-automl-v1/.rubocop.yml | 33 - google-cloud-automl-v1/.toys.rb | 28 - google-cloud-automl-v1/.yardopts | 5 +- google-cloud-automl-v1/AUTHENTICATION.md | 122 - google-cloud-automl-v1/CHANGELOG.md | 289 -- google-cloud-automl-v1/Gemfile | 15 - google-cloud-automl-v1/Gemfile.lock | 300 --- google-cloud-automl-v1/LICENSE.md | 4 +- google-cloud-automl-v1/README.md | 152 +- google-cloud-automl-v1/Rakefile | 150 -- google-cloud-automl-v1/gapic_metadata.json | 127 - .../google-cloud-automl-v1.gemspec | 41 +- .../lib/google-cloud-automl-v1.rb | 21 - .../lib/google/cloud/automl/v1.rb | 46 - .../lib/google/cloud/automl/v1/_helpers.rb | 26 - .../cloud/automl/v1/annotation_payload_pb.rb | 27 - .../cloud/automl/v1/annotation_spec_pb.rb | 23 - .../lib/google/cloud/automl/v1/automl.rb | 69 - .../google/cloud/automl/v1/automl/client.rb | 2351 ----------------- .../cloud/automl/v1/automl/credentials.rb | 51 - .../cloud/automl/v1/automl/operations.rb | 851 ------ .../google/cloud/automl/v1/automl/paths.rb | 130 - .../lib/google/cloud/automl/v1/automl/rest.rb | 66 - .../cloud/automl/v1/automl/rest/client.rb | 2182 --------------- .../cloud/automl/v1/automl/rest/operations.rb | 1095 -------- .../automl/v1/automl/rest/service_stub.rb | 1188 --------- .../cloud/automl/v1/classification_pb.rb | 26 - .../google/cloud/automl/v1/data_items_pb.rb | 32 - .../lib/google/cloud/automl/v1/dataset_pb.rb | 27 - .../google/cloud/automl/v1/detection_pb.rb | 26 - .../lib/google/cloud/automl/v1/geometry_pb.rb | 22 - .../lib/google/cloud/automl/v1/image_pb.rb | 29 - .../lib/google/cloud/automl/v1/io_pb.rb | 30 - .../cloud/automl/v1/model_evaluation_pb.rb | 29 - .../lib/google/cloud/automl/v1/model_pb.rb | 28 - .../google/cloud/automl/v1/operations_pb.rb | 37 - .../cloud/automl/v1/prediction_service.rb | 59 - .../automl/v1/prediction_service/client.rb | 770 ------ .../v1/prediction_service/credentials.rb | 51 - .../v1/prediction_service/operations.rb | 851 ------ .../automl/v1/prediction_service/paths.rb | 52 - .../automl/v1/prediction_service/rest.rb | 56 - .../v1/prediction_service/rest/client.rb | 713 ----- .../v1/prediction_service/rest/operations.rb | 1095 -------- .../prediction_service/rest/service_stub.rb | 205 -- .../cloud/automl/v1/prediction_service_pb.rb | 33 - .../v1/prediction_service_services_pb.rb | 99 - .../lib/google/cloud/automl/v1/rest.rb | 38 - .../lib/google/cloud/automl/v1/service_pb.rb | 55 - .../cloud/automl/v1/service_services_pb.rb | 136 - .../cloud/automl/v1/text_extraction_pb.rb | 25 - .../lib/google/cloud/automl/v1/text_pb.rb | 28 - .../google/cloud/automl/v1/text_segment_pb.rb | 21 - .../cloud/automl/v1/text_sentiment_pb.rb | 24 - .../google/cloud/automl/v1/translation_pb.rb | 27 - .../lib/google/cloud/automl/v1/version.rb | 28 - google-cloud-automl-v1/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 ----- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../cloud/automl/v1/annotation_payload.rb | 70 - .../google/cloud/automl/v1/annotation_spec.rb | 45 - .../google/cloud/automl/v1/classification.rb | 189 -- .../google/cloud/automl/v1/data_items.rb | 202 -- .../google/cloud/automl/v1/dataset.rb | 106 - .../google/cloud/automl/v1/detection.rb | 97 - .../google/cloud/automl/v1/geometry.rb | 53 - .../google/cloud/automl/v1/image.rb | 215 -- .../proto_docs/google/cloud/automl/v1/io.rb | 1345 ---------- .../google/cloud/automl/v1/model.rb | 121 - .../cloud/automl/v1/model_evaluation.rb | 100 - .../google/cloud/automl/v1/operations.rb | 197 -- .../cloud/automl/v1/prediction_service.rb | 270 -- .../google/cloud/automl/v1/service.rb | 326 --- .../proto_docs/google/cloud/automl/v1/text.rb | 76 - .../google/cloud/automl/v1/text_extraction.rb | 73 - .../google/cloud/automl/v1/text_segment.rb | 44 - .../google/cloud/automl/v1/text_sentiment.rb | 82 - .../google/cloud/automl/v1/translation.rb | 79 - .../google/longrunning/operations.rb | 191 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 128 - .../proto_docs/google/rpc/status.rb | 48 - google-cloud-automl-v1/snippets/Gemfile | 32 - .../snippets/automl/create_dataset.rb | 54 - .../snippets/automl/create_model.rb | 54 - .../snippets/automl/delete_dataset.rb | 54 - .../snippets/automl/delete_model.rb | 54 - .../snippets/automl/deploy_model.rb | 54 - .../snippets/automl/export_data.rb | 54 - .../snippets/automl/export_model.rb | 54 - .../snippets/automl/get_annotation_spec.rb | 47 - .../snippets/automl/get_dataset.rb | 47 - .../snippets/automl/get_model.rb | 47 - .../snippets/automl/get_model_evaluation.rb | 47 - .../snippets/automl/import_data.rb | 54 - .../snippets/automl/list_datasets.rb | 51 - .../snippets/automl/list_model_evaluations.rb | 51 - .../snippets/automl/list_models.rb | 51 - .../snippets/automl/undeploy_model.rb | 54 - .../snippets/automl/update_dataset.rb | 47 - .../snippets/automl/update_model.rb | 47 - .../prediction_service/batch_predict.rb | 54 - .../snippets/prediction_service/predict.rb | 47 - ...ippet_metadata_google.cloud.automl.v1.json | 815 ------ .../cloud/automl/v1/automl_operations_test.rb | 400 --- .../cloud/automl/v1/automl_paths_test.rb | 103 - .../cloud/automl/v1/automl_rest_test.rb | 1088 -------- .../google/cloud/automl/v1/automl_test.rb | 1257 --------- .../v1/prediction_service_operations_test.rb | 400 --- .../v1/prediction_service_paths_test.rb | 55 - .../automl/v1/prediction_service_rest_test.rb | 212 -- .../automl/v1/prediction_service_test.rb | 249 -- google-cloud-automl-v1/test/helper.rb | 35 - librarian.yaml | 12 - 121 files changed, 26 insertions(+), 25281 deletions(-) delete mode 100644 google-cloud-automl-v1/.gitignore delete mode 100644 google-cloud-automl-v1/.repo-metadata.json delete mode 100644 google-cloud-automl-v1/.rubocop.yml delete mode 100644 google-cloud-automl-v1/.toys.rb delete mode 100644 google-cloud-automl-v1/AUTHENTICATION.md delete mode 100644 google-cloud-automl-v1/CHANGELOG.md delete mode 100644 google-cloud-automl-v1/Gemfile delete mode 100644 google-cloud-automl-v1/Gemfile.lock delete mode 100644 google-cloud-automl-v1/gapic_metadata.json delete mode 100644 google-cloud-automl-v1/lib/google-cloud-automl-v1.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/_helpers.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_payload_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_spec_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/client.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/credentials.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/operations.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/paths.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/client.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/operations.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/classification_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/data_items_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/dataset_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/detection_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/geometry_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/image_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/io_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/model_evaluation_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/model_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/operations_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/client.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/credentials.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/operations.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/paths.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/client.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/operations.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_services_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/rest.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/service_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/service_services_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/text_extraction_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/text_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/text_segment_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/text_sentiment_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/translation_pb.rb delete mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb delete mode 100644 google-cloud-automl-v1/proto_docs/README.md delete mode 100644 google-cloud-automl-v1/proto_docs/google/api/client.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/api/resource.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_payload.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_spec.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/classification.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/data_items.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/dataset.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/detection.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/geometry.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/image.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/io.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model_evaluation.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/operations.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/prediction_service.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/service.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_extraction.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_segment.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_sentiment.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/translation.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/protobuf/any.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 google-cloud-automl-v1/proto_docs/google/rpc/status.rb delete mode 100644 google-cloud-automl-v1/snippets/Gemfile delete mode 100644 google-cloud-automl-v1/snippets/automl/create_dataset.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/create_model.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/delete_dataset.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/delete_model.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/deploy_model.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/export_data.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/export_model.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/get_dataset.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/get_model.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/import_data.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/list_datasets.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/list_models.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/undeploy_model.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/update_dataset.rb delete mode 100644 google-cloud-automl-v1/snippets/automl/update_model.rb delete mode 100644 google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb delete mode 100644 google-cloud-automl-v1/snippets/prediction_service/predict.rb delete mode 100644 google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb delete mode 100644 google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb delete mode 100644 google-cloud-automl-v1/test/helper.rb diff --git a/google-cloud-automl-v1/.gitignore b/google-cloud-automl-v1/.gitignore deleted file mode 100644 index a2e97ac84259..000000000000 --- a/google-cloud-automl-v1/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -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/google-cloud-automl-v1/.repo-metadata.json b/google-cloud-automl-v1/.repo-metadata.json deleted file mode 100644 index 0ee07c5c6893..000000000000 --- a/google-cloud-automl-v1/.repo-metadata.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "api_id": "automl.googleapis.com", - "api_shortname": "automl", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-automl-v1/latest", - "distribution_name": "google-cloud-automl-v1", - "is_cloud": true, - "language": "ruby", - "name": "automl", - "name_pretty": "Cloud AutoML V1 API", - "product_documentation": "https://cloud.google.com/automl", - "release_level": "stable", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "AutoML makes the power of machine learning available to you even if you have limited knowledge of machine learning. You can use AutoML to build on Google's machine learning capabilities to create your own custom machine learning models that are tailored to your business needs, and then integrate those models into your applications and web sites. Note that google-cloud-automl-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-automl instead. See the readme for more details.", - "ruby-cloud-env-prefix": "AUTOML", - "ruby-cloud-product-url": "https://cloud.google.com/automl", - "ruby-cloud-path-override": "auto_ml=automl", - "ruby-cloud-namespace-override": "AutoMl=AutoML;Automl=AutoML", - "library_type": "GAPIC_COMBO" -} diff --git a/google-cloud-automl-v1/.rubocop.yml b/google-cloud-automl-v1/.rubocop.yml deleted file mode 100644 index 622056ff5619..000000000000 --- a/google-cloud-automl-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-automl-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-automl-v1.rb" diff --git a/google-cloud-automl-v1/.toys.rb b/google-cloud-automl-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/google-cloud-automl-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/google-cloud-automl-v1/.yardopts b/google-cloud-automl-v1/.yardopts index cecfd779ab86..9281742f98db 100644 --- a/google-cloud-automl-v1/.yardopts +++ b/google-cloud-automl-v1/.yardopts @@ -1,12 +1,9 @@ --no-private ---title="Cloud AutoML V1 API" ---exclude _pb\.rb$ +--title="Obsolete Gem google-cloud-automl-v1" --markup markdown --markup-provider redcarpet ./lib/**/*.rb -./proto_docs/**/*.rb - README.md LICENSE.md -AUTHENTICATION.md diff --git a/google-cloud-automl-v1/AUTHENTICATION.md b/google-cloud-automl-v1/AUTHENTICATION.md deleted file mode 100644 index 5381a147f986..000000000000 --- a/google-cloud-automl-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-automl-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-automl-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/automl/v1" - -client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/automl/v1" - -::Google::Cloud::AutoML::V1::PredictionService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-automl-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/automl/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/google-cloud-automl-v1/CHANGELOG.md b/google-cloud-automl-v1/CHANGELOG.md deleted file mode 100644 index cdd5a6912ff5..000000000000 --- a/google-cloud-automl-v1/CHANGELOG.md +++ /dev/null @@ -1,289 +0,0 @@ -# Release History - -### 1.8.1 (2026-08-05) - -#### Bug Fixes - -* generate double-wildcard path patterns with capture groups ([#35045](https://github.com/googleapis/google-cloud-ruby/issues/35045)) - -### 1.8.0 (2026-06-11) - -#### Features - -* update gapic-common dependency to 1.3 and document retry jitter ([#34039](https://github.com/googleapis/google-cloud-ruby/issues/34039)) - -### 1.7.0 (2026-04-02) - -#### Features - -* publish client batch config schema ([#33430](https://github.com/googleapis/google-cloud-ruby/issues/33430)) - -### 1.6.0 (2026-03-19) - -#### Features - -* Upgrade dependencies for Ruby v4.0 and drop Ruby v3.1 support - -### 1.5.1 (2025-10-27) - -#### Documentation - -* add warning about loading unvalidated credentials - -### 1.5.0 (2025-10-08) - -#### Features - -* add ListOperations partial success flag ([#31575](https://github.com/googleapis/google-cloud-ruby/issues/31575)) -* add ListOperations unreachable resources - -### 1.4.0 (2025-09-11) - -#### Features - -* update gapic-common dependency for generated libraries to 1.2 which requires google-protobuf v4.26+ - -### 1.3.1 (2025-07-15) - -#### Documentation - -* clarify documentation for cases when multiple parameters are mutually exclusive for an RPC method ([#30623](https://github.com/googleapis/google-cloud-ruby/issues/30623)) - -### 1.3.0 (2025-05-12) - -#### Features - -* Updated core dependencies including gapic-common -* Updated required Ruby version to 3.1 - -### 1.2.1 (2025-04-29) - -#### Bug Fixes - -* Fixed several issues with validating credential configs - -### 1.2.0 (2025-01-28) - -#### Features - -* Update Ruby version requirement to 3.0 -#### Documentation - -* Clarify behavior of protobuf message fields that are part of mutually-exclusive sets -* Include note about validating externally-provided credentials - -### 1.1.0 (2024-12-10) - -#### Features - -* Provide opt-in debug logging -#### Documentation - -* Removed some incorrect HTML from documentation ([#27744](https://github.com/googleapis/google-cloud-ruby/issues/27744)) - -### 1.0.1 (2024-08-30) - -#### Documentation - -* Add field `experimental_features` to message `PythonSettings` - -### 1.0.0 (2024-07-08) - -#### Features - -* Bump version to 1.0.0 - -### 0.10.0 (2024-02-26) - -#### Features - -* Updated minimum Ruby version to 2.7 ([#24863](https://github.com/googleapis/google-cloud-ruby/issues/24863)) - -### 0.9.2 (2024-02-01) - -#### Bug Fixes - -* Eliminated a harmless but annoying warning in the protobuf class files - -### 0.9.1 (2024-01-12) - -#### Bug Fixes - -* Ensure endpoints are correct for mixin clients ([#24032](https://github.com/googleapis/google-cloud-ruby/issues/24032)) - -### 0.9.0 (2024-01-11) - -#### Features - -* Support for universe_domain ([#23773](https://github.com/googleapis/google-cloud-ruby/issues/23773)) - -### 0.8.0 (2023-09-12) - -#### Features - -* Support for channel pool configuration ([#22916](https://github.com/googleapis/google-cloud-ruby/issues/22916)) - -### 0.7.0 (2023-06-06) - -#### Features - -* Uses binary protobuf definitions for better forward compatibility ([#21671](https://github.com/googleapis/google-cloud-ruby/issues/21671)) -#### Bug Fixes - -* Don't use self-signed JWT credentials if the global configuration endpoint has been modified - -### 0.6.0 (2023-03-08) - -#### Features - -* Support REST transport ([#20624](https://github.com/googleapis/google-cloud-ruby/issues/20624)) - -### 0.5.1 (2023-02-17) - -#### Bug Fixes - -* Fixed routing header sent with long-running operation calls ([#20447](https://github.com/googleapis/google-cloud-ruby/issues/20447)) - -### 0.5.0 (2022-07-01) - -#### Features - -* Updated minimum Ruby version to 2.6 ([#18443](https://github.com/googleapis/google-cloud-ruby/issues/18443)) -#### Bug Fixes - -* Fixed a crash when making certain long-running-operations status calls ([#18441](https://github.com/googleapis/google-cloud-ruby/issues/18441)) - -### 0.4.8 / 2022-02-17 - -#### Bug Fixes - -* Cleaned up some unused requires - -### 0.4.7 / 2022-01-13 - -#### Documentation - -* Various updates to the reference documentation - -### 0.4.6 / 2022-01-11 - -#### Bug Fixes - -* Honor quota project in auxiliary operations clients - -#### Documentation - -* Fix titles of documentation pages -* Remove some broken images and fix outdated content in authentication documentation - -### 0.4.5 / 2021-12-07 - -#### Documentation - -* Formatting fixes in the reference docs - -### 0.4.4 / 2021-11-08 - -#### Documentation - -* Added simple code snippets to RPC method documentation - -### 0.4.3 / 2021-08-11 - -#### Bug Fixes - -* Honor client-level timeout configuration - -### 0.4.2 / 2021-07-12 - -#### Documentation - -* Clarify some language around authentication configuration - -### 0.4.1 / 2021-06-17 - -#### Bug Fixes - -* Support future 1.x versions of gapic-common - -### 0.4.0 / 2021-03-08 - -#### Features - -* Drop support for Ruby 2.4 and add support for Ruby 3.0 - -### 0.3.0 / 2021-02-03 - -#### Features - -* Use self-signed JWT credentials when possible - -### 0.2.8 / 2021-01-19 - -#### Documentation - -* Timeout config description correctly gives the units as seconds. - -### 0.2.7 / 2020-12-08 - -#### Bug Fixes - -* Set version constants in the correct modules - -### 0.2.6 / 2020-08-10 - -#### Bug Fixes - -* Allow special symbolic credentials in client configs - -### 0.2.5 / 2020-08-06 - -#### Bug Fixes - -* Fix retry logic by checking the correct numeric error codes - -### 0.2.4 / 2020-06-18 - -#### Documentation - -* Add documentation and API enablement links to the readme - -### 0.2.3 / 2020-06-08 - -#### Bug Fixes - -* Eliminate a Ruby warning that appeared in some cases when accessing rpc-scoped configs - -#### Documentation - -* Fix additional broken/misformatted links - -### 0.2.2 / 2020-05-28 - -#### Documentation - -* Fix a few broken links - -### 0.2.1 / 2020-05-26 - -#### Bug Fixes - -* Removed unused google/cloud/common_resources_pb file -* The long-running operations client honors the quota_project config - -### 0.2.0 / 2020-05-20 - -#### Features - -* The quota_project can be set via configuration - -### 0.1.1 / 2020-05-05 - -#### Documentation - -* Clarify that timeouts are in seconds. -* Clean up formatting of a few documentation sections. - -### 0.1.0 / 2020-04-24 - -Initial release. diff --git a/google-cloud-automl-v1/Gemfile b/google-cloud-automl-v1/Gemfile deleted file mode 100644 index 823c136ec3c0..000000000000 --- a/google-cloud-automl-v1/Gemfile +++ /dev/null @@ -1,15 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-reporters", "~> 1.8.0", require: false -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/google-cloud-automl-v1/Gemfile.lock b/google-cloud-automl-v1/Gemfile.lock deleted file mode 100644 index 6626df753264..000000000000 --- a/google-cloud-automl-v1/Gemfile.lock +++ /dev/null @@ -1,300 +0,0 @@ -PATH - remote: . - specs: - google-cloud-automl-v1 (1.8.0) - gapic-common (~> 1.3) - google-cloud-errors (~> 1.0) - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.9.0) - public_suffix (>= 2.0.2, < 8.0) - ansi (1.6.0) - ast (2.4.3) - base64 (0.3.0) - bigdecimal (4.1.2) - builder (3.3.0) - drb (2.2.3) - erb (6.0.6) - faraday (2.14.3) - faraday-net_http (>= 2.0, < 3.5) - json - logger - faraday-net_http (3.4.4) - net-http (~> 0.5) - faraday-retry (2.4.0) - faraday (~> 2.0) - gapic-common (1.3.0) - faraday (>= 1.9, < 3.a) - faraday-retry (>= 1.0, < 3.a) - google-cloud-env (~> 2.2) - google-logging-utils (~> 0.1) - google-protobuf (~> 4.26) - googleapis-common-protos (~> 1.6) - googleapis-common-protos-types (~> 1.15) - googleauth (~> 1.12) - grpc (~> 1.66) - google-cloud-env (2.4.0) - base64 (~> 0.2) - faraday (>= 1.0, < 3.a) - google-cloud-errors (1.7.0) - google-logging-utils (0.2.0) - google-protobuf (4.35.1) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-aarch64-linux-gnu) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-aarch64-linux-musl) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-arm64-darwin) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-x86-linux-gnu) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-x86-linux-musl) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-x86_64-darwin) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-x86_64-linux-gnu) - bigdecimal - rake (~> 13.3) - google-protobuf (4.35.1-x86_64-linux-musl) - bigdecimal - rake (~> 13.3) - google-style (1.32.0) - rubocop (~> 1.76) - googleapis-common-protos (1.10.0) - google-protobuf (~> 4.26) - googleapis-common-protos-types (~> 1.21) - grpc (~> 1.41) - googleapis-common-protos-types (1.23.0) - google-protobuf (~> 4.26) - googleauth (1.17.3) - faraday (>= 1.0, < 3.a) - google-cloud-env (~> 2.2) - google-logging-utils (~> 0.1) - jwt (>= 1.4, < 4.0) - os (>= 0.9, < 2.0) - pstore (~> 0.1) - signet (>= 0.16, < 2.a) - grpc (1.83.0) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-aarch64-linux-gnu) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-aarch64-linux-musl) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-arm64-darwin) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-x86-linux-gnu) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-x86-linux-musl) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-x86_64-darwin) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-x86_64-linux-gnu) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - grpc (1.83.0-x86_64-linux-musl) - google-protobuf (>= 3.25, < 5.0) - googleapis-common-protos-types (~> 1.0) - io-console (0.8.2) - irb (1.18.0) - pp (>= 0.6.0) - prism (>= 1.3.0) - rdoc (>= 4.0.0) - reline (>= 0.4.2) - json (2.21.2) - jwt (3.2.0) - base64 - language_server-protocol (3.17.0.6) - lint_roller (1.1.0) - logger (1.7.0) - minitest (6.0.6) - drb (~> 2.0) - prism (~> 1.5) - minitest-focus (1.4.1) - minitest (> 5.0) - minitest-mock (5.27.0) - minitest-reporters (1.8.0) - ansi - builder - minitest (>= 5.0, < 7) - ruby-progressbar - minitest-rg (5.4.0) - minitest (>= 5.0, < 7) - net-http (0.9.1) - uri (>= 0.11.1) - os (1.1.4) - ostruct (0.5.5) - parallel (2.1.0) - parser (3.3.12.0) - ast (~> 2.4.1) - racc - pp (0.6.4) - prettyprint - prettyprint (0.2.0) - prism (1.9.0) - pstore (0.2.1) - public_suffix (7.0.5) - racc (1.8.1) - rainbow (3.1.1) - rake (13.4.2) - rbs (4.1.1) - logger - prism (>= 1.6.0) - tsort - rdoc (8.0.0) - erb - prism (>= 1.6.0) - rbs (>= 4.0.0) - tsort - redcarpet (3.6.1) - regexp_parser (2.12.0) - reline (0.6.3) - io-console (~> 0.5) - rubocop (1.88.2) - json (~> 2.3) - language_server-protocol (~> 3.17.0.2) - lint_roller (~> 1.1.0) - parallel (>= 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.49.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.50.0) - parser (>= 3.3.7.2) - prism (~> 1.7) - ruby-progressbar (1.13.0) - signet (0.22.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 4.0) - tsort (0.2.0) - unicode-display_width (3.2.0) - unicode-emoji (~> 4.1) - unicode-emoji (4.2.0) - uri (1.1.1) - yard (0.9.45) - -PLATFORMS - aarch64-linux-gnu - aarch64-linux-musl - arm64-darwin - ruby - x86-linux-gnu - x86-linux-musl - x86_64-darwin - x86_64-linux-gnu - x86_64-linux-musl - -DEPENDENCIES - google-cloud-automl-v1! - google-style (~> 1.32.0) - irb (~> 1.17) - minitest (~> 6.0.2) - minitest-focus (~> 1.4) - minitest-mock (~> 5.27) - minitest-reporters (~> 1.8.0) - minitest-rg (~> 5.3) - ostruct (~> 0.5.5) - rake (>= 13.0) - redcarpet (~> 3.6) - yard (~> 0.9) - -CHECKSUMS - addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af - ansi (1.6.0) sha256=ac9ea0c0ea8d32fb4e271348e609963ac78882f34b73836c2a02b3622e666658 - ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 - base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b - bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd - builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f - bundler (4.0.14) sha256=d09a0a965cf772266a7e49e83610be7c2f4e49e61134c42a56804bb383cc24b8 - drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373 - erb (6.0.6) sha256=a9b24986700f5bf127c4f297c5403c3ca41b83b0a316c0cd09a096b56e644ae5 - faraday (2.14.3) sha256=1882247e6766615c8220b4392bf1d27f6ebb63d8e28267587cef1fb0bf37f278 - faraday-net_http (3.4.4) sha256=0e78af151747ed1b00f33e25973b4bc220d7f16c00c39676817c8b12331eb588 - faraday-retry (2.4.0) sha256=7b79c48fb7e56526faf247b12d94a680071ff40c9fda7cf1ec1549439ad11ebe - gapic-common (1.3.0) sha256=4e5d9be1effb7366e2cda13c0f44922285d5613ac8de8b9b18c2c835fe4faa91 - google-cloud-automl-v1 (1.8.0) - google-cloud-env (2.4.0) sha256=01cb35ecee5d1c4d1cd4deaed8bb5bddc838e296bcc2a35c5d1ddd07ce40d28d - google-cloud-errors (1.7.0) sha256=6e682f42d89aae08689f36f28495de629d756da076bafff0003bac7f8042ebb3 - google-logging-utils (0.2.0) sha256=675462b4ea5affa825a3442694ca2d75d0069455a1d0956127207498fca3df7b - google-protobuf (4.35.1) sha256=a3a6471331d918f58dfa4d014a8f6286f0af2cf4840216bde52fcf2ea3fe3726 - google-protobuf (4.35.1-aarch64-linux-gnu) sha256=50ca44d0eeff3f8475e630a1accdd974256f3510694d574e2c9d6119ea8bc9e1 - google-protobuf (4.35.1-aarch64-linux-musl) sha256=d5c65cef6bd6498a9e5ed5f88cf6cf7e341c10b0a005e32137d5d1a2b6e8c18a - google-protobuf (4.35.1-arm64-darwin) sha256=d9c957df04fa89c749fa9a72a7b383eb4296efc9b2303dc6fd6fbe39c698ad6b - google-protobuf (4.35.1-x86-linux-gnu) sha256=cc7492566b27ad8b5dfa3a7b6f9b11e905050cc53c2fa8ff22de375a9e7a70fb - google-protobuf (4.35.1-x86-linux-musl) sha256=ab403790b59e4dc588ffbed1eaacf05d4ca2f0d12ac9c13d6c64e69380d8c99e - google-protobuf (4.35.1-x86_64-darwin) sha256=66b62b4df00931018a692806df66393efa960d6d2b7da69735187249f950d3ee - google-protobuf (4.35.1-x86_64-linux-gnu) sha256=c786439087512a3fbd199e9897d265b855f951d4027e218ea55e858d45969edd - google-protobuf (4.35.1-x86_64-linux-musl) sha256=91890eb0002934a339fdb7d77a147c46b7474b6799db27872b747b905837f744 - google-style (1.32.0) sha256=3b13068979e5b8caa067ecce9bf818b6cf0e5eb706ead41c5b905f237d9bfb01 - googleapis-common-protos (1.10.0) sha256=13e47ad0ce85d3d30065c03863efd302a82b0e08ba576f2a9b9dbbfeecb57ee0 - googleapis-common-protos-types (1.23.0) sha256=992e740a523794d9fc5f29a504465d8fc737aaa16c930fe7228e3346860faf0a - googleauth (1.17.3) sha256=9a655455885c0c17a8b70537acd2a992a7c7842c43c06c6612dfb0d93e755d58 - grpc (1.83.0) sha256=38119e7f9f7cbc98e79145201da4be470a7542b0befad454651d35015ea55c59 - grpc (1.83.0-aarch64-linux-gnu) sha256=11562efdded494b2277fd9c3c530dfdf90177faa111526ae9e748d0be29f1a9d - grpc (1.83.0-aarch64-linux-musl) sha256=ee745eab4f3922ed27d379cbc4bc0a99e58db367fa96312e9fe258aafd3afeb2 - grpc (1.83.0-arm64-darwin) sha256=25dd772aa80529f014d70da069787cd39b469c9edacbe493da4ff19952a147e2 - grpc (1.83.0-x86-linux-gnu) sha256=e9b20f54b8e8915f3921f12b266742e79da2c31d60e88295e15d0d16ea3cfd55 - grpc (1.83.0-x86-linux-musl) sha256=868e66d9c2a77eca1a93292fd879565219821fb5888673aedd08154303c9520c - grpc (1.83.0-x86_64-darwin) sha256=cfad91d559d1907159a5247fb12dc112a8ea0ebe2027ca7f5ab648d01a645716 - grpc (1.83.0-x86_64-linux-gnu) sha256=25d66bfa3cb1b05258b3f9632478c7e7ceb52cb16ccc0b4b26d7df36be7158b1 - grpc (1.83.0-x86_64-linux-musl) sha256=a5023264dbb8038c23b147bbf80adb06932ef11b5ab493412e9e37a43114fa8c - io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc - irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3 - json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a - jwt (3.2.0) sha256=5419b1fe37b1da0982bd07051f573a8b8789ab724c2aa7e785e4784a3ed217d7 - language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0 - lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 - logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 - minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1 - minitest-focus (1.4.1) sha256=394517cbe2dcb2d992d8ffc41a3b2b6315777a4daa69239de4fefe7110dd810e - minitest-mock (5.27.0) sha256=7040ed7185417a966920987eaa6eaf1be4ea1fc5b25bb03ff4703f98564a55b0 - minitest-reporters (1.8.0) sha256=8ce5280fb73ad3178ae525454df169b6f28c1b38b1d088ea91815d3a370ba384 - minitest-rg (5.4.0) sha256=54d42bb8ce876381245be5866f3c1dd704ef79c06ba5c9ff280c0aa28c56effb - net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996 - os (1.1.4) sha256=57816d6a334e7bd6aed048f4b0308226c5fb027433b67d90a9ab435f35108d3f - ostruct (0.5.5) sha256=bc73d0e10f85ca2afdddc7eb79b3132bee622e2281db4e6e033a4cbf7d845efb - parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356 - parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828 - pp (0.6.4) sha256=dfcb0fce700c41456265922884f9fe195d7fbb0674a3578e6c0f69588e82b570 - prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193 - prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 - pstore (0.2.1) sha256=03904d0f2c66579e96d1e6704cdabc0c88df7ea8ed8782d9f3569f6f6c702c1a - public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 - racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f - rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a - rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 - rbs (4.1.1) sha256=1bf118f2f95d1cd3956357645d495152b661e0257e57781d18ceecd461622b9e - rdoc (8.0.0) sha256=03bf8c08a9639658855a0cfd77c0abca8325c227693f7f33f82957811348c469 - redcarpet (3.6.1) sha256=d444910e6aa55480c6bcdc0cdb057626e8a32c054c29e793fa642ba2f155f445 - regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb - reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835 - rubocop (1.88.2) sha256=8def251c90cd955feb4daa3edc0ab56893250c4ce90ef81e6c80c03f9a939bbf - rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db - ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 - signet (0.22.0) sha256=b76d495ccb07ad35dbc89f3e920665a9d8ed717141955034005d7843dcfe4780 - tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f - unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 - unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f - uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 - yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51 - -BUNDLED WITH - 4.0.14 diff --git a/google-cloud-automl-v1/LICENSE.md b/google-cloud-automl-v1/LICENSE.md index c261857ba6ad..60673914fcc1 100644 --- a/google-cloud-automl-v1/LICENSE.md +++ b/google-cloud-automl-v1/LICENSE.md @@ -1,6 +1,6 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -192,7 +192,7 @@ 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 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/google-cloud-automl-v1/README.md b/google-cloud-automl-v1/README.md index bb333afb8a56..886633fc910a 100644 --- a/google-cloud-automl-v1/README.md +++ b/google-cloud-automl-v1/README.md @@ -1,150 +1,4 @@ -# Ruby Client for the Cloud AutoML V1 API +# Tombstone for Ruby gem google-cloud-automl-v1 -Train high-quality custom machine learning models with minimum effort and machine learning expertise. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud AutoML V1 API. Most users should consider using -the main client gem, -[google-cloud-automl](https://rubygems.org/gems/google-cloud-automl). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-automl-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/automl.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/automl/v1" - -client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new -request = ::Google::Cloud::AutoML::V1::PredictRequest.new # (request fields as keyword arguments...) -response = client.predict request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-automl-v1/latest) -for class and method documentation. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/automl/v1" -require "logger" - -client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.2+. - -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-automl`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-automl-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-automl`. -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-automl-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. +This gem is obsolete because the related Google backend is turned down. +For more information, see https://cloud.google.com/terms/deprecation. diff --git a/google-cloud-automl-v1/Rakefile b/google-cloud-automl-v1/Rakefile index 9dd468f3830e..bbfd2ee3d1fb 100644 --- a/google-cloud-automl-v1/Rakefile +++ b/google-cloud-automl-v1/Rakefile @@ -14,155 +14,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - require "bundler/setup" require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-automl-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["AUTOML_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["AUTOML_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["AUTOML_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 AUTOML_TEST_PROJECT=test123 AUTOML_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/automl/v1/prediction_service/credentials" - ::Google::Cloud::AutoML::V1::PredictionService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["AUTOML_PROJECT"] = project - ENV["AUTOML_TEST_PROJECT"] = project - ENV["AUTOML_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-automl-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-automl-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-automl-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-automl-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-automl-v1" - header "google-cloud-automl-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-automl-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-automl-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-automl-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-automl-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/google-cloud-automl-v1/gapic_metadata.json b/google-cloud-automl-v1/gapic_metadata.json deleted file mode 100644 index e3b4d840f3ac..000000000000 --- a/google-cloud-automl-v1/gapic_metadata.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.automl.v1", - "libraryPackage": "::Google::Cloud::AutoML::V1", - "services": { - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::AutoML::V1::PredictionService::Client", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - }, - "BatchPredict": { - "methods": [ - "batch_predict" - ] - } - } - } - } - }, - "AutoMl": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::AutoML::V1::AutoML::Client", - "rpcs": { - "CreateDataset": { - "methods": [ - "create_dataset" - ] - }, - "GetDataset": { - "methods": [ - "get_dataset" - ] - }, - "ListDatasets": { - "methods": [ - "list_datasets" - ] - }, - "UpdateDataset": { - "methods": [ - "update_dataset" - ] - }, - "DeleteDataset": { - "methods": [ - "delete_dataset" - ] - }, - "ImportData": { - "methods": [ - "import_data" - ] - }, - "ExportData": { - "methods": [ - "export_data" - ] - }, - "GetAnnotationSpec": { - "methods": [ - "get_annotation_spec" - ] - }, - "CreateModel": { - "methods": [ - "create_model" - ] - }, - "GetModel": { - "methods": [ - "get_model" - ] - }, - "ListModels": { - "methods": [ - "list_models" - ] - }, - "DeleteModel": { - "methods": [ - "delete_model" - ] - }, - "UpdateModel": { - "methods": [ - "update_model" - ] - }, - "DeployModel": { - "methods": [ - "deploy_model" - ] - }, - "UndeployModel": { - "methods": [ - "undeploy_model" - ] - }, - "ExportModel": { - "methods": [ - "export_model" - ] - }, - "GetModelEvaluation": { - "methods": [ - "get_model_evaluation" - ] - }, - "ListModelEvaluations": { - "methods": [ - "list_model_evaluations" - ] - } - } - } - } - } - } -} diff --git a/google-cloud-automl-v1/google-cloud-automl-v1.gemspec b/google-cloud-automl-v1/google-cloud-automl-v1.gemspec index 8a51f46a39fe..b46edf3bb612 100644 --- a/google-cloud-automl-v1/google-cloud-automl-v1.gemspec +++ b/google-cloud-automl-v1/google-cloud-automl-v1.gemspec @@ -1,28 +1,27 @@ -# -*- ruby -*- -# encoding: utf-8 - require File.expand_path("lib/google/cloud/automl/v1/version", __dir__) Gem::Specification.new do |gem| - gem.name = "google-cloud-automl-v1" - gem.version = Google::Cloud::AutoML::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Train high-quality custom machine learning models with minimum effort and machine learning expertise. Note that google-cloud-automl-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-automl instead. See the readme for more details." - gem.summary = "Train high-quality custom machine learning models with minimum effort and machine learning expertise." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" + gem.name = "google-cloud-automl-v1" + gem.version = Google::Cloud::Automl::V1::VERSION + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = + "This gem is obsolete because the related Google backend is turned down. " \ + "For more information, see https://cloud.google.com/terms/deprecation." + gem.summary = "This gem is obsolete because the related backend is turned down." + gem.post_install_message = <<~MESSAGE - gem.platform = Gem::Platform::RUBY + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + The google-cloud-automl-v1 gem is OBSOLETE. + For more information, see: + https://cloud.google.com/terms/deprecation + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + MESSAGE + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + gem.platform = Gem::Platform::RUBY + gem.files = ["README.md", "LICENSE.md", ".yardopts", "lib/google/cloud/automl/v1/version.rb"] gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.3" - gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.required_ruby_version = ">= 3.0" end diff --git a/google-cloud-automl-v1/lib/google-cloud-automl-v1.rb b/google-cloud-automl-v1/lib/google-cloud-automl-v1.rb deleted file mode 100644 index 0639f3bfe935..000000000000 --- a/google-cloud-automl-v1/lib/google-cloud-automl-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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/automl/v1" diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1.rb deleted file mode 100644 index 70b770d6ce68..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/automl/v1/prediction_service" -require "google/cloud/automl/v1/automl" -require "google/cloud/automl/v1/version" - -module Google - module Cloud - module AutoML - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/automl/v1" - # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/automl/v1" - # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/automl/v1/_helpers" if ::File.file? helper_path diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/_helpers.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/_helpers.rb deleted file mode 100644 index 8c01d7bd3ef4..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/_helpers.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -module Google - module Cloud - module Automl - module V1 - VERSION = ::Google::Cloud::AutoML::V1::VERSION - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_payload_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_payload_pb.rb deleted file mode 100644 index 5429cd0a0e66..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_payload_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/annotation_payload.proto - -require 'google/protobuf' - -require 'google/cloud/automl/v1/classification_pb' -require 'google/cloud/automl/v1/detection_pb' -require 'google/cloud/automl/v1/text_extraction_pb' -require 'google/cloud/automl/v1/text_sentiment_pb' -require 'google/cloud/automl/v1/translation_pb' - - -descriptor_data = "\n/google/cloud/automl/v1/annotation_payload.proto\x12\x16google.cloud.automl.v1\x1a+google/cloud/automl/v1/classification.proto\x1a&google/cloud/automl/v1/detection.proto\x1a,google/cloud/automl/v1/text_extraction.proto\x1a+google/cloud/automl/v1/text_sentiment.proto\x1a(google/cloud/automl/v1/translation.proto\"\xd3\x03\n\x11\x41nnotationPayload\x12\x44\n\x0btranslation\x18\x02 \x01(\x0b\x32-.google.cloud.automl.v1.TranslationAnnotationH\x00\x12J\n\x0e\x63lassification\x18\x03 \x01(\x0b\x32\x30.google.cloud.automl.v1.ClassificationAnnotationH\x00\x12X\n\x16image_object_detection\x18\x04 \x01(\x0b\x32\x36.google.cloud.automl.v1.ImageObjectDetectionAnnotationH\x00\x12K\n\x0ftext_extraction\x18\x06 \x01(\x0b\x32\x30.google.cloud.automl.v1.TextExtractionAnnotationH\x00\x12I\n\x0etext_sentiment\x18\x07 \x01(\x0b\x32/.google.cloud.automl.v1.TextSentimentAnnotationH\x00\x12\x1a\n\x12\x61nnotation_spec_id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x08\n\x06\x64\x65tailB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - AnnotationPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.AnnotationPayload").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_spec_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_spec_pb.rb deleted file mode 100644 index 1570c5e4ceeb..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/annotation_spec_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/annotation_spec.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n,google/cloud/automl/v1/annotation_spec.proto\x12\x16google.cloud.automl.v1\x1a\x19google/api/resource.proto\"\xd6\x01\n\x0e\x41nnotationSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rexample_count\x18\t \x01(\x05:\x88\x01\xea\x41\x84\x01\n$automl.googleapis.com/AnnotationSpec\x12\\projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}B\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - AnnotationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.AnnotationSpec").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl.rb deleted file mode 100644 index 62e9c8a5a030..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/automl/v1/version" - -require "google/cloud/automl/v1/automl/credentials" -require "google/cloud/automl/v1/automl/paths" -require "google/cloud/automl/v1/automl/operations" -require "google/cloud/automl/v1/automl/client" -require "google/cloud/automl/v1/automl/rest" - -module Google - module Cloud - module AutoML - module V1 - ## - # AutoML Server API. - # - # The resource names are assigned by the server. - # The server never reuses names that it has created after the resources with - # those names are deleted. - # - # An ID of a resource is the last element of the item's resource name. For - # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - # the id for the item is `{dataset_id}`. - # - # Currently the only supported `location_id` is "us-central1". - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/automl/v1/automl" - # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/automl/v1/automl/rest" - # client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - module AutoML - end - end - end - end -end - -helper_path = ::File.join __dir__, "automl", "helpers.rb" -require "google/cloud/automl/v1/automl/helpers" if ::File.file? helper_path diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/client.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/client.rb deleted file mode 100644 index 7ecc77f69219..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/client.rb +++ /dev/null @@ -1,2351 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/automl/v1/service_pb" - -module Google - module Cloud - module AutoML - module V1 - module AutoML - ## - # Client for the AutoMl service. - # - # AutoML Server API. - # - # The resource names are assigned by the server. - # The server never reuses names that it has created after the resources with - # those names are deleted. - # - # An ID of a resource is the last element of the item's resource name. For - # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - # the id for the item is `{dataset_id}`. - # - # Currently the only supported `location_id` is "us-central1". - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :auto_ml_stub - - ## - # Configure the AutoMl Client class. - # - # See {::Google::Cloud::AutoML::V1::AutoML::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AutoMl clients - # ::Google::Cloud::AutoML::V1::AutoML::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", "AutoML", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_dataset.timeout = 5.0 - - default_config.rpcs.get_dataset.timeout = 5.0 - default_config.rpcs.get_dataset.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_datasets.timeout = 5.0 - default_config.rpcs.list_datasets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_dataset.timeout = 5.0 - - default_config.rpcs.delete_dataset.timeout = 5.0 - default_config.rpcs.delete_dataset.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.import_data.timeout = 5.0 - - default_config.rpcs.export_data.timeout = 5.0 - - default_config.rpcs.get_annotation_spec.timeout = 5.0 - default_config.rpcs.get_annotation_spec.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_model.timeout = 5.0 - - default_config.rpcs.get_model.timeout = 5.0 - default_config.rpcs.get_model.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_models.timeout = 5.0 - default_config.rpcs.list_models.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_model.timeout = 5.0 - default_config.rpcs.delete_model.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_model.timeout = 5.0 - - default_config.rpcs.deploy_model.timeout = 5.0 - - default_config.rpcs.undeploy_model.timeout = 5.0 - - default_config.rpcs.export_model.timeout = 5.0 - - default_config.rpcs.get_model_evaluation.timeout = 5.0 - default_config.rpcs.get_model_evaluation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_model_evaluations.timeout = 5.0 - default_config.rpcs.list_model_evaluations.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 AutoMl 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::AutoML::V1::AutoML::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @auto_ml_stub.universe_domain - end - - ## - # Create a new AutoMl client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AutoMl 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/automl/v1/service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @auto_ml_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::AutoML::V1::AutoMl::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @auto_ml_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AutoML::V1::AutoML::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @auto_ml_stub.logger - end - - # Service calls - - ## - # Creates a dataset. - # - # @overload create_dataset(request, options = nil) - # Pass arguments to `create_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::CreateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::CreateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(parent: nil, dataset: nil) - # Pass arguments to `create_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to create the dataset for. - # @param dataset [::Google::Cloud::AutoML::V1::Dataset, ::Hash] - # Required. The dataset to create. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::CreateDatasetRequest.new - # - # # Call the create_dataset method. - # result = client.create_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::CreateDatasetRequest - - # Converts hash 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a dataset. - # - # @overload get_dataset(request, options = nil) - # Pass arguments to `get_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_dataset(name: nil) - # Pass arguments to `get_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the dataset to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AutoML::V1::Dataset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AutoML::V1::Dataset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetDatasetRequest.new - # - # # Call the get_dataset method. - # result = client.get_dataset request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Dataset. - # p result - # - def get_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists datasets in a project. - # - # @overload list_datasets(request, options = nil) - # Pass arguments to `list_datasets` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ListDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ListDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_datasets` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list datasets. - # @param filter [::String] - # An expression for filtering the results of the request. - # - # * `dataset_metadata` - for existence of the case (e.g. - # `image_classification_dataset_metadata:*`). Some examples of using the filter are: - # - # * `translation_dataset_metadata:*` --> The dataset has - # `translation_dataset_metadata`. - # @param page_size [::Integer] - # Requested page size. Server may return fewer results than requested. - # If unspecified, server will pick a default size. - # @param page_token [::String] - # A token identifying a page of results for the server to return - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListDatasetsResponse#next_page_token ListDatasetsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Client#list_datasets AutoMl.ListDatasets} call. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new - # - # # Call the list_datasets method. - # result = client.list_datasets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AutoML::V1::Dataset. - # p item - # end - # - def list_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListDatasetsRequest - - # Converts hash 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_datasets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_datasets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a dataset. - # - # @overload update_dataset(request, options = nil) - # Pass arguments to `update_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::UpdateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::UpdateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_dataset(dataset: nil, update_mask: nil) - # Pass arguments to `update_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::Google::Cloud::AutoML::V1::Dataset, ::Hash] - # Required. The dataset which replaces the resource on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AutoML::V1::Dataset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AutoML::V1::Dataset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new - # - # # Call the update_dataset method. - # result = client.update_dataset request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Dataset. - # p result - # - def update_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UpdateDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.dataset&.name - header_params["dataset.name"] = request.dataset.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a dataset and all of its contents. - # Returns empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes, - # and `delete_details` in the - # {::Google::Longrunning::Operation#metadata metadata} field. - # - # @overload delete_dataset(request, options = nil) - # Pass arguments to `delete_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::DeleteDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::DeleteDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `delete_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the dataset to delete. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new - # - # # Call the delete_dataset method. - # result = client.delete_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeleteDatasetRequest - - # Converts hash 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports data into a dataset. - # For Tables this method can only be called on an empty Dataset. - # - # For Tables: - # * A - # {::Google::Cloud::AutoML::V1::InputConfig#params schema_inference_version} - # parameter must be explicitly set. - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload import_data(request, options = nil) - # Pass arguments to `import_data` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ImportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ImportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_data(name: nil, input_config: nil) - # Pass arguments to `import_data` via keyword arguments. Note that at - # least one keyword argument is 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. Dataset name. Dataset must already exist. All imported - # annotations and examples will be added. - # @param input_config [::Google::Cloud::AutoML::V1::InputConfig, ::Hash] - # Required. The desired input location and its domain specific semantics, - # if any. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ImportDataRequest.new - # - # # Call the import_data method. - # result = client.import_data request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ImportDataRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_data.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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.import_data.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports dataset's data to the provided output location. - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload export_data(request, options = nil) - # Pass arguments to `export_data` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ExportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ExportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_data(name: nil, output_config: nil) - # Pass arguments to `export_data` via keyword arguments. Note that at - # least one keyword argument is 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 dataset. - # @param output_config [::Google::Cloud::AutoML::V1::OutputConfig, ::Hash] - # Required. The desired output location. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ExportDataRequest.new - # - # # Call the export_data method. - # result = client.export_data request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ExportDataRequest - - # Converts hash 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.export_data.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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.export_data.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an annotation spec. - # - # @overload get_annotation_spec(request, options = nil) - # Pass arguments to `get_annotation_spec` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation_spec(name: nil) - # Pass arguments to `get_annotation_spec` via keyword arguments. Note that at - # least one keyword argument is 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 annotation spec to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AutoML::V1::AnnotationSpec] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AutoML::V1::AnnotationSpec] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new - # - # # Call the get_annotation_spec method. - # result = client.get_annotation_spec request - # - # # The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec. - # p result - # - def get_annotation_spec request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest - - # Converts hash 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_annotation_spec.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_annotation_spec.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_annotation_spec.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a model. - # Returns a Model in the {::Google::Longrunning::Operation#response response} - # field when it completes. - # When you create a model, several model evaluations are created for it: - # a global evaluation, and one evaluation for each annotation spec. - # - # @overload create_model(request, options = nil) - # Pass arguments to `create_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::CreateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::CreateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil) - # Pass arguments to `create_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent project where the model is being created. - # @param model [::Google::Cloud::AutoML::V1::Model, ::Hash] - # Required. The model to create. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::CreateModelRequest.new - # - # # Call the create_model method. - # result = client.create_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::CreateModelRequest - - # Converts hash 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_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a model. - # - # @overload get_model(request, options = nil) - # Pass arguments to `get_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the model. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AutoML::V1::Model] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AutoML::V1::Model] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetModelRequest.new - # - # # Call the get_model method. - # result = client.get_model request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Model. - # p result - # - def get_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetModelRequest - - # Converts hash 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_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists models. - # - # @overload list_models(request, options = nil) - # Pass arguments to `list_models` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ListModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ListModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_models(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_models` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project, from which to list the models. - # @param filter [::String] - # An expression for filtering the results of the request. - # - # * `model_metadata` - for existence of the case (e.g. - # `video_classification_model_metadata:*`). - # * `dataset_id` - for = or !=. Some examples of using the filter are: - # - # * `image_classification_model_metadata:*` --> The model has - # `image_classification_model_metadata`. - # * `dataset_id=5` --> The model was created from a dataset with ID 5. - # @param page_size [::Integer] - # Requested page size. - # @param page_token [::String] - # A token identifying a page of results for the server to return - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Client#list_models AutoMl.ListModels} call. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1::Model>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1::Model>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ListModelsRequest.new - # - # # Call the list_models method. - # result = client.list_models request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AutoML::V1::Model. - # p item - # end - # - def list_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListModelsRequest - - # Converts hash 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_models.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_models.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a model. - # Returns `google.protobuf.Empty` in the - # {::Google::Longrunning::Operation#response response} field when it completes, - # and `delete_details` in the - # {::Google::Longrunning::Operation#metadata metadata} field. - # - # @overload delete_model(request, options = nil) - # Pass arguments to `delete_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::DeleteModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::DeleteModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the model being 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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::DeleteModelRequest.new - # - # # Call the delete_model method. - # result = client.delete_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeleteModelRequest - - # Converts hash 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_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a model. - # - # @overload update_model(request, options = nil) - # Pass arguments to `update_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::UpdateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::UpdateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_model(model: nil, update_mask: nil) - # Pass arguments to `update_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param model [::Google::Cloud::AutoML::V1::Model, ::Hash] - # Required. The model which replaces the resource on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AutoML::V1::Model] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AutoML::V1::Model] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::UpdateModelRequest.new - # - # # Call the update_model method. - # result = client.update_model request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Model. - # p result - # - def update_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UpdateModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.model&.name - header_params["model.name"] = request.model.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :update_model, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deploys a model. If a model is already deployed, deploying it with the - # same parameters has no effect. Deploying with different parametrs - # (as e.g. changing - # [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) - # will reset the deployment state without pausing the model's availability. - # - # Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage - # deployment automatically. - # - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload deploy_model(request, options = nil) - # Pass arguments to `deploy_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::DeployModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::DeployModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil) - # Pass arguments to `deploy_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param image_object_detection_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageObjectDetectionModelDeploymentMetadata, ::Hash] - # Model deployment metadata specific to Image Object Detection. - # - # Note: The following parameters are mutually exclusive: `image_object_detection_model_deployment_metadata`, `image_classification_model_deployment_metadata`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param image_classification_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageClassificationModelDeploymentMetadata, ::Hash] - # Model deployment metadata specific to Image Classification. - # - # Note: The following parameters are mutually exclusive: `image_classification_model_deployment_metadata`, `image_object_detection_model_deployment_metadata`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param name [::String] - # Required. Resource name of the model to deploy. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::DeployModelRequest.new - # - # # Call the deploy_model method. - # result = client.deploy_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def deploy_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeployModelRequest - - # Converts hash 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_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deploy_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeploys a model. If the model is not deployed this method has no effect. - # - # Only applicable for Text Classification, Image Object Detection and Tables; - # all other domains manage deployment automatically. - # - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload undeploy_model(request, options = nil) - # Pass arguments to `undeploy_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::UndeployModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::UndeployModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `undeploy_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the model to undeploy. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::UndeployModelRequest.new - # - # # Call the undeploy_model method. - # result = client.undeploy_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undeploy_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UndeployModelRequest - - # Converts hash 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_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undeploy_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a trained, "export-able", model to a user specified Google Cloud - # Storage location. A model is considered export-able if and only if it has - # an export format defined for it in - # {::Google::Cloud::AutoML::V1::ModelExportOutputConfig ModelExportOutputConfig}. - # - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload export_model(request, options = nil) - # Pass arguments to `export_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ExportModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ExportModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_model(name: nil, output_config: nil) - # Pass arguments to `export_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to export. - # @param output_config [::Google::Cloud::AutoML::V1::ModelExportOutputConfig, ::Hash] - # Required. The desired output location and configuration. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ExportModelRequest.new - # - # # Call the export_model method. - # result = client.export_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ExportModelRequest - - # Converts hash 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.export_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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.export_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a model evaluation. - # - # @overload get_model_evaluation(request, options = nil) - # Pass arguments to `get_model_evaluation` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetModelEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetModelEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluation(name: nil) - # Pass arguments to `get_model_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. Resource name for the model evaluation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AutoML::V1::ModelEvaluation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AutoML::V1::ModelEvaluation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new - # - # # Call the get_model_evaluation method. - # result = client.get_model_evaluation request - # - # # The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation. - # p result - # - def get_model_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetModelEvaluationRequest - - # Converts hash 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_model_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_model_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_model_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists model evaluations. - # - # @overload list_model_evaluations(request, options = nil) - # Pass arguments to `list_model_evaluations` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_model_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. Resource name of the model to list the model evaluations for. - # If modelId is set as "-", this will list model evaluations from across all - # models of the parent location. - # @param filter [::String] - # Required. An expression for filtering the results of the request. - # - # * `annotation_spec_id` - for =, != or existence. See example below for - # the last. - # - # Some examples of using the filter are: - # - # * `annotation_spec_id!=4` --> The model evaluation was done for - # annotation spec with ID different than 4. - # * `NOT annotation_spec_id:*` --> The model evaluation was done for - # aggregate of all annotation specs. - # @param page_size [::Integer] - # Requested page size. - # @param page_token [::String] - # A token identifying a page of results for the server to return. - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations AutoMl.ListModelEvaluations} call. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new - # - # # Call the list_model_evaluations method. - # result = client.list_model_evaluations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation. - # p item - # end - # - def list_model_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest - - # Converts hash 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_model_evaluations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_model_evaluations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_model_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AutoMl API. - # - # This class represents the configuration for AutoMl, - # 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::AutoML::V1::AutoML::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 - # # create_dataset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AutoML::V1::AutoML::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_dataset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_dataset.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the AutoMl 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dataset - ## - # RPC-specific configuration for `get_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset - ## - # RPC-specific configuration for `list_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_datasets - ## - # RPC-specific configuration for `update_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset - ## - # RPC-specific configuration for `delete_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dataset - ## - # RPC-specific configuration for `import_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_data - ## - # RPC-specific configuration for `export_data` - # @return [::Gapic::Config::Method] - # - attr_reader :export_data - ## - # RPC-specific configuration for `get_annotation_spec` - # @return [::Gapic::Config::Method] - # - attr_reader :get_annotation_spec - ## - # RPC-specific configuration for `create_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_model - ## - # RPC-specific configuration for `get_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model - ## - # RPC-specific configuration for `list_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_models - ## - # RPC-specific configuration for `delete_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_model - ## - # RPC-specific configuration for `update_model` - # @return [::Gapic::Config::Method] - # - attr_reader :update_model - ## - # RPC-specific configuration for `deploy_model` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_model - ## - # RPC-specific configuration for `undeploy_model` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_model - ## - # RPC-specific configuration for `export_model` - # @return [::Gapic::Config::Method] - # - attr_reader :export_model - ## - # RPC-specific configuration for `get_model_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model_evaluation - ## - # RPC-specific configuration for `list_model_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_model_evaluations - - # @private - def initialize parent_rpcs = nil - create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset - @create_dataset = ::Gapic::Config::Method.new create_dataset_config - get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset - @get_dataset = ::Gapic::Config::Method.new get_dataset_config - list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets - @list_datasets = ::Gapic::Config::Method.new list_datasets_config - update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset - @update_dataset = ::Gapic::Config::Method.new update_dataset_config - delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset - @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config - import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data - @import_data = ::Gapic::Config::Method.new import_data_config - export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data - @export_data = ::Gapic::Config::Method.new export_data_config - get_annotation_spec_config = parent_rpcs.get_annotation_spec if parent_rpcs.respond_to? :get_annotation_spec - @get_annotation_spec = ::Gapic::Config::Method.new get_annotation_spec_config - create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model - @create_model = ::Gapic::Config::Method.new create_model_config - get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model - @get_model = ::Gapic::Config::Method.new get_model_config - list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models - @list_models = ::Gapic::Config::Method.new list_models_config - delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model - @delete_model = ::Gapic::Config::Method.new delete_model_config - update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model - @update_model = ::Gapic::Config::Method.new update_model_config - deploy_model_config = parent_rpcs.deploy_model if parent_rpcs.respond_to? :deploy_model - @deploy_model = ::Gapic::Config::Method.new deploy_model_config - undeploy_model_config = parent_rpcs.undeploy_model if parent_rpcs.respond_to? :undeploy_model - @undeploy_model = ::Gapic::Config::Method.new undeploy_model_config - export_model_config = parent_rpcs.export_model if parent_rpcs.respond_to? :export_model - @export_model = ::Gapic::Config::Method.new export_model_config - get_model_evaluation_config = parent_rpcs.get_model_evaluation if parent_rpcs.respond_to? :get_model_evaluation - @get_model_evaluation = ::Gapic::Config::Method.new get_model_evaluation_config - list_model_evaluations_config = parent_rpcs.list_model_evaluations if parent_rpcs.respond_to? :list_model_evaluations - @list_model_evaluations = ::Gapic::Config::Method.new list_model_evaluations_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/credentials.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/credentials.rb deleted file mode 100644 index bafb75c5f4ab..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module AutoML - module V1 - module AutoML - # Credentials for the AutoMl API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "AUTOML_CREDENTIALS", - "AUTOML_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "AUTOML_CREDENTIALS_JSON", - "AUTOML_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/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/operations.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/operations.rb deleted file mode 100644 index ec9bb5dce369..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/operations.rb +++ /dev/null @@ -1,851 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module AutoML - module V1 - module AutoML - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AutoMl 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 AutoMl Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - throw :response, 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, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - 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, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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.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? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/paths.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/paths.rb deleted file mode 100644 index 7cfa7f1b018d..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/paths.rb +++ /dev/null @@ -1,130 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - module AutoML - # Path helper methods for the AutoMl API. - module Paths - ## - # Create a fully-qualified AnnotationSpec resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` - # - # @param project [String] - # @param location [String] - # @param dataset [String] - # @param annotation_spec [String] - # - # @return [::String] - def annotation_spec_path project:, location:, dataset:, annotation_spec: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" - - "projects/#{project}/locations/#{location}/datasets/#{dataset}/annotationSpecs/#{annotation_spec}" - end - - ## - # Create a fully-qualified Dataset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/datasets/{dataset}` - # - # @param project [String] - # @param location [String] - # @param dataset [String] - # - # @return [::String] - def dataset_path project:, location:, dataset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/datasets/#{dataset}" - 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 Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}" - end - - ## - # Create a fully-qualified ModelEvaluation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # @param model_evaluation [String] - # - # @return [::String] - def model_evaluation_path project:, location:, model:, model_evaluation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "model cannot contain /" if model.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}/modelEvaluations/#{model_evaluation}" - end - - extend self - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest.rb deleted file mode 100644 index fe9133837455..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/automl/v1/version" - -require "google/cloud/automl/v1/automl/credentials" -require "google/cloud/automl/v1/automl/paths" -require "google/cloud/automl/v1/automl/rest/operations" -require "google/cloud/automl/v1/automl/rest/client" - -module Google - module Cloud - module AutoML - module V1 - ## - # AutoML Server API. - # - # The resource names are assigned by the server. - # The server never reuses names that it has created after the resources with - # those names are deleted. - # - # An ID of a resource is the last element of the item's resource name. For - # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - # the id for the item is `{dataset_id}`. - # - # Currently the only supported `location_id` is "us-central1". - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/automl/v1/automl/rest" - # client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - module AutoML - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/automl/v1/automl/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/client.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/client.rb deleted file mode 100644 index 7198b59b74d4..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/client.rb +++ /dev/null @@ -1,2182 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/automl/v1/service_pb" -require "google/cloud/automl/v1/automl/rest/service_stub" - -module Google - module Cloud - module AutoML - module V1 - module AutoML - module Rest - ## - # REST client for the AutoMl service. - # - # AutoML Server API. - # - # The resource names are assigned by the server. - # The server never reuses names that it has created after the resources with - # those names are deleted. - # - # An ID of a resource is the last element of the item's resource name. For - # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - # the id for the item is `{dataset_id}`. - # - # Currently the only supported `location_id` is "us-central1". - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :auto_ml_stub - - ## - # Configure the AutoMl Client class. - # - # See {::Google::Cloud::AutoML::V1::AutoML::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AutoMl clients - # ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "AutoML", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_dataset.timeout = 5.0 - - default_config.rpcs.get_dataset.timeout = 5.0 - default_config.rpcs.get_dataset.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_datasets.timeout = 5.0 - default_config.rpcs.list_datasets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_dataset.timeout = 5.0 - - default_config.rpcs.delete_dataset.timeout = 5.0 - default_config.rpcs.delete_dataset.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.import_data.timeout = 5.0 - - default_config.rpcs.export_data.timeout = 5.0 - - default_config.rpcs.get_annotation_spec.timeout = 5.0 - default_config.rpcs.get_annotation_spec.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_model.timeout = 5.0 - - default_config.rpcs.get_model.timeout = 5.0 - default_config.rpcs.get_model.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_models.timeout = 5.0 - default_config.rpcs.list_models.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_model.timeout = 5.0 - default_config.rpcs.delete_model.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_model.timeout = 5.0 - - default_config.rpcs.deploy_model.timeout = 5.0 - - default_config.rpcs.undeploy_model.timeout = 5.0 - - default_config.rpcs.export_model.timeout = 5.0 - - default_config.rpcs.get_model_evaluation.timeout = 5.0 - default_config.rpcs.get_model_evaluation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_model_evaluations.timeout = 5.0 - default_config.rpcs.list_model_evaluations.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 AutoMl 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::AutoML::V1::AutoML::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @auto_ml_stub.universe_domain - end - - ## - # Create a new AutoMl REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AutoMl client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @auto_ml_stub = ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @auto_ml_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AutoML::V1::AutoML::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @auto_ml_stub.logger - end - - # Service calls - - ## - # Creates a dataset. - # - # @overload create_dataset(request, options = nil) - # Pass arguments to `create_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::CreateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::CreateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(parent: nil, dataset: nil) - # Pass arguments to `create_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to create the dataset for. - # @param dataset [::Google::Cloud::AutoML::V1::Dataset, ::Hash] - # Required. The dataset to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::CreateDatasetRequest.new - # - # # Call the create_dataset method. - # result = client.create_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::CreateDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.create_dataset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a dataset. - # - # @overload get_dataset(request, options = nil) - # Pass arguments to `get_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_dataset(name: nil) - # Pass arguments to `get_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the dataset to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Dataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Dataset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetDatasetRequest.new - # - # # Call the get_dataset method. - # result = client.get_dataset request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Dataset. - # p result - # - def get_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.get_dataset request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists datasets in a project. - # - # @overload list_datasets(request, options = nil) - # Pass arguments to `list_datasets` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ListDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ListDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_datasets` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list datasets. - # @param filter [::String] - # An expression for filtering the results of the request. - # - # * `dataset_metadata` - for existence of the case (e.g. - # `image_classification_dataset_metadata:*`). Some examples of using the filter are: - # - # * `translation_dataset_metadata:*` --> The dataset has - # `translation_dataset_metadata`. - # @param page_size [::Integer] - # Requested page size. Server may return fewer results than requested. - # If unspecified, server will pick a default size. - # @param page_token [::String] - # A token identifying a page of results for the server to return - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListDatasetsResponse#next_page_token ListDatasetsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Rest::Client#list_datasets AutoMl.ListDatasets} call. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new - # - # # Call the list_datasets method. - # result = client.list_datasets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AutoML::V1::Dataset. - # p item - # end - # - def list_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListDatasetsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_datasets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_datasets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.list_datasets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_datasets, "datasets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a dataset. - # - # @overload update_dataset(request, options = nil) - # Pass arguments to `update_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::UpdateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::UpdateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_dataset(dataset: nil, update_mask: nil) - # Pass arguments to `update_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::Google::Cloud::AutoML::V1::Dataset, ::Hash] - # Required. The dataset which replaces the resource on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Dataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Dataset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new - # - # # Call the update_dataset method. - # result = client.update_dataset request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Dataset. - # p result - # - def update_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UpdateDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.update_dataset request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a dataset and all of its contents. - # Returns empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes, - # and `delete_details` in the - # {::Google::Longrunning::Operation#metadata metadata} field. - # - # @overload delete_dataset(request, options = nil) - # Pass arguments to `delete_dataset` via a request object, either of type - # {::Google::Cloud::AutoML::V1::DeleteDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::DeleteDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `delete_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the dataset to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new - # - # # Call the delete_dataset method. - # result = client.delete_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeleteDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.delete_dataset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports data into a dataset. - # For Tables this method can only be called on an empty Dataset. - # - # For Tables: - # * A - # {::Google::Cloud::AutoML::V1::InputConfig#params schema_inference_version} - # parameter must be explicitly set. - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload import_data(request, options = nil) - # Pass arguments to `import_data` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ImportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ImportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_data(name: nil, input_config: nil) - # Pass arguments to `import_data` via keyword arguments. Note that at - # least one keyword argument is 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. Dataset name. Dataset must already exist. All imported - # annotations and examples will be added. - # @param input_config [::Google::Cloud::AutoML::V1::InputConfig, ::Hash] - # Required. The desired input location and its domain specific semantics, - # if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ImportDataRequest.new - # - # # Call the import_data method. - # result = client.import_data request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ImportDataRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_data.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_data.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.import_data request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports dataset's data to the provided output location. - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload export_data(request, options = nil) - # Pass arguments to `export_data` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ExportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ExportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_data(name: nil, output_config: nil) - # Pass arguments to `export_data` via keyword arguments. Note that at - # least one keyword argument is 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 dataset. - # @param output_config [::Google::Cloud::AutoML::V1::OutputConfig, ::Hash] - # Required. The desired output location. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ExportDataRequest.new - # - # # Call the export_data method. - # result = client.export_data request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ExportDataRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.export_data.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_data.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.export_data request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an annotation spec. - # - # @overload get_annotation_spec(request, options = nil) - # Pass arguments to `get_annotation_spec` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation_spec(name: nil) - # Pass arguments to `get_annotation_spec` via keyword arguments. Note that at - # least one keyword argument is 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 annotation spec to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::AnnotationSpec] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::AnnotationSpec] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new - # - # # Call the get_annotation_spec method. - # result = client.get_annotation_spec request - # - # # The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec. - # p result - # - def get_annotation_spec request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_annotation_spec.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_annotation_spec.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_annotation_spec.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.get_annotation_spec request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a model. - # Returns a Model in the {::Google::Longrunning::Operation#response response} - # field when it completes. - # When you create a model, several model evaluations are created for it: - # a global evaluation, and one evaluation for each annotation spec. - # - # @overload create_model(request, options = nil) - # Pass arguments to `create_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::CreateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::CreateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil) - # Pass arguments to `create_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent project where the model is being created. - # @param model [::Google::Cloud::AutoML::V1::Model, ::Hash] - # Required. The model to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::CreateModelRequest.new - # - # # Call the create_model method. - # result = client.create_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::CreateModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.create_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a model. - # - # @overload get_model(request, options = nil) - # Pass arguments to `get_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the model. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Model] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetModelRequest.new - # - # # Call the get_model method. - # result = client.get_model request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Model. - # p result - # - def get_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.get_model request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists models. - # - # @overload list_models(request, options = nil) - # Pass arguments to `list_models` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ListModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ListModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_models(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_models` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project, from which to list the models. - # @param filter [::String] - # An expression for filtering the results of the request. - # - # * `model_metadata` - for existence of the case (e.g. - # `video_classification_model_metadata:*`). - # * `dataset_id` - for = or !=. Some examples of using the filter are: - # - # * `image_classification_model_metadata:*` --> The model has - # `image_classification_model_metadata`. - # * `dataset_id=5` --> The model was created from a dataset with ID 5. - # @param page_size [::Integer] - # Requested page size. - # @param page_token [::String] - # A token identifying a page of results for the server to return - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Rest::Client#list_models AutoMl.ListModels} call. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Model>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Model>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ListModelsRequest.new - # - # # Call the list_models method. - # result = client.list_models request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AutoML::V1::Model. - # p item - # end - # - def list_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListModelsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_models.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_models.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.list_models request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_models, "model", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a model. - # Returns `google.protobuf.Empty` in the - # {::Google::Longrunning::Operation#response response} field when it completes, - # and `delete_details` in the - # {::Google::Longrunning::Operation#metadata metadata} field. - # - # @overload delete_model(request, options = nil) - # Pass arguments to `delete_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::DeleteModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::DeleteModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the model being deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::DeleteModelRequest.new - # - # # Call the delete_model method. - # result = client.delete_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeleteModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.delete_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a model. - # - # @overload update_model(request, options = nil) - # Pass arguments to `update_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::UpdateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::UpdateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_model(model: nil, update_mask: nil) - # Pass arguments to `update_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param model [::Google::Cloud::AutoML::V1::Model, ::Hash] - # Required. The model which replaces the resource on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Model] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::UpdateModelRequest.new - # - # # Call the update_model method. - # result = client.update_model request - # - # # The returned object is of type Google::Cloud::AutoML::V1::Model. - # p result - # - def update_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UpdateModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.update_model request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deploys a model. If a model is already deployed, deploying it with the - # same parameters has no effect. Deploying with different parametrs - # (as e.g. changing - # [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) - # will reset the deployment state without pausing the model's availability. - # - # Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage - # deployment automatically. - # - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload deploy_model(request, options = nil) - # Pass arguments to `deploy_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::DeployModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::DeployModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil) - # Pass arguments to `deploy_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param image_object_detection_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageObjectDetectionModelDeploymentMetadata, ::Hash] - # Model deployment metadata specific to Image Object Detection. - # - # Note: The following parameters are mutually exclusive: `image_object_detection_model_deployment_metadata`, `image_classification_model_deployment_metadata`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param image_classification_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageClassificationModelDeploymentMetadata, ::Hash] - # Model deployment metadata specific to Image Classification. - # - # Note: The following parameters are mutually exclusive: `image_classification_model_deployment_metadata`, `image_object_detection_model_deployment_metadata`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param name [::String] - # Required. Resource name of the model to deploy. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::DeployModelRequest.new - # - # # Call the deploy_model method. - # result = client.deploy_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def deploy_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeployModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.deploy_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.deploy_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.deploy_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.deploy_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeploys a model. If the model is not deployed this method has no effect. - # - # Only applicable for Text Classification, Image Object Detection and Tables; - # all other domains manage deployment automatically. - # - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload undeploy_model(request, options = nil) - # Pass arguments to `undeploy_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::UndeployModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::UndeployModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `undeploy_model` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the model to undeploy. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::UndeployModelRequest.new - # - # # Call the undeploy_model method. - # result = client.undeploy_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undeploy_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UndeployModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.undeploy_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undeploy_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undeploy_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.undeploy_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a trained, "export-able", model to a user specified Google Cloud - # Storage location. A model is considered export-able if and only if it has - # an export format defined for it in - # {::Google::Cloud::AutoML::V1::ModelExportOutputConfig ModelExportOutputConfig}. - # - # Returns an empty response in the - # {::Google::Longrunning::Operation#response response} field when it completes. - # - # @overload export_model(request, options = nil) - # Pass arguments to `export_model` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ExportModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ExportModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_model(name: nil, output_config: nil) - # Pass arguments to `export_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to export. - # @param output_config [::Google::Cloud::AutoML::V1::ModelExportOutputConfig, ::Hash] - # Required. The desired output location and configuration. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ExportModelRequest.new - # - # # Call the export_model method. - # result = client.export_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ExportModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.export_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.export_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a model evaluation. - # - # @overload get_model_evaluation(request, options = nil) - # Pass arguments to `get_model_evaluation` via a request object, either of type - # {::Google::Cloud::AutoML::V1::GetModelEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::GetModelEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluation(name: nil) - # Pass arguments to `get_model_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. Resource name for the model evaluation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::ModelEvaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::ModelEvaluation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new - # - # # Call the get_model_evaluation method. - # result = client.get_model_evaluation request - # - # # The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation. - # p result - # - def get_model_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetModelEvaluationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_model_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_model_evaluation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_model_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.get_model_evaluation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists model evaluations. - # - # @overload list_model_evaluations(request, options = nil) - # Pass arguments to `list_model_evaluations` via a request object, either of type - # {::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_model_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. Resource name of the model to list the model evaluations for. - # If modelId is set as "-", this will list model evaluations from across all - # models of the parent location. - # @param filter [::String] - # Required. An expression for filtering the results of the request. - # - # * `annotation_spec_id` - for =, != or existence. See example below for - # the last. - # - # Some examples of using the filter are: - # - # * `annotation_spec_id!=4` --> The model evaluation was done for - # annotation spec with ID different than 4. - # * `NOT annotation_spec_id:*` --> The model evaluation was done for - # aggregate of all annotation specs. - # @param page_size [::Integer] - # Requested page size. - # @param page_token [::String] - # A token identifying a page of results for the server to return. - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Rest::Client#list_model_evaluations AutoMl.ListModelEvaluations} call. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new - # - # # Call the list_model_evaluations method. - # result = client.list_model_evaluations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation. - # p item - # end - # - def list_model_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_model_evaluations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_model_evaluations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_model_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @auto_ml_stub.list_model_evaluations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, "model_evaluation", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AutoMl REST API. - # - # This class represents the configuration for AutoMl REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::AutoML::V1::AutoML::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_dataset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_dataset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_dataset.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @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 AutoMl API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dataset - ## - # RPC-specific configuration for `get_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset - ## - # RPC-specific configuration for `list_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_datasets - ## - # RPC-specific configuration for `update_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset - ## - # RPC-specific configuration for `delete_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dataset - ## - # RPC-specific configuration for `import_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_data - ## - # RPC-specific configuration for `export_data` - # @return [::Gapic::Config::Method] - # - attr_reader :export_data - ## - # RPC-specific configuration for `get_annotation_spec` - # @return [::Gapic::Config::Method] - # - attr_reader :get_annotation_spec - ## - # RPC-specific configuration for `create_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_model - ## - # RPC-specific configuration for `get_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model - ## - # RPC-specific configuration for `list_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_models - ## - # RPC-specific configuration for `delete_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_model - ## - # RPC-specific configuration for `update_model` - # @return [::Gapic::Config::Method] - # - attr_reader :update_model - ## - # RPC-specific configuration for `deploy_model` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_model - ## - # RPC-specific configuration for `undeploy_model` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_model - ## - # RPC-specific configuration for `export_model` - # @return [::Gapic::Config::Method] - # - attr_reader :export_model - ## - # RPC-specific configuration for `get_model_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model_evaluation - ## - # RPC-specific configuration for `list_model_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_model_evaluations - - # @private - def initialize parent_rpcs = nil - create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset - @create_dataset = ::Gapic::Config::Method.new create_dataset_config - get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset - @get_dataset = ::Gapic::Config::Method.new get_dataset_config - list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets - @list_datasets = ::Gapic::Config::Method.new list_datasets_config - update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset - @update_dataset = ::Gapic::Config::Method.new update_dataset_config - delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset - @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config - import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data - @import_data = ::Gapic::Config::Method.new import_data_config - export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data - @export_data = ::Gapic::Config::Method.new export_data_config - get_annotation_spec_config = parent_rpcs.get_annotation_spec if parent_rpcs.respond_to? :get_annotation_spec - @get_annotation_spec = ::Gapic::Config::Method.new get_annotation_spec_config - create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model - @create_model = ::Gapic::Config::Method.new create_model_config - get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model - @get_model = ::Gapic::Config::Method.new get_model_config - list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models - @list_models = ::Gapic::Config::Method.new list_models_config - delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model - @delete_model = ::Gapic::Config::Method.new delete_model_config - update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model - @update_model = ::Gapic::Config::Method.new update_model_config - deploy_model_config = parent_rpcs.deploy_model if parent_rpcs.respond_to? :deploy_model - @deploy_model = ::Gapic::Config::Method.new deploy_model_config - undeploy_model_config = parent_rpcs.undeploy_model if parent_rpcs.respond_to? :undeploy_model - @undeploy_model = ::Gapic::Config::Method.new undeploy_model_config - export_model_config = parent_rpcs.export_model if parent_rpcs.respond_to? :export_model - @export_model = ::Gapic::Config::Method.new export_model_config - get_model_evaluation_config = parent_rpcs.get_model_evaluation if parent_rpcs.respond_to? :get_model_evaluation - @get_model_evaluation = ::Gapic::Config::Method.new get_model_evaluation_config - list_model_evaluations_config = parent_rpcs.list_model_evaluations if parent_rpcs.respond_to? :list_model_evaluations - @list_model_evaluations = ::Gapic::Config::Method.new list_model_evaluations_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/operations.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/operations.rb deleted file mode 100644 index bbabcd436e9d..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/operations.rb +++ /dev/null @@ -1,1095 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module AutoML - module V1 - module AutoML - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AutoMl 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 AutoMl Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => 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 [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: call_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.wait_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the wait_operation REST call - # - # @param request_pb [::Google::Longrunning::WaitOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def wait_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "wait_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the wait_operation REST call - # - # @param request_pb [::Google::Longrunning::WaitOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_wait_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:wait", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb deleted file mode 100644 index 55b031b23a36..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb +++ /dev/null @@ -1,1188 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/automl/v1/service_pb" - -module Google - module Cloud - module AutoML - module V1 - module AutoML - module Rest - ## - # REST service stub for the AutoMl service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::CreateDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Dataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Dataset] - # A result object deserialized from the server's reply - def get_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::Dataset.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_datasets REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ListDatasetsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::ListDatasetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::ListDatasetsResponse] - # A result object deserialized from the server's reply - def list_datasets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_datasets_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_datasets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::ListDatasetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::UpdateDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Dataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Dataset] - # A result object deserialized from the server's reply - def update_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::Dataset.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::DeleteDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_data REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ImportDataRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_data request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_data_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_data", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the export_data REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ExportDataRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def export_data request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_data_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "export_data", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_annotation_spec REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::AnnotationSpec] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::AnnotationSpec] - # A result object deserialized from the server's reply - def get_annotation_spec request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_annotation_spec_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_annotation_spec", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::AnnotationSpec.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::CreateModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Model] - # A result object deserialized from the server's reply - def get_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::Model.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_models REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ListModelsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::ListModelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::ListModelsResponse] - # A result object deserialized from the server's reply - def list_models request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_models_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_models", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::ListModelsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::DeleteModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::UpdateModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::Model] - # A result object deserialized from the server's reply - def update_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::Model.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the deploy_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::DeployModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def deploy_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_deploy_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "deploy_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the undeploy_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::UndeployModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def undeploy_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "undeploy_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the export_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ExportModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def export_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "export_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_model_evaluation REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetModelEvaluationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::ModelEvaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::ModelEvaluation] - # A result object deserialized from the server's reply - def get_model_evaluation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_model_evaluation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_model_evaluation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::ModelEvaluation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_model_evaluations REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse] - # A result object deserialized from the server's reply - def list_model_evaluations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_model_evaluations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_model_evaluations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::CreateDatasetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/datasets", - body: "dataset", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetDatasetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_datasets REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ListDatasetsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_datasets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/datasets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::UpdateDatasetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{dataset.name}", - body: "dataset", - matches: [ - ["dataset.name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_dataset REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::DeleteDatasetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_data REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ImportDataRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_data_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:importData", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_data REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ExportDataRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_data_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:exportData", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_annotation_spec REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_annotation_spec_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::CreateModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/models", - body: "model", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_models REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ListModelsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_models_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/models", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::DeleteModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::UpdateModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{model.name}", - body: "model", - matches: [ - ["model.name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the deploy_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::DeployModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_deploy_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:deploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undeploy_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::UndeployModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undeploy_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:undeploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_model REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ExportModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_model_evaluation REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::GetModelEvaluationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_model_evaluation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/modelEvaluations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_model_evaluations REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_model_evaluations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/modelEvaluations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/classification_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/classification_pb.rb deleted file mode 100644 index 333190be5c39..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/classification_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/classification.proto - -require 'google/protobuf' - - -descriptor_data = "\n+google/cloud/automl/v1/classification.proto\x12\x16google.cloud.automl.v1\")\n\x18\x43lassificationAnnotation\x12\r\n\x05score\x18\x01 \x01(\x02\"\x81\x07\n\x1f\x43lassificationEvaluationMetrics\x12\x0e\n\x06\x61u_prc\x18\x01 \x01(\x02\x12\x0e\n\x06\x61u_roc\x18\x06 \x01(\x02\x12\x10\n\x08log_loss\x18\x07 \x01(\x02\x12p\n\x18\x63onfidence_metrics_entry\x18\x03 \x03(\x0b\x32N.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry\x12\x61\n\x10\x63onfusion_matrix\x18\x04 \x01(\x0b\x32G.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix\x12\x1a\n\x12\x61nnotation_spec_id\x18\x05 \x03(\t\x1a\xfc\x02\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x1a\n\x12position_threshold\x18\x0e \x01(\x05\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x11\n\tprecision\x18\x03 \x01(\x02\x12\x1b\n\x13\x66\x61lse_positive_rate\x18\x08 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x04 \x01(\x02\x12\x12\n\nrecall_at1\x18\x05 \x01(\x02\x12\x15\n\rprecision_at1\x18\x06 \x01(\x02\x12\x1f\n\x17\x66\x61lse_positive_rate_at1\x18\t \x01(\x02\x12\x14\n\x0c\x66\x31_score_at1\x18\x07 \x01(\x02\x12\x1b\n\x13true_positive_count\x18\n \x01(\x03\x12\x1c\n\x14\x66\x61lse_positive_count\x18\x0b \x01(\x03\x12\x1c\n\x14\x66\x61lse_negative_count\x18\x0c \x01(\x03\x12\x1b\n\x13true_negative_count\x18\r \x01(\x03\x1a\xbb\x01\n\x0f\x43onfusionMatrix\x12\x1a\n\x12\x61nnotation_spec_id\x18\x01 \x03(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x03(\t\x12X\n\x03row\x18\x02 \x03(\x0b\x32K.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row\x1a\x1c\n\x03Row\x12\x15\n\rexample_count\x18\x01 \x03(\x05*Y\n\x12\x43lassificationType\x12#\n\x1f\x43LASSIFICATION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTICLASS\x10\x01\x12\x0e\n\nMULTILABEL\x10\x02\x42\xb5\x01\n\x1a\x63om.google.cloud.automl.v1B\x13\x43lassificationProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - ClassificationAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ClassificationAnnotation").msgclass - ClassificationEvaluationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ClassificationEvaluationMetrics").msgclass - ClassificationEvaluationMetrics::ConfidenceMetricsEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry").msgclass - ClassificationEvaluationMetrics::ConfusionMatrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix").msgclass - ClassificationEvaluationMetrics::ConfusionMatrix::Row = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row").msgclass - ClassificationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ClassificationType").enummodule - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/data_items_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/data_items_pb.rb deleted file mode 100644 index 06071be6eda6..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/data_items_pb.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/data_items.proto - -require 'google/protobuf' - -require 'google/cloud/automl/v1/geometry_pb' -require 'google/cloud/automl/v1/io_pb' -require 'google/cloud/automl/v1/text_segment_pb' - - -descriptor_data = "\n\'google/cloud/automl/v1/data_items.proto\x12\x16google.cloud.automl.v1\x1a%google/cloud/automl/v1/geometry.proto\x1a\x1fgoogle/cloud/automl/v1/io.proto\x1a)google/cloud/automl/v1/text_segment.proto\"=\n\x05Image\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\x0cH\x00\x12\x15\n\rthumbnail_uri\x18\x04 \x01(\tB\x06\n\x04\x64\x61ta\"F\n\x0bTextSnippet\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x13\n\x0b\x63ontent_uri\x18\x04 \x01(\t\"\xea\x01\n\x12\x44ocumentDimensions\x12N\n\x04unit\x18\x01 \x01(\x0e\x32@.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit\x12\r\n\x05width\x18\x02 \x01(\x02\x12\x0e\n\x06height\x18\x03 \x01(\x02\"e\n\x15\x44ocumentDimensionUnit\x12\'\n#DOCUMENT_DIMENSION_UNIT_UNSPECIFIED\x10\x00\x12\x08\n\x04INCH\x10\x01\x12\x0e\n\nCENTIMETER\x10\x02\x12\t\n\x05POINT\x10\x03\"\xd6\x05\n\x08\x44ocument\x12\x41\n\x0cinput_config\x18\x01 \x01(\x0b\x32+.google.cloud.automl.v1.DocumentInputConfig\x12:\n\rdocument_text\x18\x02 \x01(\x0b\x32#.google.cloud.automl.v1.TextSnippet\x12\x37\n\x06layout\x18\x03 \x03(\x0b\x32\'.google.cloud.automl.v1.Document.Layout\x12G\n\x13\x64ocument_dimensions\x18\x04 \x01(\x0b\x32*.google.cloud.automl.v1.DocumentDimensions\x12\x12\n\npage_count\x18\x05 \x01(\x05\x1a\xb4\x03\n\x06Layout\x12\x39\n\x0ctext_segment\x18\x01 \x01(\x0b\x32#.google.cloud.automl.v1.TextSegment\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05\x12;\n\rbounding_poly\x18\x03 \x01(\x0b\x32$.google.cloud.automl.v1.BoundingPoly\x12R\n\x11text_segment_type\x18\x04 \x01(\x0e\x32\x37.google.cloud.automl.v1.Document.Layout.TextSegmentType\"\xc8\x01\n\x0fTextSegmentType\x12!\n\x1dTEXT_SEGMENT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TOKEN\x10\x01\x12\r\n\tPARAGRAPH\x10\x02\x12\x0e\n\nFORM_FIELD\x10\x03\x12\x13\n\x0f\x46ORM_FIELD_NAME\x10\x04\x12\x17\n\x13\x46ORM_FIELD_CONTENTS\x10\x05\x12\t\n\x05TABLE\x10\x06\x12\x10\n\x0cTABLE_HEADER\x10\x07\x12\r\n\tTABLE_ROW\x10\x08\x12\x0e\n\nTABLE_CELL\x10\t\"\xbe\x01\n\x0e\x45xamplePayload\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x1d.google.cloud.automl.v1.ImageH\x00\x12;\n\x0ctext_snippet\x18\x02 \x01(\x0b\x32#.google.cloud.automl.v1.TextSnippetH\x00\x12\x34\n\x08\x64ocument\x18\x04 \x01(\x0b\x32 .google.cloud.automl.v1.DocumentH\x00\x42\t\n\x07payloadB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.Image").msgclass - TextSnippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextSnippet").msgclass - DocumentDimensions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DocumentDimensions").msgclass - DocumentDimensions::DocumentDimensionUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit").enummodule - Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.Document").msgclass - Document::Layout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.Document.Layout").msgclass - Document::Layout::TextSegmentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.Document.Layout.TextSegmentType").enummodule - ExamplePayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ExamplePayload").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/dataset_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/dataset_pb.rb deleted file mode 100644 index af1155523150..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/dataset_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/dataset.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/automl/v1/image_pb' -require 'google/cloud/automl/v1/text_pb' -require 'google/cloud/automl/v1/translation_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n$google/cloud/automl/v1/dataset.proto\x12\x16google.cloud.automl.v1\x1a\x19google/api/resource.proto\x1a\"google/cloud/automl/v1/image.proto\x1a!google/cloud/automl/v1/text.proto\x1a(google/cloud/automl/v1/translation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe0\x07\n\x07\x44\x61taset\x12Z\n\x1ctranslation_dataset_metadata\x18\x17 \x01(\x0b\x32\x32.google.cloud.automl.v1.TranslationDatasetMetadataH\x00\x12k\n%image_classification_dataset_metadata\x18\x18 \x01(\x0b\x32:.google.cloud.automl.v1.ImageClassificationDatasetMetadataH\x00\x12i\n$text_classification_dataset_metadata\x18\x19 \x01(\x0b\x32\x39.google.cloud.automl.v1.TextClassificationDatasetMetadataH\x00\x12n\n\'image_object_detection_dataset_metadata\x18\x1a \x01(\x0b\x32;.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataH\x00\x12\x61\n text_extraction_dataset_metadata\x18\x1c \x01(\x0b\x32\x35.google.cloud.automl.v1.TextExtractionDatasetMetadataH\x00\x12_\n\x1ftext_sentiment_dataset_metadata\x18\x1e \x01(\x0b\x32\x34.google.cloud.automl.v1.TextSentimentDatasetMetadataH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x15\n\rexample_count\x18\x15 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04\x65tag\x18\x11 \x01(\t\x12;\n\x06labels\x18\' \x03(\x0b\x32+.google.cloud.automl.v1.Dataset.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:^\xea\x41[\n\x1d\x61utoml.googleapis.com/Dataset\x12:projects/{project}/locations/{location}/datasets/{dataset}B\x12\n\x10\x64\x61taset_metadataB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.Dataset").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/detection_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/detection_pb.rb deleted file mode 100644 index 644c36eb549f..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/detection_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/detection.proto - -require 'google/protobuf' - -require 'google/cloud/automl/v1/geometry_pb' - - -descriptor_data = "\n&google/cloud/automl/v1/detection.proto\x12\x16google.cloud.automl.v1\x1a%google/cloud/automl/v1/geometry.proto\"k\n\x1eImageObjectDetectionAnnotation\x12:\n\x0c\x62ounding_box\x18\x01 \x01(\x0b\x32$.google.cloud.automl.v1.BoundingPoly\x12\r\n\x05score\x18\x02 \x01(\x02\"\xa9\x02\n\x17\x42oundingBoxMetricsEntry\x12\x15\n\riou_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16mean_average_precision\x18\x02 \x01(\x02\x12j\n\x1a\x63onfidence_metrics_entries\x18\x03 \x03(\x0b\x32\x46.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry\x1ak\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x11\n\tprecision\x18\x03 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x04 \x01(\x02\"\xd1\x01\n%ImageObjectDetectionEvaluationMetrics\x12$\n\x1c\x65valuated_bounding_box_count\x18\x01 \x01(\x05\x12U\n\x1c\x62ounding_box_metrics_entries\x18\x02 \x03(\x0b\x32/.google.cloud.automl.v1.BoundingBoxMetricsEntry\x12+\n#bounding_box_mean_average_precision\x18\x03 \x01(\x02\x42\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - ImageObjectDetectionAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageObjectDetectionAnnotation").msgclass - BoundingBoxMetricsEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BoundingBoxMetricsEntry").msgclass - BoundingBoxMetricsEntry::ConfidenceMetricsEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry").msgclass - ImageObjectDetectionEvaluationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/geometry_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/geometry_pb.rb deleted file mode 100644 index 7d463bb0a1e4..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/geometry_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/geometry.proto - -require 'google/protobuf' - - -descriptor_data = "\n%google/cloud/automl/v1/geometry.proto\x12\x16google.cloud.automl.v1\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"U\n\x0c\x42oundingPoly\x12\x45\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32(.google.cloud.automl.v1.NormalizedVertexB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.NormalizedVertex").msgclass - BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BoundingPoly").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/image_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/image_pb.rb deleted file mode 100644 index 537e7a464184..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/image_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/image.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/automl/v1/classification_pb' - - -descriptor_data = "\n\"google/cloud/automl/v1/image.proto\x12\x16google.cloud.automl.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a+google/cloud/automl/v1/classification.proto\"r\n\"ImageClassificationDatasetMetadata\x12L\n\x13\x63lassification_type\x18\x01 \x01(\x0e\x32*.google.cloud.automl.v1.ClassificationTypeB\x03\xe0\x41\x02\"%\n#ImageObjectDetectionDatasetMetadata\"\xf7\x01\n ImageClassificationModelMetadata\x12\x1a\n\rbase_model_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12*\n\x1dtrain_budget_milli_node_hours\x18\x10 \x01(\x03\x42\x03\xe0\x41\x01\x12(\n\x1btrain_cost_milli_node_hours\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03\x12\x18\n\x0bstop_reason\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nmodel_type\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08node_qps\x18\r \x01(\x01\x42\x03\xe0\x41\x03\x12\x17\n\nnode_count\x18\x0e \x01(\x03\x42\x03\xe0\x41\x03\"\xdc\x01\n!ImageObjectDetectionModelMetadata\x12\x17\n\nmodel_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nnode_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x15\n\x08node_qps\x18\x04 \x01(\x01\x42\x03\xe0\x41\x03\x12\x18\n\x0bstop_reason\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12*\n\x1dtrain_budget_milli_node_hours\x18\x06 \x01(\x03\x42\x03\xe0\x41\x01\x12(\n\x1btrain_cost_milli_node_hours\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03\"E\n*ImageClassificationModelDeploymentMetadata\x12\x17\n\nnode_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x04\"F\n+ImageObjectDetectionModelDeploymentMetadata\x12\x17\n\nnode_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x04\x42\xac\x01\n\x1a\x63om.google.cloud.automl.v1B\nImageProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - ImageClassificationDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageClassificationDatasetMetadata").msgclass - ImageObjectDetectionDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata").msgclass - ImageClassificationModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageClassificationModelMetadata").msgclass - ImageObjectDetectionModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageObjectDetectionModelMetadata").msgclass - ImageClassificationModelDeploymentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata").msgclass - ImageObjectDetectionModelDeploymentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/io_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/io_pb.rb deleted file mode 100644 index 3eabed59230d..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/io_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/io.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n\x1fgoogle/cloud/automl/v1/io.proto\x12\x16google.cloud.automl.v1\x1a\x1fgoogle/api/field_behavior.proto\"\xc0\x01\n\x0bInputConfig\x12\x37\n\ngcs_source\x18\x01 \x01(\x0b\x32!.google.cloud.automl.v1.GcsSourceH\x00\x12?\n\x06params\x18\x02 \x03(\x0b\x32/.google.cloud.automl.v1.InputConfig.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06source\"a\n\x17\x42\x61tchPredictInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32!.google.cloud.automl.v1.GcsSourceB\x03\xe0\x41\x02H\x00\x42\x08\n\x06source\"L\n\x13\x44ocumentInputConfig\x12\x35\n\ngcs_source\x18\x01 \x01(\x0b\x32!.google.cloud.automl.v1.GcsSource\"e\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32&.google.cloud.automl.v1.GcsDestinationB\x03\xe0\x41\x02H\x00\x42\r\n\x0b\x64\x65stination\"q\n\x18\x42\x61tchPredictOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32&.google.cloud.automl.v1.GcsDestinationB\x03\xe0\x41\x02H\x00\x42\r\n\x0b\x64\x65stination\"\x82\x02\n\x17ModelExportOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32&.google.cloud.automl.v1.GcsDestinationB\x03\xe0\x41\x02H\x00\x12\x14\n\x0cmodel_format\x18\x04 \x01(\t\x12K\n\x06params\x18\x02 \x03(\x0b\x32;.google.cloud.automl.v1.ModelExportOutputConfig.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\r\n\x0b\x64\x65stination\"$\n\tGcsSource\x12\x17\n\ninput_uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\"0\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.InputConfig").msgclass - BatchPredictInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BatchPredictInputConfig").msgclass - DocumentInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DocumentInputConfig").msgclass - OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.OutputConfig").msgclass - BatchPredictOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BatchPredictOutputConfig").msgclass - ModelExportOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ModelExportOutputConfig").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.GcsSource").msgclass - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.GcsDestination").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/model_evaluation_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/model_evaluation_pb.rb deleted file mode 100644 index 7a64d0c09e95..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/model_evaluation_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/model_evaluation.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/automl/v1/classification_pb' -require 'google/cloud/automl/v1/detection_pb' -require 'google/cloud/automl/v1/text_extraction_pb' -require 'google/cloud/automl/v1/text_sentiment_pb' -require 'google/cloud/automl/v1/translation_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/automl/v1/model_evaluation.proto\x12\x16google.cloud.automl.v1\x1a\x19google/api/resource.proto\x1a+google/cloud/automl/v1/classification.proto\x1a&google/cloud/automl/v1/detection.proto\x1a,google/cloud/automl/v1/text_extraction.proto\x1a+google/cloud/automl/v1/text_sentiment.proto\x1a(google/cloud/automl/v1/translation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbe\x06\n\x0fModelEvaluation\x12\x64\n!classification_evaluation_metrics\x18\x08 \x01(\x0b\x32\x37.google.cloud.automl.v1.ClassificationEvaluationMetricsH\x00\x12^\n\x1etranslation_evaluation_metrics\x18\t \x01(\x0b\x32\x34.google.cloud.automl.v1.TranslationEvaluationMetricsH\x00\x12r\n)image_object_detection_evaluation_metrics\x18\x0c \x01(\x0b\x32=.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsH\x00\x12\x63\n!text_sentiment_evaluation_metrics\x18\x0b \x01(\x0b\x32\x36.google.cloud.automl.v1.TextSentimentEvaluationMetricsH\x00\x12\x65\n\"text_extraction_evaluation_metrics\x18\r \x01(\x0b\x32\x37.google.cloud.automl.v1.TextExtractionEvaluationMetricsH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1a\n\x12\x61nnotation_spec_id\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0f \x01(\t\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x17\x65valuated_example_count\x18\x06 \x01(\x05:\x87\x01\xea\x41\x83\x01\n%automl.googleapis.com/ModelEvaluation\x12Zprojects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}B\t\n\x07metricsB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - ModelEvaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ModelEvaluation").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/model_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/model_pb.rb deleted file mode 100644 index 813290824876..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/model_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/model.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/automl/v1/image_pb' -require 'google/cloud/automl/v1/text_pb' -require 'google/cloud/automl/v1/translation_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\"google/cloud/automl/v1/model.proto\x12\x16google.cloud.automl.v1\x1a\x19google/api/resource.proto\x1a\"google/cloud/automl/v1/image.proto\x1a!google/cloud/automl/v1/text.proto\x1a(google/cloud/automl/v1/translation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf1\x08\n\x05Model\x12V\n\x1atranslation_model_metadata\x18\x0f \x01(\x0b\x32\x30.google.cloud.automl.v1.TranslationModelMetadataH\x00\x12g\n#image_classification_model_metadata\x18\r \x01(\x0b\x32\x38.google.cloud.automl.v1.ImageClassificationModelMetadataH\x00\x12\x65\n\"text_classification_model_metadata\x18\x0e \x01(\x0b\x32\x37.google.cloud.automl.v1.TextClassificationModelMetadataH\x00\x12j\n%image_object_detection_model_metadata\x18\x14 \x01(\x0b\x32\x39.google.cloud.automl.v1.ImageObjectDetectionModelMetadataH\x00\x12]\n\x1etext_extraction_model_metadata\x18\x13 \x01(\x0b\x32\x33.google.cloud.automl.v1.TextExtractionModelMetadataH\x00\x12[\n\x1dtext_sentiment_model_metadata\x18\x16 \x01(\x0b\x32\x32.google.cloud.automl.v1.TextSentimentModelMetadataH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\ndataset_id\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12G\n\x10\x64\x65ployment_state\x18\x08 \x01(\x0e\x32-.google.cloud.automl.v1.Model.DeploymentState\x12\x0c\n\x04\x65tag\x18\n \x01(\t\x12\x39\n\x06labels\x18\" \x03(\x0b\x32).google.cloud.automl.v1.Model.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\n\x0f\x44\x65ploymentState\x12 \n\x1c\x44\x45PLOYMENT_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x45PLOYED\x10\x01\x12\x0e\n\nUNDEPLOYED\x10\x02:X\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}B\x10\n\x0emodel_metadataB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.Model").msgclass - Model::DeploymentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.Model.DeploymentState").enummodule - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/operations_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/operations_pb.rb deleted file mode 100644 index f253d09dfae0..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/operations_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/operations.proto - -require 'google/protobuf' - -require 'google/cloud/automl/v1/io_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n\'google/cloud/automl/v1/operations.proto\x12\x16google.cloud.automl.v1\x1a\x1fgoogle/cloud/automl/v1/io.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xc9\x07\n\x11OperationMetadata\x12I\n\x0e\x64\x65lete_details\x18\x08 \x01(\x0b\x32/.google.cloud.automl.v1.DeleteOperationMetadataH\x00\x12T\n\x14\x64\x65ploy_model_details\x18\x18 \x01(\x0b\x32\x34.google.cloud.automl.v1.DeployModelOperationMetadataH\x00\x12X\n\x16undeploy_model_details\x18\x19 \x01(\x0b\x32\x36.google.cloud.automl.v1.UndeployModelOperationMetadataH\x00\x12T\n\x14\x63reate_model_details\x18\n \x01(\x0b\x32\x34.google.cloud.automl.v1.CreateModelOperationMetadataH\x00\x12X\n\x16\x63reate_dataset_details\x18\x1e \x01(\x0b\x32\x36.google.cloud.automl.v1.CreateDatasetOperationMetadataH\x00\x12R\n\x13import_data_details\x18\x0f \x01(\x0b\x32\x33.google.cloud.automl.v1.ImportDataOperationMetadataH\x00\x12V\n\x15\x62\x61tch_predict_details\x18\x10 \x01(\x0b\x32\x35.google.cloud.automl.v1.BatchPredictOperationMetadataH\x00\x12R\n\x13\x65xport_data_details\x18\x15 \x01(\x0b\x32\x33.google.cloud.automl.v1.ExportDataOperationMetadataH\x00\x12T\n\x14\x65xport_model_details\x18\x16 \x01(\x0b\x32\x34.google.cloud.automl.v1.ExportModelOperationMetadataH\x00\x12\x18\n\x10progress_percent\x18\r \x01(\x05\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07\x64\x65tails\"\x19\n\x17\x44\x65leteOperationMetadata\"\x1e\n\x1c\x44\x65ployModelOperationMetadata\" \n\x1eUndeployModelOperationMetadata\" \n\x1e\x43reateDatasetOperationMetadata\"\x1e\n\x1c\x43reateModelOperationMetadata\"\x1d\n\x1bImportDataOperationMetadata\"\xc7\x01\n\x1b\x45xportDataOperationMetadata\x12]\n\x0boutput_info\x18\x01 \x01(\x0b\x32H.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo\x1aI\n\x14\x45xportDataOutputInfo\x12\x1e\n\x14gcs_output_directory\x18\x01 \x01(\tH\x00\x42\x11\n\x0foutput_location\"\x96\x02\n\x1d\x42\x61tchPredictOperationMetadata\x12\x45\n\x0cinput_config\x18\x01 \x01(\x0b\x32/.google.cloud.automl.v1.BatchPredictInputConfig\x12\x61\n\x0boutput_info\x18\x02 \x01(\x0b\x32L.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo\x1aK\n\x16\x42\x61tchPredictOutputInfo\x12\x1e\n\x14gcs_output_directory\x18\x01 \x01(\tH\x00\x42\x11\n\x0foutput_location\"\xb6\x01\n\x1c\x45xportModelOperationMetadata\x12_\n\x0boutput_info\x18\x02 \x01(\x0b\x32J.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo\x1a\x35\n\x15\x45xportModelOutputInfo\x12\x1c\n\x14gcs_output_directory\x18\x01 \x01(\tB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.OperationMetadata").msgclass - DeleteOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DeleteOperationMetadata").msgclass - DeployModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DeployModelOperationMetadata").msgclass - UndeployModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.UndeployModelOperationMetadata").msgclass - CreateDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.CreateDatasetOperationMetadata").msgclass - CreateModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.CreateModelOperationMetadata").msgclass - ImportDataOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImportDataOperationMetadata").msgclass - ExportDataOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ExportDataOperationMetadata").msgclass - ExportDataOperationMetadata::ExportDataOutputInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo").msgclass - BatchPredictOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BatchPredictOperationMetadata").msgclass - BatchPredictOperationMetadata::BatchPredictOutputInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo").msgclass - ExportModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ExportModelOperationMetadata").msgclass - ExportModelOperationMetadata::ExportModelOutputInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service.rb deleted file mode 100644 index 6c5045916cb7..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/automl/v1/version" - -require "google/cloud/automl/v1/prediction_service/credentials" -require "google/cloud/automl/v1/prediction_service/paths" -require "google/cloud/automl/v1/prediction_service/operations" -require "google/cloud/automl/v1/prediction_service/client" -require "google/cloud/automl/v1/prediction_service/rest" - -module Google - module Cloud - module AutoML - module V1 - ## - # AutoML Prediction API. - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/automl/v1/prediction_service" - # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/automl/v1/prediction_service/rest" - # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new - # - module PredictionService - end - end - end - end -end - -helper_path = ::File.join __dir__, "prediction_service", "helpers.rb" -require "google/cloud/automl/v1/prediction_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/client.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/client.rb deleted file mode 100644 index 6b3f20499814..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/client.rb +++ /dev/null @@ -1,770 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/automl/v1/prediction_service_pb" - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - ## - # Client for the PredictionService service. - # - # AutoML Prediction API. - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :prediction_service_stub - - ## - # Configure the PredictionService Client class. - # - # See {::Google::Cloud::AutoML::V1::PredictionService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PredictionService clients - # ::Google::Cloud::AutoML::V1::PredictionService::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", "AutoML", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.predict.timeout = 60.0 - - default_config.rpcs.batch_predict.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PredictionService 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::AutoML::V1::PredictionService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @prediction_service_stub.universe_domain - end - - ## - # Create a new PredictionService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PredictionService 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/automl/v1/prediction_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @prediction_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::AutoML::V1::PredictionService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @prediction_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AutoML::V1::PredictionService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @prediction_service_stub.logger - end - - # Service calls - - ## - # Perform an online prediction. The prediction result is directly - # returned in the response. - # Available for following ML scenarios, and their expected request payloads: - # - # AutoML Vision Classification - # - # * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. - # - # AutoML Vision Object Detection - # - # * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. - # - # AutoML Natural Language Classification - # - # * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in - # .PDF, .TIF or .TIFF format with size upto 2MB. - # - # AutoML Natural Language Entity Extraction - # - # * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document - # in .PDF, .TIF or .TIFF format with size upto 20MB. - # - # AutoML Natural Language Sentiment Analysis - # - # * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in - # .PDF, .TIF or .TIFF format with size upto 2MB. - # - # AutoML Translation - # - # * A TextSnippet up to 25,000 characters, UTF-8 encoded. - # - # AutoML Tables - # - # * A row with column values matching - # the columns of the model, up to 5MB. Not available for FORECASTING - # `prediction_type`. - # - # @overload predict(request, options = nil) - # Pass arguments to `predict` via a request object, either of type - # {::Google::Cloud::AutoML::V1::PredictRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::PredictRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload predict(name: nil, payload: nil, params: nil) - # Pass arguments to `predict` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the model requested to serve the prediction. - # @param payload [::Google::Cloud::AutoML::V1::ExamplePayload, ::Hash] - # Required. Payload to perform a prediction on. The payload must match the - # problem type that the model was trained to solve. - # @param params [::Hash{::String => ::String}] - # Additional domain-specific parameters, any string must be up to 25000 - # characters long. - # - # AutoML Vision Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for an image, it will only produce results that have - # at least this confidence score. The default is 0.5. - # - # AutoML Vision Object Detection - # - # `score_threshold` - # : (float) When Model detects objects on the image, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned. The default is 100. The - # number of returned bounding boxes might be limited by the server. - # - # AutoML Tables - # - # `feature_importance` - # : (boolean) Whether - # [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] - # is populated in the returned list of - # [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] - # objects. The default is false. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AutoML::V1::PredictResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AutoML::V1::PredictResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::PredictionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::PredictRequest.new - # - # # Call the predict method. - # result = client.predict request - # - # # The returned object is of type Google::Cloud::AutoML::V1::PredictResponse. - # p result - # - def predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::PredictRequest - - # Converts hash 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.predict.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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.predict.timeout, - metadata: metadata, - retry_policy: @config.rpcs.predict.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_service_stub.call_rpc :predict, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Perform a batch prediction. Unlike the online {::Google::Cloud::AutoML::V1::PredictionService::Client#predict Predict}, batch - # prediction result won't be immediately available in the response. Instead, - # a long running operation object is returned. User can poll the operation - # result via GetOperation - # method. Once the operation is done, {::Google::Cloud::AutoML::V1::BatchPredictResult BatchPredictResult} is returned in - # the {::Google::Longrunning::Operation#response response} field. - # Available for following ML scenarios: - # - # * AutoML Vision Classification - # * AutoML Vision Object Detection - # * AutoML Video Intelligence Classification - # * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification - # * AutoML Natural Language Entity Extraction - # * AutoML Natural Language Sentiment Analysis - # * AutoML Tables - # - # @overload batch_predict(request, options = nil) - # Pass arguments to `batch_predict` via a request object, either of type - # {::Google::Cloud::AutoML::V1::BatchPredictRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::BatchPredictRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_predict(name: nil, input_config: nil, output_config: nil, params: nil) - # Pass arguments to `batch_predict` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the model requested to serve the batch prediction. - # @param input_config [::Google::Cloud::AutoML::V1::BatchPredictInputConfig, ::Hash] - # Required. The input configuration for batch prediction. - # @param output_config [::Google::Cloud::AutoML::V1::BatchPredictOutputConfig, ::Hash] - # Required. The Configuration specifying where output predictions should - # be written. - # @param params [::Hash{::String => ::String}] - # Additional domain-specific parameters for the predictions, any string must - # be up to 25000 characters long. - # - # AutoML Natural Language Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for a text snippet, it will only produce results - # that have at least this confidence score. The default is 0.5. - # - # - # AutoML Vision Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for an image, it will only produce results that - # have at least this confidence score. The default is 0.5. - # - # AutoML Vision Object Detection - # - # `score_threshold` - # : (float) When Model detects objects on the image, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned per image. The default is 100, the - # number of bounding boxes returned might be limited by the server. - # AutoML Video Intelligence Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for a video, it will only produce results that - # have at least this confidence score. The default is 0.5. - # - # `segment_classification` - # : (boolean) Set to true to request - # segment-level classification. AutoML Video Intelligence returns - # labels and their confidence scores for the entire segment of the - # video that user specified in the request configuration. - # The default is true. - # - # `shot_classification` - # : (boolean) Set to true to request shot-level - # classification. AutoML Video Intelligence determines the boundaries - # for each camera shot in the entire segment of the video that user - # specified in the request configuration. AutoML Video Intelligence - # then returns labels and their confidence scores for each detected - # shot, along with the start and end time of the shot. - # The default is false. - # - # WARNING: Model evaluation is not done for this classification type, - # the quality of it depends on training data, but there are no metrics - # provided to describe that quality. - # - # `1s_interval_classification` - # : (boolean) Set to true to request - # classification for a video at one-second intervals. AutoML Video - # Intelligence returns labels and their confidence scores for each - # second of the entire segment of the video that user specified in the - # request configuration. The default is false. - # - # WARNING: Model evaluation is not done for this classification - # type, the quality of it depends on training data, but there are no - # metrics provided to describe that quality. - # - # AutoML Video Intelligence Object Tracking - # - # `score_threshold` - # : (float) When Model detects objects on video frames, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned per image. The default is 100, the - # number of bounding boxes returned might be limited by the server. - # - # `min_bounding_box_size` - # : (float) Only bounding boxes with shortest edge - # at least that long as a relative value of video frame size are - # returned. Value in 0 to 1 range. Default is 0. - # - # @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/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::PredictionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::BatchPredictRequest.new - # - # # Call the batch_predict method. - # result = client.batch_predict request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::BatchPredictRequest - - # Converts hash 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_predict.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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_predict.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_predict.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_service_stub.call_rpc :batch_predict, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the PredictionService API. - # - # This class represents the configuration for PredictionService, - # 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::AutoML::V1::PredictionService::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 - # # predict to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AutoML::V1::PredictionService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.predict.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.predict.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the PredictionService 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `predict` - # @return [::Gapic::Config::Method] - # - attr_reader :predict - ## - # RPC-specific configuration for `batch_predict` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_predict - - # @private - def initialize parent_rpcs = nil - predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict - @predict = ::Gapic::Config::Method.new predict_config - batch_predict_config = parent_rpcs.batch_predict if parent_rpcs.respond_to? :batch_predict - @batch_predict = ::Gapic::Config::Method.new batch_predict_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/credentials.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/credentials.rb deleted file mode 100644 index 4fe31b05d81c..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - # Credentials for the PredictionService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "AUTOML_CREDENTIALS", - "AUTOML_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "AUTOML_CREDENTIALS_JSON", - "AUTOML_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/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/operations.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/operations.rb deleted file mode 100644 index d1c4f5788ef3..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/operations.rb +++ /dev/null @@ -1,851 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PredictionService 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 PredictionService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - throw :response, 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, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - 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, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::AutoML::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - 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.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? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/paths.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/paths.rb deleted file mode 100644 index b529a1fcf51f..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/paths.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - # Path helper methods for the PredictionService API. - module Paths - ## - # Create a fully-qualified Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}" - end - - extend self - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest.rb deleted file mode 100644 index 566a8b946d44..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/automl/v1/version" - -require "google/cloud/automl/v1/prediction_service/credentials" -require "google/cloud/automl/v1/prediction_service/paths" -require "google/cloud/automl/v1/prediction_service/rest/operations" -require "google/cloud/automl/v1/prediction_service/rest/client" - -module Google - module Cloud - module AutoML - module V1 - ## - # AutoML Prediction API. - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/automl/v1/prediction_service/rest" - # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new - # - module PredictionService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/automl/v1/prediction_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/client.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/client.rb deleted file mode 100644 index e9f9264051f9..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/client.rb +++ /dev/null @@ -1,713 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/automl/v1/prediction_service_pb" -require "google/cloud/automl/v1/prediction_service/rest/service_stub" - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - module Rest - ## - # REST client for the PredictionService service. - # - # AutoML Prediction API. - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :prediction_service_stub - - ## - # Configure the PredictionService Client class. - # - # See {::Google::Cloud::AutoML::V1::PredictionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PredictionService clients - # ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "AutoML", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.predict.timeout = 60.0 - - default_config.rpcs.batch_predict.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PredictionService 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::AutoML::V1::PredictionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @prediction_service_stub.universe_domain - end - - ## - # Create a new PredictionService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PredictionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @prediction_service_stub = ::Google::Cloud::AutoML::V1::PredictionService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @prediction_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AutoML::V1::PredictionService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @prediction_service_stub.logger - end - - # Service calls - - ## - # Perform an online prediction. The prediction result is directly - # returned in the response. - # Available for following ML scenarios, and their expected request payloads: - # - # AutoML Vision Classification - # - # * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. - # - # AutoML Vision Object Detection - # - # * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. - # - # AutoML Natural Language Classification - # - # * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in - # .PDF, .TIF or .TIFF format with size upto 2MB. - # - # AutoML Natural Language Entity Extraction - # - # * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document - # in .PDF, .TIF or .TIFF format with size upto 20MB. - # - # AutoML Natural Language Sentiment Analysis - # - # * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in - # .PDF, .TIF or .TIFF format with size upto 2MB. - # - # AutoML Translation - # - # * A TextSnippet up to 25,000 characters, UTF-8 encoded. - # - # AutoML Tables - # - # * A row with column values matching - # the columns of the model, up to 5MB. Not available for FORECASTING - # `prediction_type`. - # - # @overload predict(request, options = nil) - # Pass arguments to `predict` via a request object, either of type - # {::Google::Cloud::AutoML::V1::PredictRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::PredictRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload predict(name: nil, payload: nil, params: nil) - # Pass arguments to `predict` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the model requested to serve the prediction. - # @param payload [::Google::Cloud::AutoML::V1::ExamplePayload, ::Hash] - # Required. Payload to perform a prediction on. The payload must match the - # problem type that the model was trained to solve. - # @param params [::Hash{::String => ::String}] - # Additional domain-specific parameters, any string must be up to 25000 - # characters long. - # - # AutoML Vision Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for an image, it will only produce results that have - # at least this confidence score. The default is 0.5. - # - # AutoML Vision Object Detection - # - # `score_threshold` - # : (float) When Model detects objects on the image, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned. The default is 100. The - # number of returned bounding boxes might be limited by the server. - # - # AutoML Tables - # - # `feature_importance` - # : (boolean) Whether - # [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] - # is populated in the returned list of - # [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] - # objects. The default is false. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::PredictResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::PredictResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::PredictRequest.new - # - # # Call the predict method. - # result = client.predict request - # - # # The returned object is of type Google::Cloud::AutoML::V1::PredictResponse. - # p result - # - def predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::PredictRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.predict.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.predict.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.predict.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_service_stub.predict request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Perform a batch prediction. Unlike the online {::Google::Cloud::AutoML::V1::PredictionService::Rest::Client#predict Predict}, batch - # prediction result won't be immediately available in the response. Instead, - # a long running operation object is returned. User can poll the operation - # result via GetOperation - # method. Once the operation is done, {::Google::Cloud::AutoML::V1::BatchPredictResult BatchPredictResult} is returned in - # the {::Google::Longrunning::Operation#response response} field. - # Available for following ML scenarios: - # - # * AutoML Vision Classification - # * AutoML Vision Object Detection - # * AutoML Video Intelligence Classification - # * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification - # * AutoML Natural Language Entity Extraction - # * AutoML Natural Language Sentiment Analysis - # * AutoML Tables - # - # @overload batch_predict(request, options = nil) - # Pass arguments to `batch_predict` via a request object, either of type - # {::Google::Cloud::AutoML::V1::BatchPredictRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AutoML::V1::BatchPredictRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_predict(name: nil, input_config: nil, output_config: nil, params: nil) - # Pass arguments to `batch_predict` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the model requested to serve the batch prediction. - # @param input_config [::Google::Cloud::AutoML::V1::BatchPredictInputConfig, ::Hash] - # Required. The input configuration for batch prediction. - # @param output_config [::Google::Cloud::AutoML::V1::BatchPredictOutputConfig, ::Hash] - # Required. The Configuration specifying where output predictions should - # be written. - # @param params [::Hash{::String => ::String}] - # Additional domain-specific parameters for the predictions, any string must - # be up to 25000 characters long. - # - # AutoML Natural Language Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for a text snippet, it will only produce results - # that have at least this confidence score. The default is 0.5. - # - # - # AutoML Vision Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for an image, it will only produce results that - # have at least this confidence score. The default is 0.5. - # - # AutoML Vision Object Detection - # - # `score_threshold` - # : (float) When Model detects objects on the image, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned per image. The default is 100, the - # number of bounding boxes returned might be limited by the server. - # AutoML Video Intelligence Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for a video, it will only produce results that - # have at least this confidence score. The default is 0.5. - # - # `segment_classification` - # : (boolean) Set to true to request - # segment-level classification. AutoML Video Intelligence returns - # labels and their confidence scores for the entire segment of the - # video that user specified in the request configuration. - # The default is true. - # - # `shot_classification` - # : (boolean) Set to true to request shot-level - # classification. AutoML Video Intelligence determines the boundaries - # for each camera shot in the entire segment of the video that user - # specified in the request configuration. AutoML Video Intelligence - # then returns labels and their confidence scores for each detected - # shot, along with the start and end time of the shot. - # The default is false. - # - # WARNING: Model evaluation is not done for this classification type, - # the quality of it depends on training data, but there are no metrics - # provided to describe that quality. - # - # `1s_interval_classification` - # : (boolean) Set to true to request - # classification for a video at one-second intervals. AutoML Video - # Intelligence returns labels and their confidence scores for each - # second of the entire segment of the video that user specified in the - # request configuration. The default is false. - # - # WARNING: Model evaluation is not done for this classification - # type, the quality of it depends on training data, but there are no - # metrics provided to describe that quality. - # - # AutoML Video Intelligence Object Tracking - # - # `score_threshold` - # : (float) When Model detects objects on video frames, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned per image. The default is 100, the - # number of bounding boxes returned might be limited by the server. - # - # `min_bounding_box_size` - # : (float) Only bounding boxes with shortest edge - # at least that long as a relative value of video frame size are - # returned. Value in 0 to 1 range. Default is 0. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/automl/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AutoML::V1::BatchPredictRequest.new - # - # # Call the batch_predict method. - # result = client.batch_predict request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::BatchPredictRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_predict.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_predict.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_predict.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_service_stub.batch_predict request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the PredictionService REST API. - # - # This class represents the configuration for PredictionService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::AutoML::V1::PredictionService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # predict to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.predict.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.predict.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @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 PredictionService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `predict` - # @return [::Gapic::Config::Method] - # - attr_reader :predict - ## - # RPC-specific configuration for `batch_predict` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_predict - - # @private - def initialize parent_rpcs = nil - predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict - @predict = ::Gapic::Config::Method.new predict_config - batch_predict_config = parent_rpcs.batch_predict if parent_rpcs.respond_to? :batch_predict - @batch_predict = ::Gapic::Config::Method.new batch_predict_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/operations.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/operations.rb deleted file mode 100644 index 9d66ea3048ba..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/operations.rb +++ /dev/null @@ -1,1095 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PredictionService 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 PredictionService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => 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 [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AutoML::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: call_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.wait_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "automl.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the wait_operation REST call - # - # @param request_pb [::Google::Longrunning::WaitOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def wait_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "wait_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the wait_operation REST call - # - # @param request_pb [::Google::Longrunning::WaitOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_wait_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:wait", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb deleted file mode 100644 index ed831fb87e44..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb +++ /dev/null @@ -1,205 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/automl/v1/prediction_service_pb" - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - module Rest - ## - # REST service stub for the PredictionService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the predict REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::PredictRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AutoML::V1::PredictResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AutoML::V1::PredictResponse] - # A result object deserialized from the server's reply - def predict request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_predict_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "predict", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AutoML::V1::PredictResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_predict REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::BatchPredictRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_predict request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_predict_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_predict", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the predict REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::PredictRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_predict_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:predict", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_predict REST call - # - # @param request_pb [::Google::Cloud::AutoML::V1::BatchPredictRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_predict_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:batchPredict", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_pb.rb deleted file mode 100644 index bd25b445ea06..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/prediction_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/automl/v1/annotation_payload_pb' -require 'google/cloud/automl/v1/data_items_pb' -require 'google/cloud/automl/v1/io_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n/google/cloud/automl/v1/prediction_service.proto\x12\x16google.cloud.automl.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/automl/v1/annotation_payload.proto\x1a\'google/cloud/automl/v1/data_items.proto\x1a\x1fgoogle/cloud/automl/v1/io.proto\x1a#google/longrunning/operations.proto\"\xf4\x01\n\x0ePredictRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12<\n\x07payload\x18\x02 \x01(\x0b\x32&.google.cloud.automl.v1.ExamplePayloadB\x03\xe0\x41\x02\x12\x42\n\x06params\x18\x03 \x03(\x0b\x32\x32.google.cloud.automl.v1.PredictRequest.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8b\x02\n\x0fPredictResponse\x12:\n\x07payload\x18\x01 \x03(\x0b\x32).google.cloud.automl.v1.AnnotationPayload\x12\x42\n\x12preprocessed_input\x18\x03 \x01(\x0b\x32&.google.cloud.automl.v1.ExamplePayload\x12G\n\x08metadata\x18\x02 \x03(\x0b\x32\x35.google.cloud.automl.v1.PredictResponse.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xda\x02\n\x13\x42\x61tchPredictRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12J\n\x0cinput_config\x18\x03 \x01(\x0b\x32/.google.cloud.automl.v1.BatchPredictInputConfigB\x03\xe0\x41\x02\x12L\n\routput_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.automl.v1.BatchPredictOutputConfigB\x03\xe0\x41\x02\x12G\n\x06params\x18\x05 \x03(\x0b\x32\x37.google.cloud.automl.v1.BatchPredictRequest.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x91\x01\n\x12\x42\x61tchPredictResult\x12J\n\x08metadata\x18\x01 \x03(\x0b\x32\x38.google.cloud.automl.v1.BatchPredictResult.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\x85\x04\n\x11PredictionService\x12\xaf\x01\n\x07Predict\x12&.google.cloud.automl.v1.PredictRequest\x1a\'.google.cloud.automl.v1.PredictResponse\"S\xda\x41\x13name,payload,params\x82\xd3\xe4\x93\x02\x37\"2/v1/{name=projects/*/locations/*/models/*}:predict:\x01*\x12\xf2\x01\n\x0c\x42\x61tchPredict\x12+.google.cloud.automl.v1.BatchPredictRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41\'\n\x12\x42\x61tchPredictResult\x12\x11OperationMetadata\xda\x41&name,input_config,output_config,params\x82\xd3\xe4\x93\x02<\"7/v1/{name=projects/*/locations/*/models/*}:batchPredict:\x01*\x1aI\xca\x41\x15\x61utoml.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb8\x01\n\x1a\x63om.google.cloud.automl.v1B\x16PredictionServiceProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - PredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.PredictRequest").msgclass - PredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.PredictResponse").msgclass - BatchPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BatchPredictRequest").msgclass - BatchPredictResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.BatchPredictResult").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_services_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_services_pb.rb deleted file mode 100644 index fa9f4cd6c333..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service_services_pb.rb +++ /dev/null @@ -1,99 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/automl/v1/prediction_service.proto for package 'Google.Cloud.AutoML.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/automl/v1/prediction_service_pb' - -module Google - module Cloud - module AutoML - module V1 - module PredictionService - # AutoML Prediction API. - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.automl.v1.PredictionService' - - # Perform an online prediction. The prediction result is directly - # returned in the response. - # Available for following ML scenarios, and their expected request payloads: - # - # AutoML Vision Classification - # - # * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. - # - # AutoML Vision Object Detection - # - # * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. - # - # AutoML Natural Language Classification - # - # * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in - # .PDF, .TIF or .TIFF format with size upto 2MB. - # - # AutoML Natural Language Entity Extraction - # - # * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document - # in .PDF, .TIF or .TIFF format with size upto 20MB. - # - # AutoML Natural Language Sentiment Analysis - # - # * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in - # .PDF, .TIF or .TIFF format with size upto 2MB. - # - # AutoML Translation - # - # * A TextSnippet up to 25,000 characters, UTF-8 encoded. - # - # AutoML Tables - # - # * A row with column values matching - # the columns of the model, up to 5MB. Not available for FORECASTING - # `prediction_type`. - rpc :Predict, ::Google::Cloud::AutoML::V1::PredictRequest, ::Google::Cloud::AutoML::V1::PredictResponse - # Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch - # prediction result won't be immediately available in the response. Instead, - # a long running operation object is returned. User can poll the operation - # result via [GetOperation][google.longrunning.Operations.GetOperation] - # method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in - # the [response][google.longrunning.Operation.response] field. - # Available for following ML scenarios: - # - # * AutoML Vision Classification - # * AutoML Vision Object Detection - # * AutoML Video Intelligence Classification - # * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification - # * AutoML Natural Language Entity Extraction - # * AutoML Natural Language Sentiment Analysis - # * AutoML Tables - rpc :BatchPredict, ::Google::Cloud::AutoML::V1::BatchPredictRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/rest.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/rest.rb deleted file mode 100644 index e7f6441bacb9..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/automl/v1/prediction_service/rest" -require "google/cloud/automl/v1/automl/rest" -require "google/cloud/automl/v1/version" - -module Google - module Cloud - module AutoML - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/automl/v1/rest" - # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/service_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/service_pb.rb deleted file mode 100644 index 965c37c6de4c..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/service_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/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/automl/v1/annotation_payload_pb' -require 'google/cloud/automl/v1/annotation_spec_pb' -require 'google/cloud/automl/v1/dataset_pb' -require 'google/cloud/automl/v1/image_pb' -require 'google/cloud/automl/v1/io_pb' -require 'google/cloud/automl/v1/model_pb' -require 'google/cloud/automl/v1/model_evaluation_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n$google/cloud/automl/v1/service.proto\x12\x16google.cloud.automl.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/automl/v1/annotation_payload.proto\x1a,google/cloud/automl/v1/annotation_spec.proto\x1a$google/cloud/automl/v1/dataset.proto\x1a\"google/cloud/automl/v1/image.proto\x1a\x1fgoogle/cloud/automl/v1/io.proto\x1a\"google/cloud/automl/v1/model.proto\x1a-google/cloud/automl/v1/model_evaluation.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\"\x88\x01\n\x14\x43reateDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x35\n\x07\x64\x61taset\x18\x02 \x01(\x0b\x32\x1f.google.cloud.automl.v1.DatasetB\x03\xe0\x41\x02\"H\n\x11GetDatasetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61utoml.googleapis.com/Dataset\"\x87\x01\n\x13ListDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\"b\n\x14ListDatasetsResponse\x12\x31\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32\x1f.google.cloud.automl.v1.Dataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x83\x01\n\x14UpdateDatasetRequest\x12\x35\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32\x1f.google.cloud.automl.v1.DatasetB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"K\n\x14\x44\x65leteDatasetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61utoml.googleapis.com/Dataset\"\x88\x01\n\x11ImportDataRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61utoml.googleapis.com/Dataset\x12>\n\x0cinput_config\x18\x03 \x01(\x0b\x32#.google.cloud.automl.v1.InputConfigB\x03\xe0\x41\x02\"\x8a\x01\n\x11\x45xportDataRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61utoml.googleapis.com/Dataset\x12@\n\routput_config\x18\x03 \x01(\x0b\x32$.google.cloud.automl.v1.OutputConfigB\x03\xe0\x41\x02\"V\n\x18GetAnnotationSpecRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$automl.googleapis.com/AnnotationSpec\"\x82\x01\n\x12\x43reateModelRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x31\n\x05model\x18\x04 \x01(\x0b\x32\x1d.google.cloud.automl.v1.ModelB\x03\xe0\x41\x02\"D\n\x0fGetModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\"\x85\x01\n\x11ListModelsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\"[\n\x12ListModelsResponse\x12,\n\x05model\x18\x01 \x03(\x0b\x32\x1d.google.cloud.automl.v1.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"G\n\x12\x44\x65leteModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\"}\n\x12UpdateModelRequest\x12\x31\n\x05model\x18\x01 \x01(\x0b\x32\x1d.google.cloud.automl.v1.ModelB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xe3\x02\n\x12\x44\x65ployModelRequest\x12\x7f\n0image_object_detection_model_deployment_metadata\x18\x02 \x01(\x0b\x32\x43.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataH\x00\x12|\n.image_classification_model_deployment_metadata\x18\x04 \x01(\x0b\x32\x42.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataH\x00\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/ModelB\x1b\n\x19model_deployment_metadata\"I\n\x14UndeployModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\"\x94\x01\n\x12\x45xportModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12K\n\routput_config\x18\x03 \x01(\x0b\x32/.google.cloud.automl.v1.ModelExportOutputConfigB\x03\xe0\x41\x02\"X\n\x19GetModelEvaluationRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%automl.googleapis.com/ModelEvaluation\"\x8e\x01\n\x1bListModelEvaluationsRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\"z\n\x1cListModelEvaluationsResponse\x12\x41\n\x10model_evaluation\x18\x01 \x03(\x0b\x32\'.google.cloud.automl.v1.ModelEvaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe8\x1b\n\x06\x41utoMl\x12\xcb\x01\n\rCreateDataset\x12,.google.cloud.automl.v1.CreateDatasetRequest\x1a\x1d.google.longrunning.Operation\"m\xca\x41\x1c\n\x07\x44\x61taset\x12\x11OperationMetadata\xda\x41\x0eparent,dataset\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/datasets:\x07\x64\x61taset\x12\x95\x01\n\nGetDataset\x12).google.cloud.automl.v1.GetDatasetRequest\x1a\x1f.google.cloud.automl.v1.Dataset\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/datasets/*}\x12\xa8\x01\n\x0cListDatasets\x12+.google.cloud.automl.v1.ListDatasetsRequest\x1a,.google.cloud.automl.v1.ListDatasetsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/datasets\x12\xbb\x01\n\rUpdateDataset\x12,.google.cloud.automl.v1.UpdateDatasetRequest\x1a\x1f.google.cloud.automl.v1.Dataset\"[\xda\x41\x13\x64\x61taset,update_mask\x82\xd3\xe4\x93\x02?24/v1/{dataset.name=projects/*/locations/*/datasets/*}:\x07\x64\x61taset\x12\xc6\x01\n\rDeleteDataset\x12,.google.cloud.automl.v1.DeleteDatasetRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/datasets/*}\x12\xdc\x01\n\nImportData\x12).google.cloud.automl.v1.ImportDataRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x11name,input_config\x82\xd3\xe4\x93\x02<\"7/v1/{name=projects/*/locations/*/datasets/*}:importData:\x01*\x12\xdd\x01\n\nExportData\x12).google.cloud.automl.v1.ExportDataRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x12name,output_config\x82\xd3\xe4\x93\x02<\"7/v1/{name=projects/*/locations/*/datasets/*}:exportData:\x01*\x12\xbc\x01\n\x11GetAnnotationSpec\x12\x30.google.cloud.automl.v1.GetAnnotationSpecRequest\x1a&.google.cloud.automl.v1.AnnotationSpec\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}\x12\xbf\x01\n\x0b\x43reateModel\x12*.google.cloud.automl.v1.CreateModelRequest\x1a\x1d.google.longrunning.Operation\"e\xca\x41\x1a\n\x05Model\x12\x11OperationMetadata\xda\x41\x0cparent,model\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/models:\x05model\x12\x8d\x01\n\x08GetModel\x12\'.google.cloud.automl.v1.GetModelRequest\x1a\x1d.google.cloud.automl.v1.Model\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/models/*}\x12\xa0\x01\n\nListModels\x12).google.cloud.automl.v1.ListModelsRequest\x1a*.google.cloud.automl.v1.ListModelsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/models\x12\xc0\x01\n\x0b\x44\x65leteModel\x12*.google.cloud.automl.v1.DeleteModelRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/models/*}\x12\xad\x01\n\x0bUpdateModel\x12*.google.cloud.automl.v1.UpdateModelRequest\x1a\x1d.google.cloud.automl.v1.Model\"S\xda\x41\x11model,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{model.name=projects/*/locations/*/models/*}:\x05model\x12\xca\x01\n\x0b\x44\x65ployModel\x12*.google.cloud.automl.v1.DeployModelRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/models/*}:deploy:\x01*\x12\xd0\x01\n\rUndeployModel\x12,.google.cloud.automl.v1.UndeployModelRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/models/*}:undeploy:\x01*\x12\xd8\x01\n\x0b\x45xportModel\x12*.google.cloud.automl.v1.ExportModelRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x12name,output_config\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/models/*}:export:\x01*\x12\xbe\x01\n\x12GetModelEvaluation\x12\x31.google.cloud.automl.v1.GetModelEvaluationRequest\x1a\'.google.cloud.automl.v1.ModelEvaluation\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}\x12\xd8\x01\n\x14ListModelEvaluations\x12\x33.google.cloud.automl.v1.ListModelEvaluationsRequest\x1a\x34.google.cloud.automl.v1.ListModelEvaluationsResponse\"U\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations\x1aI\xca\x41\x15\x61utoml.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xad\x01\n\x1a\x63om.google.cloud.automl.v1B\x0b\x41utoMlProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - CreateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.CreateDatasetRequest").msgclass - GetDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.GetDatasetRequest").msgclass - ListDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ListDatasetsRequest").msgclass - ListDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ListDatasetsResponse").msgclass - UpdateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.UpdateDatasetRequest").msgclass - DeleteDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DeleteDatasetRequest").msgclass - ImportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ImportDataRequest").msgclass - ExportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ExportDataRequest").msgclass - GetAnnotationSpecRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.GetAnnotationSpecRequest").msgclass - CreateModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.CreateModelRequest").msgclass - GetModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.GetModelRequest").msgclass - ListModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ListModelsRequest").msgclass - ListModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ListModelsResponse").msgclass - DeleteModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DeleteModelRequest").msgclass - UpdateModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.UpdateModelRequest").msgclass - DeployModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.DeployModelRequest").msgclass - UndeployModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.UndeployModelRequest").msgclass - ExportModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ExportModelRequest").msgclass - GetModelEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.GetModelEvaluationRequest").msgclass - ListModelEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ListModelEvaluationsRequest").msgclass - ListModelEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.ListModelEvaluationsResponse").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/service_services_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/service_services_pb.rb deleted file mode 100644 index da906eec628a..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/service_services_pb.rb +++ /dev/null @@ -1,136 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/automl/v1/service.proto for package 'Google.Cloud.AutoML.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/automl/v1/service_pb' - -module Google - module Cloud - module AutoML - module V1 - module AutoMl - # AutoML Server API. - # - # The resource names are assigned by the server. - # The server never reuses names that it has created after the resources with - # those names are deleted. - # - # An ID of a resource is the last element of the item's resource name. For - # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - # the id for the item is `{dataset_id}`. - # - # Currently the only supported `location_id` is "us-central1". - # - # On any input that is documented to expect a string parameter in - # snake_case or dash-case, either of those cases is accepted. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.automl.v1.AutoMl' - - # Creates a dataset. - rpc :CreateDataset, ::Google::Cloud::AutoML::V1::CreateDatasetRequest, ::Google::Longrunning::Operation - # Gets a dataset. - rpc :GetDataset, ::Google::Cloud::AutoML::V1::GetDatasetRequest, ::Google::Cloud::AutoML::V1::Dataset - # Lists datasets in a project. - rpc :ListDatasets, ::Google::Cloud::AutoML::V1::ListDatasetsRequest, ::Google::Cloud::AutoML::V1::ListDatasetsResponse - # Updates a dataset. - rpc :UpdateDataset, ::Google::Cloud::AutoML::V1::UpdateDatasetRequest, ::Google::Cloud::AutoML::V1::Dataset - # Deletes a dataset and all of its contents. - # Returns empty response in the - # [response][google.longrunning.Operation.response] field when it completes, - # and `delete_details` in the - # [metadata][google.longrunning.Operation.metadata] field. - rpc :DeleteDataset, ::Google::Cloud::AutoML::V1::DeleteDatasetRequest, ::Google::Longrunning::Operation - # Imports data into a dataset. - # For Tables this method can only be called on an empty Dataset. - # - # For Tables: - # * A - # [schema_inference_version][google.cloud.automl.v1.InputConfig.params] - # parameter must be explicitly set. - # Returns an empty response in the - # [response][google.longrunning.Operation.response] field when it completes. - rpc :ImportData, ::Google::Cloud::AutoML::V1::ImportDataRequest, ::Google::Longrunning::Operation - # Exports dataset's data to the provided output location. - # Returns an empty response in the - # [response][google.longrunning.Operation.response] field when it completes. - rpc :ExportData, ::Google::Cloud::AutoML::V1::ExportDataRequest, ::Google::Longrunning::Operation - # Gets an annotation spec. - rpc :GetAnnotationSpec, ::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest, ::Google::Cloud::AutoML::V1::AnnotationSpec - # Creates a model. - # Returns a Model in the [response][google.longrunning.Operation.response] - # field when it completes. - # When you create a model, several model evaluations are created for it: - # a global evaluation, and one evaluation for each annotation spec. - rpc :CreateModel, ::Google::Cloud::AutoML::V1::CreateModelRequest, ::Google::Longrunning::Operation - # Gets a model. - rpc :GetModel, ::Google::Cloud::AutoML::V1::GetModelRequest, ::Google::Cloud::AutoML::V1::Model - # Lists models. - rpc :ListModels, ::Google::Cloud::AutoML::V1::ListModelsRequest, ::Google::Cloud::AutoML::V1::ListModelsResponse - # Deletes a model. - # Returns `google.protobuf.Empty` in the - # [response][google.longrunning.Operation.response] field when it completes, - # and `delete_details` in the - # [metadata][google.longrunning.Operation.metadata] field. - rpc :DeleteModel, ::Google::Cloud::AutoML::V1::DeleteModelRequest, ::Google::Longrunning::Operation - # Updates a model. - rpc :UpdateModel, ::Google::Cloud::AutoML::V1::UpdateModelRequest, ::Google::Cloud::AutoML::V1::Model - # Deploys a model. If a model is already deployed, deploying it with the - # same parameters has no effect. Deploying with different parametrs - # (as e.g. changing - # [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) - # will reset the deployment state without pausing the model's availability. - # - # Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage - # deployment automatically. - # - # Returns an empty response in the - # [response][google.longrunning.Operation.response] field when it completes. - rpc :DeployModel, ::Google::Cloud::AutoML::V1::DeployModelRequest, ::Google::Longrunning::Operation - # Undeploys a model. If the model is not deployed this method has no effect. - # - # Only applicable for Text Classification, Image Object Detection and Tables; - # all other domains manage deployment automatically. - # - # Returns an empty response in the - # [response][google.longrunning.Operation.response] field when it completes. - rpc :UndeployModel, ::Google::Cloud::AutoML::V1::UndeployModelRequest, ::Google::Longrunning::Operation - # Exports a trained, "export-able", model to a user specified Google Cloud - # Storage location. A model is considered export-able if and only if it has - # an export format defined for it in - # [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. - # - # Returns an empty response in the - # [response][google.longrunning.Operation.response] field when it completes. - rpc :ExportModel, ::Google::Cloud::AutoML::V1::ExportModelRequest, ::Google::Longrunning::Operation - # Gets a model evaluation. - rpc :GetModelEvaluation, ::Google::Cloud::AutoML::V1::GetModelEvaluationRequest, ::Google::Cloud::AutoML::V1::ModelEvaluation - # Lists model evaluations. - rpc :ListModelEvaluations, ::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest, ::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_extraction_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_extraction_pb.rb deleted file mode 100644 index 97da0ef8bb22..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_extraction_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/text_extraction.proto - -require 'google/protobuf' - -require 'google/cloud/automl/v1/text_segment_pb' - - -descriptor_data = "\n,google/cloud/automl/v1/text_extraction.proto\x12\x16google.cloud.automl.v1\x1a)google/cloud/automl/v1/text_segment.proto\"t\n\x18TextExtractionAnnotation\x12;\n\x0ctext_segment\x18\x03 \x01(\x0b\x32#.google.cloud.automl.v1.TextSegmentH\x00\x12\r\n\x05score\x18\x01 \x01(\x02\x42\x0c\n\nannotation\"\x92\x02\n\x1fTextExtractionEvaluationMetrics\x12\x0e\n\x06\x61u_prc\x18\x01 \x01(\x02\x12r\n\x1a\x63onfidence_metrics_entries\x18\x02 \x03(\x0b\x32N.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry\x1ak\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x03 \x01(\x02\x12\x11\n\tprecision\x18\x04 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x05 \x01(\x02\x42\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - TextExtractionAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextExtractionAnnotation").msgclass - TextExtractionEvaluationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextExtractionEvaluationMetrics").msgclass - TextExtractionEvaluationMetrics::ConfidenceMetricsEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_pb.rb deleted file mode 100644 index 92ccffaa6e09..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/text.proto - -require 'google/protobuf' - -require 'google/cloud/automl/v1/classification_pb' - - -descriptor_data = "\n!google/cloud/automl/v1/text.proto\x12\x16google.cloud.automl.v1\x1a+google/cloud/automl/v1/classification.proto\"l\n!TextClassificationDatasetMetadata\x12G\n\x13\x63lassification_type\x18\x01 \x01(\x0e\x32*.google.cloud.automl.v1.ClassificationType\"j\n\x1fTextClassificationModelMetadata\x12G\n\x13\x63lassification_type\x18\x03 \x01(\x0e\x32*.google.cloud.automl.v1.ClassificationType\"\x1f\n\x1dTextExtractionDatasetMetadata\"\x1d\n\x1bTextExtractionModelMetadata\"5\n\x1cTextSentimentDatasetMetadata\x12\x15\n\rsentiment_max\x18\x01 \x01(\x05\"\x1c\n\x1aTextSentimentModelMetadataB\xab\x01\n\x1a\x63om.google.cloud.automl.v1B\tTextProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - TextClassificationDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextClassificationDatasetMetadata").msgclass - TextClassificationModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextClassificationModelMetadata").msgclass - TextExtractionDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextExtractionDatasetMetadata").msgclass - TextExtractionModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextExtractionModelMetadata").msgclass - TextSentimentDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextSentimentDatasetMetadata").msgclass - TextSentimentModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextSentimentModelMetadata").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_segment_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_segment_pb.rb deleted file mode 100644 index f8ac0e311fe0..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_segment_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/text_segment.proto - -require 'google/protobuf' - - -descriptor_data = "\n)google/cloud/automl/v1/text_segment.proto\x12\x16google.cloud.automl.v1\"H\n\x0bTextSegment\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12\x14\n\x0cstart_offset\x18\x01 \x01(\x03\x12\x12\n\nend_offset\x18\x02 \x01(\x03\x42\xb2\x01\n\x1a\x63om.google.cloud.automl.v1B\x10TextSegmentProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextSegment").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_sentiment_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_sentiment_pb.rb deleted file mode 100644 index 4f4061a1a5e2..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/text_sentiment_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/text_sentiment.proto - -require 'google/protobuf' - -require 'google/cloud/automl/v1/classification_pb' - - -descriptor_data = "\n+google/cloud/automl/v1/text_sentiment.proto\x12\x16google.cloud.automl.v1\x1a+google/cloud/automl/v1/classification.proto\",\n\x17TextSentimentAnnotation\x12\x11\n\tsentiment\x18\x01 \x01(\x05\"\xa0\x02\n\x1eTextSentimentEvaluationMetrics\x12\x11\n\tprecision\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x03 \x01(\x02\x12\x1b\n\x13mean_absolute_error\x18\x04 \x01(\x02\x12\x1a\n\x12mean_squared_error\x18\x05 \x01(\x02\x12\x14\n\x0clinear_kappa\x18\x06 \x01(\x02\x12\x17\n\x0fquadratic_kappa\x18\x07 \x01(\x02\x12\x61\n\x10\x63onfusion_matrix\x18\x08 \x01(\x0b\x32G.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixB\xb4\x01\n\x1a\x63om.google.cloud.automl.v1B\x12TextSentimentProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - TextSentimentAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextSentimentAnnotation").msgclass - TextSentimentEvaluationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TextSentimentEvaluationMetrics").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/translation_pb.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/translation_pb.rb deleted file mode 100644 index 728635fe1c9a..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/translation_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl/v1/translation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/automl/v1/data_items_pb' - - -descriptor_data = "\n(google/cloud/automl/v1/translation.proto\x12\x16google.cloud.automl.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\'google/cloud/automl/v1/data_items.proto\"b\n\x1aTranslationDatasetMetadata\x12!\n\x14source_language_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12!\n\x14target_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"K\n\x1cTranslationEvaluationMetrics\x12\x12\n\nbleu_score\x18\x01 \x01(\x01\x12\x17\n\x0f\x62\x61se_bleu_score\x18\x02 \x01(\x01\"j\n\x18TranslationModelMetadata\x12\x12\n\nbase_model\x18\x01 \x01(\t\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1c\n\x14target_language_code\x18\x03 \x01(\t\"X\n\x15TranslationAnnotation\x12?\n\x12translated_content\x18\x01 \x01(\x0b\x32#.google.cloud.automl.v1.TextSnippetB\xb2\x01\n\x1a\x63om.google.cloud.automl.v1B\x10TranslationProtoP\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module AutoML - module V1 - TranslationDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TranslationDatasetMetadata").msgclass - TranslationEvaluationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TranslationEvaluationMetrics").msgclass - TranslationModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TranslationModelMetadata").msgclass - TranslationAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.TranslationAnnotation").msgclass - end - end - end -end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb deleted file mode 100644 index 8589b9a2cd78..000000000000 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 AutoML - module V1 - VERSION = "1.8.1" - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/README.md b/google-cloud-automl-v1/proto_docs/README.md deleted file mode 100644 index fcbf60ce5647..000000000000 --- a/google-cloud-automl-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud AutoML V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/google-cloud-automl-v1/proto_docs/google/api/client.rb b/google-cloud-automl-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - # - # Note: This field should not be used in most cases. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - 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. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # - # Note: This feature should not be used in most cases. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/api/field_behavior.rb b/google-cloud-automl-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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/google-cloud-automl-v1/proto_docs/google/api/resource.rb b/google-cloud-automl-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # 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/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_payload.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_payload.rb deleted file mode 100644 index 9bd24ebc2a4b..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_payload.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Contains annotation information that is relevant to AutoML. - # @!attribute [rw] translation - # @return [::Google::Cloud::AutoML::V1::TranslationAnnotation] - # Annotation details for translation. - # - # Note: The following fields are mutually exclusive: `translation`, `classification`, `image_object_detection`, `text_extraction`, `text_sentiment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] classification - # @return [::Google::Cloud::AutoML::V1::ClassificationAnnotation] - # Annotation details for content or image classification. - # - # Note: The following fields are mutually exclusive: `classification`, `translation`, `image_object_detection`, `text_extraction`, `text_sentiment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_object_detection - # @return [::Google::Cloud::AutoML::V1::ImageObjectDetectionAnnotation] - # Annotation details for image object detection. - # - # Note: The following fields are mutually exclusive: `image_object_detection`, `translation`, `classification`, `text_extraction`, `text_sentiment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_extraction - # @return [::Google::Cloud::AutoML::V1::TextExtractionAnnotation] - # Annotation details for text extraction. - # - # Note: The following fields are mutually exclusive: `text_extraction`, `translation`, `classification`, `image_object_detection`, `text_sentiment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_sentiment - # @return [::Google::Cloud::AutoML::V1::TextSentimentAnnotation] - # Annotation details for text sentiment. - # - # Note: The following fields are mutually exclusive: `text_sentiment`, `translation`, `classification`, `image_object_detection`, `text_extraction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] annotation_spec_id - # @return [::String] - # Output only . The resource ID of the annotation spec that - # this annotation pertains to. The annotation spec comes from either an - # ancestor dataset, or the dataset that was used to train the model in use. - # @!attribute [rw] display_name - # @return [::String] - # Output only. The value of - # {::Google::Cloud::AutoML::V1::AnnotationSpec#display_name display_name} - # when the model was trained. Because this field returns a value at model - # training time, for different models trained using the same dataset, the - # returned value could be different as model owner could update the - # `display_name` between any two model training. - class AnnotationPayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_spec.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_spec.rb deleted file mode 100644 index 942cbd6b09ad..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/annotation_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # A definition of an annotation spec. - # @!attribute [rw] name - # @return [::String] - # Output only. Resource name of the annotation spec. - # Form: - # 'projects/\\{project_id}/locations/\\{location_id}/datasets/\\{dataset_id}/annotationSpecs/\\{annotation_spec_id}' - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of the annotation spec to show in the interface. The name can be - # up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. - # @!attribute [rw] example_count - # @return [::Integer] - # Output only. The number of examples in the parent dataset - # labeled by the annotation spec. - class AnnotationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/classification.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/classification.rb deleted file mode 100644 index 9044a0c41bef..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/classification.rb +++ /dev/null @@ -1,189 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Contains annotation details specific to classification. - # @!attribute [rw] score - # @return [::Float] - # Output only. A confidence estimate between 0.0 and 1.0. A higher value - # means greater confidence that the annotation is positive. If a user - # approves an annotation as negative or positive, the score value remains - # unchanged. If a user creates an annotation, the score is 0 for negative or - # 1 for positive. - class ClassificationAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model evaluation metrics for classification problems. - # Note: For Video Classification this metrics only describe quality of the - # Video Classification predictions of "segment_classification" type. - # @!attribute [rw] au_prc - # @return [::Float] - # Output only. The Area Under Precision-Recall Curve metric. Micro-averaged - # for the overall evaluation. - # @!attribute [rw] au_roc - # @return [::Float] - # Output only. The Area Under Receiver Operating Characteristic curve metric. - # Micro-averaged for the overall evaluation. - # @!attribute [rw] log_loss - # @return [::Float] - # Output only. The Log Loss metric. - # @!attribute [rw] confidence_metrics_entry - # @return [::Array<::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfidenceMetricsEntry>] - # Output only. Metrics for each confidence_threshold in - # 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and - # position_threshold = INT32_MAX_VALUE. - # ROC and precision-recall curves, and other aggregated metrics are derived - # from them. The confidence metrics entries may also be supplied for - # additional values of position_threshold, but from these no aggregated - # metrics are computed. - # @!attribute [rw] confusion_matrix - # @return [::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfusionMatrix] - # Output only. Confusion matrix of the evaluation. - # Only set for MULTICLASS classification problems where number - # of labels is no more than 10. - # Only set for model level evaluation, not for evaluation per label. - # @!attribute [rw] annotation_spec_id - # @return [::Array<::String>] - # Output only. The annotation spec ids used for this evaluation. - class ClassificationEvaluationMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metrics for a single confidence threshold. - # @!attribute [rw] confidence_threshold - # @return [::Float] - # Output only. Metrics are computed with an assumption that the model - # never returns predictions with score lower than this value. - # @!attribute [rw] position_threshold - # @return [::Integer] - # Output only. Metrics are computed with an assumption that the model - # always returns at most this many predictions (ordered by their score, - # descendingly), but they all still need to meet the confidence_threshold. - # @!attribute [rw] recall - # @return [::Float] - # Output only. Recall (True Positive Rate) for the given confidence - # threshold. - # @!attribute [rw] precision - # @return [::Float] - # Output only. Precision for the given confidence threshold. - # @!attribute [rw] false_positive_rate - # @return [::Float] - # Output only. False Positive Rate for the given confidence threshold. - # @!attribute [rw] f1_score - # @return [::Float] - # Output only. The harmonic mean of recall and precision. - # @!attribute [rw] recall_at1 - # @return [::Float] - # Output only. The Recall (True Positive Rate) when only considering the - # label that has the highest prediction score and not below the confidence - # threshold for each example. - # @!attribute [rw] precision_at1 - # @return [::Float] - # Output only. The precision when only considering the label that has the - # highest prediction score and not below the confidence threshold for each - # example. - # @!attribute [rw] false_positive_rate_at1 - # @return [::Float] - # Output only. The False Positive Rate when only considering the label that - # has the highest prediction score and not below the confidence threshold - # for each example. - # @!attribute [rw] f1_score_at1 - # @return [::Float] - # Output only. The harmonic mean of {::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfidenceMetricsEntry#recall_at1 recall_at1} and {::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfidenceMetricsEntry#precision_at1 precision_at1}. - # @!attribute [rw] true_positive_count - # @return [::Integer] - # Output only. The number of model created labels that match a ground truth - # label. - # @!attribute [rw] false_positive_count - # @return [::Integer] - # Output only. The number of model created labels that do not match a - # ground truth label. - # @!attribute [rw] false_negative_count - # @return [::Integer] - # Output only. The number of ground truth labels that are not matched - # by a model created label. - # @!attribute [rw] true_negative_count - # @return [::Integer] - # Output only. The number of labels that were not created by the model, - # but if they would, they would not match a ground truth label. - class ConfidenceMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Confusion matrix of the model running the classification. - # @!attribute [rw] annotation_spec_id - # @return [::Array<::String>] - # Output only. IDs of the annotation specs used in the confusion matrix. - # For Tables CLASSIFICATION - # [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] - # only list of [annotation_spec_display_name-s][] is populated. - # @!attribute [rw] display_name - # @return [::Array<::String>] - # Output only. Display name of the annotation specs used in the confusion - # matrix, as they were at the moment of the evaluation. For Tables - # CLASSIFICATION - # [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], - # distinct values of the target column at the moment of the model - # evaluation are populated here. - # @!attribute [rw] row - # @return [::Array<::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfusionMatrix::Row>] - # Output only. Rows in the confusion matrix. The number of rows is equal to - # the size of `annotation_spec_id`. - # `row[i].example_count[j]` is the number of examples that have ground - # truth of the `annotation_spec_id[i]` and are predicted as - # `annotation_spec_id[j]` by the model being evaluated. - class ConfusionMatrix - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Output only. A row in the confusion matrix. - # @!attribute [rw] example_count - # @return [::Array<::Integer>] - # Output only. Value of the specific cell in the confusion matrix. - # The number of values each row has (i.e. the length of the row) is equal - # to the length of the `annotation_spec_id` field or, if that one is not - # populated, length of the {::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfusionMatrix#display_name display_name} field. - class Row - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Type of the classification problem. - module ClassificationType - # An un-set value of this enum. - CLASSIFICATION_TYPE_UNSPECIFIED = 0 - - # At most one label is allowed per example. - MULTICLASS = 1 - - # Multiple labels are allowed for one example. - MULTILABEL = 2 - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/data_items.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/data_items.rb deleted file mode 100644 index 27054977211d..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/data_items.rb +++ /dev/null @@ -1,202 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # A representation of an image. - # Only images up to 30MB in size are supported. - # @!attribute [rw] image_bytes - # @return [::String] - # Image 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] thumbnail_uri - # @return [::String] - # Output only. HTTP URI to the thumbnail image. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A representation of a text snippet. - # @!attribute [rw] content - # @return [::String] - # Required. The content of the text snippet as a string. Up to 250000 - # characters long. - # @!attribute [rw] mime_type - # @return [::String] - # Optional. The format of {::Google::Cloud::AutoML::V1::TextSnippet#content content}. Currently the only two allowed - # values are "text/html" and "text/plain". If left blank, the format is - # automatically determined from the type of the uploaded {::Google::Cloud::AutoML::V1::TextSnippet#content content}. - # @!attribute [rw] content_uri - # @return [::String] - # Output only. HTTP URI where you can download the content. - class TextSnippet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message that describes dimension of a document. - # @!attribute [rw] unit - # @return [::Google::Cloud::AutoML::V1::DocumentDimensions::DocumentDimensionUnit] - # Unit of the dimension. - # @!attribute [rw] width - # @return [::Float] - # Width value of the document, works together with the unit. - # @!attribute [rw] height - # @return [::Float] - # Height value of the document, works together with the unit. - class DocumentDimensions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Unit of the document dimension. - module DocumentDimensionUnit - # Should not be used. - DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0 - - # Document dimension is measured in inches. - INCH = 1 - - # Document dimension is measured in centimeters. - CENTIMETER = 2 - - # Document dimension is measured in points. 72 points = 1 inch. - POINT = 3 - end - end - - # A structured text document e.g. a PDF. - # @!attribute [rw] input_config - # @return [::Google::Cloud::AutoML::V1::DocumentInputConfig] - # An input config specifying the content of the document. - # @!attribute [rw] document_text - # @return [::Google::Cloud::AutoML::V1::TextSnippet] - # The plain text version of this document. - # @!attribute [rw] layout - # @return [::Array<::Google::Cloud::AutoML::V1::Document::Layout>] - # Describes the layout of the document. - # Sorted by [page_number][]. - # @!attribute [rw] document_dimensions - # @return [::Google::Cloud::AutoML::V1::DocumentDimensions] - # The dimensions of the page in the document. - # @!attribute [rw] page_count - # @return [::Integer] - # Number of pages in the document. - class Document - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the layout information of a {::Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in the document. - # @!attribute [rw] text_segment - # @return [::Google::Cloud::AutoML::V1::TextSegment] - # Text Segment that represents a segment in - # [document_text][google.cloud.automl.v1p1beta.Document.document_text]. - # @!attribute [rw] page_number - # @return [::Integer] - # Page number of the {::Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in the original document, starts - # from 1. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::AutoML::V1::BoundingPoly] - # The position of the {::Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in the page. - # Contains exactly 4 - # [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] - # and they are connected by edges in the order provided, which will - # represent a rectangle parallel to the frame. The - # [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are - # relative to the page. - # Coordinates are based on top-left as point (0,0). - # @!attribute [rw] text_segment_type - # @return [::Google::Cloud::AutoML::V1::Document::Layout::TextSegmentType] - # The type of the {::Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in document. - class Layout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of TextSegment in the context of the original document. - module TextSegmentType - # Should not be used. - TEXT_SEGMENT_TYPE_UNSPECIFIED = 0 - - # The text segment is a token. e.g. word. - TOKEN = 1 - - # The text segment is a paragraph. - PARAGRAPH = 2 - - # The text segment is a form field. - FORM_FIELD = 3 - - # The text segment is the name part of a form field. It will be treated - # as child of another FORM_FIELD TextSegment if its span is subspan of - # another TextSegment with type FORM_FIELD. - FORM_FIELD_NAME = 4 - - # The text segment is the text content part of a form field. It will be - # treated as child of another FORM_FIELD TextSegment if its span is - # subspan of another TextSegment with type FORM_FIELD. - FORM_FIELD_CONTENTS = 5 - - # The text segment is a whole table, including headers, and all rows. - TABLE = 6 - - # The text segment is a table's headers. It will be treated as child of - # another TABLE TextSegment if its span is subspan of another TextSegment - # with type TABLE. - TABLE_HEADER = 7 - - # The text segment is a row in table. It will be treated as child of - # another TABLE TextSegment if its span is subspan of another TextSegment - # with type TABLE. - TABLE_ROW = 8 - - # The text segment is a cell in table. It will be treated as child of - # another TABLE_ROW TextSegment if its span is subspan of another - # TextSegment with type TABLE_ROW. - TABLE_CELL = 9 - end - end - end - - # Example data used for training or prediction. - # @!attribute [rw] image - # @return [::Google::Cloud::AutoML::V1::Image] - # Example image. - # - # Note: The following fields are mutually exclusive: `image`, `text_snippet`, `document`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_snippet - # @return [::Google::Cloud::AutoML::V1::TextSnippet] - # Example text. - # - # Note: The following fields are mutually exclusive: `text_snippet`, `image`, `document`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] document - # @return [::Google::Cloud::AutoML::V1::Document] - # Example document. - # - # Note: The following fields are mutually exclusive: `document`, `image`, `text_snippet`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ExamplePayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/dataset.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/dataset.rb deleted file mode 100644 index afaccfc1a7d1..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/dataset.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # A workspace for solving a single, particular machine learning (ML) problem. - # A workspace contains examples that may be annotated. - # @!attribute [rw] translation_dataset_metadata - # @return [::Google::Cloud::AutoML::V1::TranslationDatasetMetadata] - # Metadata for a dataset used for translation. - # - # Note: The following fields are mutually exclusive: `translation_dataset_metadata`, `image_classification_dataset_metadata`, `text_classification_dataset_metadata`, `image_object_detection_dataset_metadata`, `text_extraction_dataset_metadata`, `text_sentiment_dataset_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_classification_dataset_metadata - # @return [::Google::Cloud::AutoML::V1::ImageClassificationDatasetMetadata] - # Metadata for a dataset used for image classification. - # - # Note: The following fields are mutually exclusive: `image_classification_dataset_metadata`, `translation_dataset_metadata`, `text_classification_dataset_metadata`, `image_object_detection_dataset_metadata`, `text_extraction_dataset_metadata`, `text_sentiment_dataset_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_classification_dataset_metadata - # @return [::Google::Cloud::AutoML::V1::TextClassificationDatasetMetadata] - # Metadata for a dataset used for text classification. - # - # Note: The following fields are mutually exclusive: `text_classification_dataset_metadata`, `translation_dataset_metadata`, `image_classification_dataset_metadata`, `image_object_detection_dataset_metadata`, `text_extraction_dataset_metadata`, `text_sentiment_dataset_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_object_detection_dataset_metadata - # @return [::Google::Cloud::AutoML::V1::ImageObjectDetectionDatasetMetadata] - # Metadata for a dataset used for image object detection. - # - # Note: The following fields are mutually exclusive: `image_object_detection_dataset_metadata`, `translation_dataset_metadata`, `image_classification_dataset_metadata`, `text_classification_dataset_metadata`, `text_extraction_dataset_metadata`, `text_sentiment_dataset_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_extraction_dataset_metadata - # @return [::Google::Cloud::AutoML::V1::TextExtractionDatasetMetadata] - # Metadata for a dataset used for text extraction. - # - # Note: The following fields are mutually exclusive: `text_extraction_dataset_metadata`, `translation_dataset_metadata`, `image_classification_dataset_metadata`, `text_classification_dataset_metadata`, `image_object_detection_dataset_metadata`, `text_sentiment_dataset_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_sentiment_dataset_metadata - # @return [::Google::Cloud::AutoML::V1::TextSentimentDatasetMetadata] - # Metadata for a dataset used for text sentiment. - # - # Note: The following fields are mutually exclusive: `text_sentiment_dataset_metadata`, `translation_dataset_metadata`, `image_classification_dataset_metadata`, `text_classification_dataset_metadata`, `image_object_detection_dataset_metadata`, `text_extraction_dataset_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Output only. The resource name of the dataset. - # Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of the dataset to show in the interface. The name can be - # up to 32 characters long and can consist only of ASCII Latin letters A-Z - # and a-z, underscores - # (_), and ASCII digits 0-9. - # @!attribute [rw] description - # @return [::String] - # User-provided description of the dataset. The description can be up to - # 25000 characters long. - # @!attribute [rw] example_count - # @return [::Integer] - # Output only. The number of examples in the dataset. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this dataset was created. - # @!attribute [rw] etag - # @return [::String] - # Used to perform consistent read-modify-write updates. If not set, a blind - # "overwrite" update happens. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata to organize your dataset. - # - # Label keys and values can be no longer than 64 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - class Dataset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/detection.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/detection.rb deleted file mode 100644 index 3a1323a1c88d..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/detection.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Annotation details for image object detection. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::AutoML::V1::BoundingPoly] - # Output only. The rectangle representing the object location. - # @!attribute [rw] score - # @return [::Float] - # Output only. The confidence that this annotation is positive for the parent example, - # value in [0, 1], higher means higher positivity confidence. - class ImageObjectDetectionAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Bounding box matching model metrics for a single intersection-over-union - # threshold and multiple label match confidence thresholds. - # @!attribute [rw] iou_threshold - # @return [::Float] - # Output only. The intersection-over-union threshold value used to compute - # this metrics entry. - # @!attribute [rw] mean_average_precision - # @return [::Float] - # Output only. The mean average precision, most often close to au_prc. - # @!attribute [rw] confidence_metrics_entries - # @return [::Array<::Google::Cloud::AutoML::V1::BoundingBoxMetricsEntry::ConfidenceMetricsEntry>] - # Output only. Metrics for each label-match confidence_threshold from - # 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is - # derived from them. - class BoundingBoxMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metrics for a single confidence threshold. - # @!attribute [rw] confidence_threshold - # @return [::Float] - # Output only. The confidence threshold value used to compute the metrics. - # @!attribute [rw] recall - # @return [::Float] - # Output only. Recall under the given confidence threshold. - # @!attribute [rw] precision - # @return [::Float] - # Output only. Precision under the given confidence threshold. - # @!attribute [rw] f1_score - # @return [::Float] - # Output only. The harmonic mean of recall and precision. - class ConfidenceMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Model evaluation metrics for image object detection problems. - # Evaluates prediction quality of labeled bounding boxes. - # @!attribute [rw] evaluated_bounding_box_count - # @return [::Integer] - # Output only. The total number of bounding boxes (i.e. summed over all - # images) the ground truth used to create this evaluation had. - # @!attribute [rw] bounding_box_metrics_entries - # @return [::Array<::Google::Cloud::AutoML::V1::BoundingBoxMetricsEntry>] - # Output only. The bounding boxes match metrics for each - # Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 - # and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 - # pair. - # @!attribute [rw] bounding_box_mean_average_precision - # @return [::Float] - # Output only. The single metric for bounding boxes evaluation: - # the mean_average_precision averaged over all bounding_box_metrics_entries. - class ImageObjectDetectionEvaluationMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/geometry.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/geometry.rb deleted file mode 100644 index 74a562769bfa..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/geometry.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # A vertex represents a 2D point in the image. - # The normalized vertex coordinates are between 0 to 1 fractions relative to - # the original plane (image, video). E.g. if the plane (e.g. whole image) would - # have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would - # be at the position (1, 6) on that plane. - # @!attribute [rw] x - # @return [::Float] - # Required. Horizontal coordinate. - # @!attribute [rw] y - # @return [::Float] - # Required. Vertical coordinate. - class NormalizedVertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A bounding polygon of a detected object on a plane. - # On output both vertices and normalized_vertices are provided. - # The polygon is formed by connecting vertices in the order they are listed. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::AutoML::V1::NormalizedVertex>] - # Output only . The bounding polygon normalized vertices. - class BoundingPoly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/image.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/image.rb deleted file mode 100644 index 4e520cdd2e8b..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/image.rb +++ /dev/null @@ -1,215 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Dataset metadata that is specific to image classification. - # @!attribute [rw] classification_type - # @return [::Google::Cloud::AutoML::V1::ClassificationType] - # Required. Type of the classification problem. - class ImageClassificationDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dataset metadata specific to image object detection. - class ImageObjectDetectionDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model metadata for image classification. - # @!attribute [rw] base_model_id - # @return [::String] - # Optional. The ID of the `base` model. If it is specified, the new model - # will be created based on the `base` model. Otherwise, the new model will be - # created from scratch. The `base` model must be in the same - # `project` and `location` as the new model to create, and have the same - # `model_type`. - # @!attribute [rw] train_budget_milli_node_hours - # @return [::Integer] - # Optional. The train budget of creating this model, expressed in milli node - # hours i.e. 1,000 value in this field means 1 node hour. The actual - # `train_cost` will be equal or less than this value. If further model - # training ceases to provide any improvements, it will stop without using - # full budget and the stop_reason will be `MODEL_CONVERGED`. - # Note, node_hour = actual_hour * number_of_nodes_invovled. - # For model type `cloud`(default), the train budget must be between 8,000 - # and 800,000 milli node hours, inclusive. The default value is 192, 000 - # which represents one day in wall time. For model type - # `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, - # `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, - # `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 - # and 100,000 milli node hours, inclusive. The default value is 24, 000 which - # represents one day in wall time. - # @!attribute [r] train_cost_milli_node_hours - # @return [::Integer] - # Output only. The actual train cost of creating this model, expressed in - # milli node hours, i.e. 1,000 value in this field means 1 node hour. - # Guaranteed to not exceed the train budget. - # @!attribute [r] stop_reason - # @return [::String] - # Output only. The reason that this create model operation stopped, - # e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. - # @!attribute [rw] model_type - # @return [::String] - # Optional. Type of the model. The available values are: - # * `cloud` - Model to be used via prediction calls to AutoML API. - # This is the default value. - # * `mobile-low-latency-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile or edge device - # with TensorFlow afterwards. Expected to have low latency, but - # may have lower prediction quality than other models. - # * `mobile-versatile-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile or edge device - # with TensorFlow afterwards. - # * `mobile-high-accuracy-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile or edge device - # with TensorFlow afterwards. Expected to have a higher - # latency, but should also have a higher prediction quality - # than other models. - # * `mobile-core-ml-low-latency-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile device with Core - # ML afterwards. Expected to have low latency, but may have - # lower prediction quality than other models. - # * `mobile-core-ml-versatile-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile device with Core - # ML afterwards. - # * `mobile-core-ml-high-accuracy-1` - A model that, in addition to - # providing prediction via AutoML API, can also be exported - # (see {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile device with - # Core ML afterwards. Expected to have a higher latency, but - # should also have a higher prediction quality than other - # models. - # @!attribute [r] node_qps - # @return [::Float] - # Output only. An approximate number of online prediction QPS that can - # be supported by this model per each node on which it is deployed. - # @!attribute [r] node_count - # @return [::Integer] - # Output only. The number of nodes this model is deployed on. A node is an - # abstraction of a machine resource, which can handle online prediction QPS - # as given in the node_qps field. - class ImageClassificationModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model metadata specific to image object detection. - # @!attribute [rw] model_type - # @return [::String] - # Optional. Type of the model. The available values are: - # * `cloud-high-accuracy-1` - (default) A model to be used via prediction - # calls to AutoML API. Expected to have a higher latency, but - # should also have a higher prediction quality than other - # models. - # * `cloud-low-latency-1` - A model to be used via prediction - # calls to AutoML API. Expected to have low latency, but may - # have lower prediction quality than other models. - # * `mobile-low-latency-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile or edge device - # with TensorFlow afterwards. Expected to have low latency, but - # may have lower prediction quality than other models. - # * `mobile-versatile-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile or edge device - # with TensorFlow afterwards. - # * `mobile-high-accuracy-1` - A model that, in addition to providing - # prediction via AutoML API, can also be exported (see - # {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}) and used on a mobile or edge device - # with TensorFlow afterwards. Expected to have a higher - # latency, but should also have a higher prediction quality - # than other models. - # @!attribute [r] node_count - # @return [::Integer] - # Output only. The number of nodes this model is deployed on. A node is an - # abstraction of a machine resource, which can handle online prediction QPS - # as given in the qps_per_node field. - # @!attribute [r] node_qps - # @return [::Float] - # Output only. An approximate number of online prediction QPS that can - # be supported by this model per each node on which it is deployed. - # @!attribute [r] stop_reason - # @return [::String] - # Output only. The reason that this create model operation stopped, - # e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. - # @!attribute [rw] train_budget_milli_node_hours - # @return [::Integer] - # Optional. The train budget of creating this model, expressed in milli node - # hours i.e. 1,000 value in this field means 1 node hour. The actual - # `train_cost` will be equal or less than this value. If further model - # training ceases to provide any improvements, it will stop without using - # full budget and the stop_reason will be `MODEL_CONVERGED`. - # Note, node_hour = actual_hour * number_of_nodes_invovled. - # For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - # the train budget must be between 20,000 and 900,000 milli node hours, - # inclusive. The default value is 216, 000 which represents one day in - # wall time. - # For model type `mobile-low-latency-1`, `mobile-versatile-1`, - # `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, - # `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train - # budget must be between 1,000 and 100,000 milli node hours, inclusive. - # The default value is 24, 000 which represents one day in wall time. - # @!attribute [r] train_cost_milli_node_hours - # @return [::Integer] - # Output only. The actual train cost of creating this model, expressed in - # milli node hours, i.e. 1,000 value in this field means 1 node hour. - # Guaranteed to not exceed the train budget. - class ImageObjectDetectionModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model deployment metadata specific to Image Classification. - # @!attribute [rw] node_count - # @return [::Integer] - # Input only. The number of nodes to deploy the model on. A node is an - # abstraction of a machine resource, which can handle online prediction QPS - # as given in the model's - # {::Google::Cloud::AutoML::V1::ImageClassificationModelMetadata#node_qps node_qps}. - # Must be between 1 and 100, inclusive on both ends. - class ImageClassificationModelDeploymentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model deployment metadata specific to Image Object Detection. - # @!attribute [rw] node_count - # @return [::Integer] - # Input only. The number of nodes to deploy the model on. A node is an - # abstraction of a machine resource, which can handle online prediction QPS - # as given in the model's - # [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. - # Must be between 1 and 100, inclusive on both ends. - class ImageObjectDetectionModelDeploymentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/io.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/io.rb deleted file mode 100644 index 374a8f62bc10..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/io.rb +++ /dev/null @@ -1,1345 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Input configuration for - # {::Google::Cloud::AutoML::V1::AutoML::Client#import_data AutoMl.ImportData} action. - # - # The format of input depends on dataset_metadata the Dataset into which - # the import is happening has. As input source the - # {::Google::Cloud::AutoML::V1::InputConfig#gcs_source gcs_source} - # is expected, unless specified otherwise. Additionally any input .CSV file - # by itself must be 100MB or smaller, unless specified otherwise. - # If an "example" file (that is, image, video etc.) with identical content - # (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then - # its label, bounding boxes etc. are appended. The same file should be always - # provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then - # these values are nondeterministically selected from the given ones. - # - # The formats are represented in EBNF with commas being literal and with - # non-terminal symbols defined near the end of this comment. The formats are: - # - # #### AutoML Vision - # - # - # ##### Classification - # - # See [Preparing your training - # data](https://cloud.google.com/vision/automl/docs/prepare) for more - # information. - # - # CSV file(s) with each line in format: - # - # ML_USE,GCS_FILE_PATH,LABEL,LABEL,... - # - # * `ML_USE` - Identifies the data set that the current row (file) applies - # to. - # This value can be one of the following: - # * `TRAIN` - Rows in this file are used to train the model. - # * `TEST` - Rows in this file are used to test the model during training. - # * `UNASSIGNED` - Rows in this file are not categorized. They are - # Automatically divided into train and test data. 80% for training and - # 20% for testing. - # - # * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to - # 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, - # .TIFF, .ICO. - # - # * `LABEL` - A label that identifies the object in the image. - # - # For the `MULTICLASS` classification type, at most one `LABEL` is allowed - # per image. If an image has not yet been labeled, then it should be - # mentioned just once with no `LABEL`. - # - # Some sample rows: - # - # TRAIN,gs://folder/image1.jpg,daisy - # TEST,gs://folder/image2.jpg,dandelion,tulip,rose - # UNASSIGNED,gs://folder/image3.jpg,daisy - # UNASSIGNED,gs://folder/image4.jpg - # - # - # ##### Object Detection - # See [Preparing your training - # data](https://cloud.google.com/vision/automl/object-detection/docs/prepare) - # for more information. - # - # A CSV file(s) with each line in format: - # - # ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) - # - # * `ML_USE` - Identifies the data set that the current row (file) applies - # to. - # This value can be one of the following: - # * `TRAIN` - Rows in this file are used to train the model. - # * `TEST` - Rows in this file are used to test the model during training. - # * `UNASSIGNED` - Rows in this file are not categorized. They are - # Automatically divided into train and test data. 80% for training and - # 20% for testing. - # - # * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to - # 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image - # is assumed to be exhaustively labeled. - # - # * `LABEL` - A label that identifies the object in the image specified by the - # `BOUNDING_BOX`. - # - # * `BOUNDING BOX` - The vertices of an object in the example image. - # The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than - # 500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX` - # per line). If an image has no looked for objects then it should be - # mentioned just once with no LABEL and the ",,,,,,," in place of the - # `BOUNDING_BOX`. - # - # **Four sample rows:** - # - # TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, - # TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, - # UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 - # TEST,gs://folder/im3.png,,,,,,,,, - # - # - # - # - # #### AutoML Video Intelligence - # - # - # ##### Classification - # - # See [Preparing your training - # data](https://cloud.google.com/video-intelligence/automl/docs/prepare) for - # more information. - # - # CSV file(s) with each line in format: - # - # ML_USE,GCS_FILE_PATH - # - # For `ML_USE`, do not use `VALIDATE`. - # - # `GCS_FILE_PATH` is the path to another .csv file that describes training - # example for a given `ML_USE`, using the following row format: - # - # GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,) - # - # Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up - # to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. - # - # `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the - # length of the video, and the end time must be after the start time. Any - # segment of a video which has one or more labels on it, is considered a - # hard negative for all other labels. Any segment with no labels on - # it is considered to be unknown. If a whole video is unknown, then - # it should be mentioned just once with ",," in place of `LABEL, - # TIME_SEGMENT_START,TIME_SEGMENT_END`. - # - # Sample top level CSV file: - # - # TRAIN,gs://folder/train_videos.csv - # TEST,gs://folder/test_videos.csv - # UNASSIGNED,gs://folder/other_videos.csv - # - # Sample rows of a CSV file for a particular ML_USE: - # - # gs://folder/video1.avi,car,120,180.000021 - # gs://folder/video1.avi,bike,150,180.000021 - # gs://folder/vid2.avi,car,0,60.5 - # gs://folder/vid3.avi,,, - # - # - # - # ##### Object Tracking - # - # See [Preparing your training - # data](/video-intelligence/automl/object-tracking/docs/prepare) for more - # information. - # - # CSV file(s) with each line in format: - # - # ML_USE,GCS_FILE_PATH - # - # For `ML_USE`, do not use `VALIDATE`. - # - # `GCS_FILE_PATH` is the path to another .csv file that describes training - # example for a given `ML_USE`, using the following row format: - # - # GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX - # - # or - # - # GCS_FILE_PATH,,,,,,,,,, - # - # Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up - # to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. - # Providing `INSTANCE_ID`s can help to obtain a better model. When - # a specific labeled entity leaves the video frame, and shows up - # afterwards it is not required, albeit preferable, that the same - # `INSTANCE_ID` is given to it. - # - # `TIMESTAMP` must be within the length of the video, the - # `BOUNDING_BOX` is assumed to be drawn on the closest video's frame - # to the `TIMESTAMP`. Any mentioned by the `TIMESTAMP` frame is expected - # to be exhaustively labeled and no more than 500 `BOUNDING_BOX`-es per - # frame are allowed. If a whole video is unknown, then it should be - # mentioned just once with ",,,,,,,,,," in place of `LABEL, - # [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX`. - # - # Sample top level CSV file: - # - # TRAIN,gs://folder/train_videos.csv - # TEST,gs://folder/test_videos.csv - # UNASSIGNED,gs://folder/other_videos.csv - # - # Seven sample rows of a CSV file for a particular ML_USE: - # - # gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9 - # gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9 - # gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3 - # gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,, - # gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,, - # gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, - # gs://folder/video2.avi,,,,,,,,,,, - # - # - # #### AutoML Natural Language - # - # - # ##### Entity Extraction - # - # See [Preparing your training - # data](/natural-language/automl/entity-analysis/docs/prepare) for more - # information. - # - # One or more CSV file(s) with each line in the following format: - # - # ML_USE,GCS_FILE_PATH - # - # * `ML_USE` - Identifies the data set that the current row (file) applies - # to. - # This value can be one of the following: - # * `TRAIN` - Rows in this file are used to train the model. - # * `TEST` - Rows in this file are used to test the model during training. - # * `UNASSIGNED` - Rows in this file are not categorized. They are - # Automatically divided into train and test data. 80% for training and - # 20% for testing.. - # - # * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in - # Google Cloud Storage that contains in-line text in-line as documents - # for model training. - # - # After the training data set has been determined from the `TRAIN` and - # `UNASSIGNED` CSV files, the training data is divided into train and - # validation data sets. 70% for training and 30% for validation. - # - # For example: - # - # TRAIN,gs://folder/file1.jsonl - # VALIDATE,gs://folder/file2.jsonl - # TEST,gs://folder/file3.jsonl - # - # **In-line JSONL files** - # - # In-line .JSONL files contain, per line, a JSON document that wraps a - # {::Google::Cloud::AutoML::V1::TextSnippet `text_snippet`} field followed by - # one or more {::Google::Cloud::AutoML::V1::AnnotationPayload `annotations`} - # fields, which have `display_name` and `text_extraction` fields to describe - # the entity from the text snippet. Multiple JSON documents can be separated - # using line breaks (\n). - # - # The supplied text must be annotated exhaustively. For example, if you - # include the text "horse", but do not label it as "animal", - # then "horse" is assumed to not be an "animal". - # - # Any given text snippet content must have 30,000 characters or - # less, and also be UTF-8 NFC encoded. ASCII is accepted as it is - # UTF-8 NFC encoded. - # - # For example: - # - # { - # "text_snippet": { - # "content": "dog car cat" - # }, - # "annotations": [ - # { - # "display_name": "animal", - # "text_extraction": { - # "text_segment": {"start_offset": 0, "end_offset": 2} - # } - # }, - # { - # "display_name": "vehicle", - # "text_extraction": { - # "text_segment": {"start_offset": 4, "end_offset": 6} - # } - # }, - # { - # "display_name": "animal", - # "text_extraction": { - # "text_segment": {"start_offset": 8, "end_offset": 10} - # } - # } - # ] - # }\n - # { - # "text_snippet": { - # "content": "This dog is good." - # }, - # "annotations": [ - # { - # "display_name": "animal", - # "text_extraction": { - # "text_segment": {"start_offset": 5, "end_offset": 7} - # } - # } - # ] - # } - # - # **JSONL files that reference documents** - # - # .JSONL files contain, per line, a JSON document that wraps a - # `input_config` that contains the path to a source document. - # Multiple JSON documents can be separated using line breaks (\n). - # - # Supported document extensions: .PDF, .TIF, .TIFF - # - # For example: - # - # { - # "document": { - # "input_config": { - # "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] - # } - # } - # } - # }\n - # { - # "document": { - # "input_config": { - # "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] - # } - # } - # } - # } - # - # **In-line JSONL files with document layout information** - # - # **Note:** You can only annotate documents using the UI. The format described - # below applies to annotated documents exported using the UI or `exportData`. - # - # In-line .JSONL files for documents contain, per line, a JSON document - # that wraps a `document` field that provides the textual content of the - # document and the layout information. - # - # For example: - # - # { - # "document": { - # "document_text": { - # "content": "dog car cat" - # } - # "layout": [ - # { - # "text_segment": { - # "start_offset": 0, - # "end_offset": 11, - # }, - # "page_number": 1, - # "bounding_poly": { - # "normalized_vertices": [ - # {"x": 0.1, "y": 0.1}, - # {"x": 0.1, "y": 0.3}, - # {"x": 0.3, "y": 0.3}, - # {"x": 0.3, "y": 0.1}, - # ], - # }, - # "text_segment_type": TOKEN, - # } - # ], - # "document_dimensions": { - # "width": 8.27, - # "height": 11.69, - # "unit": INCH, - # } - # "page_count": 3, - # }, - # "annotations": [ - # { - # "display_name": "animal", - # "text_extraction": { - # "text_segment": {"start_offset": 0, "end_offset": 3} - # } - # }, - # { - # "display_name": "vehicle", - # "text_extraction": { - # "text_segment": {"start_offset": 4, "end_offset": 7} - # } - # }, - # { - # "display_name": "animal", - # "text_extraction": { - # "text_segment": {"start_offset": 8, "end_offset": 11} - # } - # }, - # ], - # - # - # - # - # ##### Classification - # - # See [Preparing your training - # data](https://cloud.google.com/natural-language/automl/docs/prepare) for more - # information. - # - # One or more CSV file(s) with each line in the following format: - # - # ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... - # - # * `ML_USE` - Identifies the data set that the current row (file) applies - # to. - # This value can be one of the following: - # * `TRAIN` - Rows in this file are used to train the model. - # * `TEST` - Rows in this file are used to test the model during training. - # * `UNASSIGNED` - Rows in this file are not categorized. They are - # Automatically divided into train and test data. 80% for training and - # 20% for testing. - # - # * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If - # the column content is a valid Google Cloud Storage file path, that is, - # prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if - # the content is enclosed in double quotes (""), it is treated as a - # `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a - # file with supported extension and UTF-8 encoding, for example, - # "gs://folder/content.txt" AutoML imports the file content - # as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content - # excluding quotes. In both cases, size of the content must be 10MB or - # less in size. For zip files, the size of each file inside the zip must be - # 10MB or less in size. - # - # For the `MULTICLASS` classification type, at most one `LABEL` is allowed. - # - # The `ML_USE` and `LABEL` columns are optional. - # Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP - # - # A maximum of 100 unique labels are allowed per CSV row. - # - # Sample rows: - # - # TRAIN,"They have bad food and very rude",RudeService,BadFood - # gs://folder/content.txt,SlowService - # TEST,gs://folder/document.pdf - # VALIDATE,gs://folder/text_files.zip,BadFood - # - # - # - # ##### Sentiment Analysis - # - # See [Preparing your training - # data](https://cloud.google.com/natural-language/automl/docs/prepare) for more - # information. - # - # CSV file(s) with each line in format: - # - # ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT - # - # * `ML_USE` - Identifies the data set that the current row (file) applies - # to. - # This value can be one of the following: - # * `TRAIN` - Rows in this file are used to train the model. - # * `TEST` - Rows in this file are used to test the model during training. - # * `UNASSIGNED` - Rows in this file are not categorized. They are - # Automatically divided into train and test data. 80% for training and - # 20% for testing. - # - # * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If - # the column content is a valid Google Cloud Storage file path, that is, - # prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if - # the content is enclosed in double quotes (""), it is treated as a - # `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a - # file with supported extension and UTF-8 encoding, for example, - # "gs://folder/content.txt" AutoML imports the file content - # as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content - # excluding quotes. In both cases, size of the content must be 128kB or - # less in size. For zip files, the size of each file inside the zip must be - # 128kB or less in size. - # - # The `ML_USE` and `SENTIMENT` columns are optional. - # Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP - # - # * `SENTIMENT` - An integer between 0 and - # Dataset.text_sentiment_dataset_metadata.sentiment_max - # (inclusive). Describes the ordinal of the sentiment - higher - # value means a more positive sentiment. All the values are - # completely relative, i.e. neither 0 needs to mean a negative or - # neutral sentiment nor sentiment_max needs to mean a positive one - - # it is just required that 0 is the least positive sentiment - # in the data, and sentiment_max is the most positive one. - # The SENTIMENT shouldn't be confused with "score" or "magnitude" - # from the previous Natural Language Sentiment Analysis API. - # All SENTIMENT values between 0 and sentiment_max must be - # represented in the imported data. On prediction the same 0 to - # sentiment_max range will be used. The difference between - # neighboring sentiment values needs not to be uniform, e.g. 1 and - # 2 may be similar whereas the difference between 2 and 3 may be - # large. - # - # Sample rows: - # - # TRAIN,"@freewrytin this is way too good for your product",2 - # gs://folder/content.txt,3 - # TEST,gs://folder/document.pdf - # VALIDATE,gs://folder/text_files.zip,2 - # - # - # - # #### AutoML Tables - # - # See [Preparing your training - # data](https://cloud.google.com/automl-tables/docs/prepare) for more - # information. - # - # You can use either - # {::Google::Cloud::AutoML::V1::InputConfig#gcs_source gcs_source} or - # [bigquery_source][google.cloud.automl.v1.InputConfig.bigquery_source]. - # All input is concatenated into a - # single - # [primary_table_spec_id][google.cloud.automl.v1.TablesDatasetMetadata.primary_table_spec_id] - # - # **For gcs_source:** - # - # CSV file(s), where the first row of the first file is the header, - # containing unique column names. If the first row of a subsequent - # file is the same as the header, then it is also treated as a - # header. All other rows contain values for the corresponding - # columns. - # - # Each .CSV file by itself must be 10GB or smaller, and their total - # size must be 100GB or smaller. - # - # First three sample rows of a CSV file: - #
-        # "Id","First Name","Last Name","Dob","Addresses"
-        # "1","John","Doe","1968-01-22","[\\{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},\\{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
-        # "2","Jane","Doe","1980-10-16","[\\{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},\\{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
-        # 
- # **For bigquery_source:** - # - # An URI of a BigQuery table. The user data size of the BigQuery - # table must be 100GB or smaller. - # - # An imported table must have between 2 and 1,000 columns, inclusive, - # and between 1000 and 100,000,000 rows, inclusive. There are at most 5 - # import data running in parallel. - # - # - # - # **Input field definitions:** - # - # `ML_USE` - # : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") - # Describes how the given example (file) should be used for model - # training. "UNASSIGNED" can be used when user has no preference. - # - # `GCS_FILE_PATH` - # : The path to a file on Google Cloud Storage. For example, - # "gs://folder/image1.png". - # - # `LABEL` - # : A display name of an object on an image, video etc., e.g. "dog". - # Must be up to 32 characters long and can consist only of ASCII - # Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. - # For each label an AnnotationSpec is created which display_name - # becomes the label; AnnotationSpecs are given back in predictions. - # - # `INSTANCE_ID` - # : A positive integer that identifies a specific instance of a - # labeled entity on an example. Used e.g. to track two cars on - # a video while being able to tell apart which one is which. - # - # `BOUNDING_BOX` - # : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) - # A rectangle parallel to the frame of the example (image, - # video). If 4 vertices are given they are connected by edges - # in the order provided, if 2 are given they are recognized - # as diagonally opposite vertices of the rectangle. - # - # `VERTEX` - # : (`COORDINATE,COORDINATE`) - # First coordinate is horizontal (x), the second is vertical (y). - # - # `COORDINATE` - # : A float in 0 to 1 range, relative to total length of - # image or video in given dimension. For fractions the - # leading non-decimal 0 can be omitted (i.e. 0.3 = .3). - # Point 0,0 is in top left. - # - # `TIME_SEGMENT_START` - # : (`TIME_OFFSET`) - # Expresses a beginning, inclusive, of a time segment - # within an example that has a time dimension - # (e.g. video). - # - # `TIME_SEGMENT_END` - # : (`TIME_OFFSET`) - # Expresses an end, exclusive, of a time segment within - # n example that has a time dimension (e.g. video). - # - # `TIME_OFFSET` - # : A number of seconds as measured from the start of an - # example (e.g. video). Fractions are allowed, up to a - # microsecond precision. "inf" is allowed, and it means the end - # of the example. - # - # `TEXT_SNIPPET` - # : The content of a text snippet, UTF-8 encoded, enclosed within - # double quotes (""). - # - # `DOCUMENT` - # : A field that provides the textual content with document and the layout - # information. - # - # - # **Errors:** - # - # If any of the provided CSV files can't be parsed or if more than certain - # percent of CSV rows cannot be processed then the operation fails and - # nothing is imported. Regardless of overall success or failure the per-row - # failures, up to a certain count cap, is listed in - # Operation.metadata.partial_failures. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::AutoML::V1::GcsSource] - # The Google Cloud Storage location for the input content. - # For {::Google::Cloud::AutoML::V1::AutoML::Client#import_data AutoMl.ImportData}, - # `gcs_source` points to a CSV file with a structure described in - # {::Google::Cloud::AutoML::V1::InputConfig InputConfig}. - # @!attribute [rw] params - # @return [::Google::Protobuf::Map{::String => ::String}] - # Additional domain-specific parameters describing the semantic of the - # imported data, any string must be up to 25000 - # characters long. - # - # #### AutoML Tables - # - # `schema_inference_version` - # : (integer) This value must be supplied. - # The version of the - # algorithm to use for the initial inference of the - # column data types of the imported table. Allowed values: "1". - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ParamsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Input configuration for BatchPredict Action. - # - # The format of input depends on the ML problem of the model used for - # prediction. As input source the - # {::Google::Cloud::AutoML::V1::InputConfig#gcs_source gcs_source} - # is expected, unless specified otherwise. - # - # The formats are represented in EBNF with commas being literal and with - # non-terminal symbols defined near the end of this comment. The formats - # are: - # - # #### AutoML Vision - # ##### Classification - # - # One or more CSV files where each line is a single column: - # - # GCS_FILE_PATH - # - # The Google Cloud Storage location of an image of up to - # 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. - # This path is treated as the ID in the batch predict output. - # - # Sample rows: - # - # gs://folder/image1.jpeg - # gs://folder/image2.gif - # gs://folder/image3.png - # - # ##### Object Detection - # - # One or more CSV files where each line is a single column: - # - # GCS_FILE_PATH - # - # The Google Cloud Storage location of an image of up to - # 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. - # This path is treated as the ID in the batch predict output. - # - # Sample rows: - # - # gs://folder/image1.jpeg - # gs://folder/image2.gif - # gs://folder/image3.png - # - # #### AutoML Video Intelligence - # ##### Classification - # - # One or more CSV files where each line is a single column: - # - # GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END - # - # `GCS_FILE_PATH` is the Google Cloud Storage location of video up to 50GB in - # size and up to 3h in duration duration. - # Supported extensions: .MOV, .MPEG4, .MP4, .AVI. - # - # `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the - # length of the video, and the end time must be after the start time. - # - # Sample rows: - # - # gs://folder/video1.mp4,10,40 - # gs://folder/video1.mp4,20,60 - # gs://folder/vid2.mov,0,inf - # - # ##### Object Tracking - # - # One or more CSV files where each line is a single column: - # - # GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END - # - # `GCS_FILE_PATH` is the Google Cloud Storage location of video up to 50GB in - # size and up to 3h in duration duration. - # Supported extensions: .MOV, .MPEG4, .MP4, .AVI. - # - # `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the - # length of the video, and the end time must be after the start time. - # - # Sample rows: - # - # gs://folder/video1.mp4,10,40 - # gs://folder/video1.mp4,20,60 - # gs://folder/vid2.mov,0,inf - # - # #### AutoML Natural Language - # ##### Classification - # - # One or more CSV files where each line is a single column: - # - # GCS_FILE_PATH - # - # `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. - # Supported file extensions: .TXT, .PDF, .TIF, .TIFF - # - # Text files can be no larger than 10MB in size. - # - # Sample rows: - # - # gs://folder/text1.txt - # gs://folder/text2.pdf - # gs://folder/text3.tif - # - # ##### Sentiment Analysis - # One or more CSV files where each line is a single column: - # - # GCS_FILE_PATH - # - # `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. - # Supported file extensions: .TXT, .PDF, .TIF, .TIFF - # - # Text files can be no larger than 128kB in size. - # - # Sample rows: - # - # gs://folder/text1.txt - # gs://folder/text2.pdf - # gs://folder/text3.tif - # - # ##### Entity Extraction - # - # One or more JSONL (JSON Lines) files that either provide inline text or - # documents. You can only use one format, either inline text or documents, - # for a single call to [AutoMl.BatchPredict]. - # - # Each JSONL file contains a per line a proto that - # wraps a temporary user-assigned TextSnippet ID (string up to 2000 - # characters long) called "id", a TextSnippet proto (in - # JSON representation) and zero or more TextFeature protos. Any given - # text snippet content must have 30,000 characters or less, and also - # be UTF-8 NFC encoded (ASCII already is). The IDs provided should be - # unique. - # - # Each document JSONL file contains, per line, a proto that wraps a Document - # proto with `input_config` set. Each document cannot exceed 2MB in size. - # - # Supported document extensions: .PDF, .TIF, .TIFF - # - # Each JSONL file must not exceed 100MB in size, and no more than 20 - # JSONL files may be passed. - # - # Sample inline JSONL file (Shown with artificial line - # breaks. Actual line breaks are denoted by "\n".): - # - # { - # "id": "my_first_id", - # "text_snippet": { "content": "dog car cat"}, - # "text_features": [ - # { - # "text_segment": \\{"start_offset": 4, "end_offset": 6}, - # "structural_type": PARAGRAPH, - # "bounding_poly": { - # "normalized_vertices": [ - # \\{"x": 0.1, "y": 0.1}, - # \\{"x": 0.1, "y": 0.3}, - # \\{"x": 0.3, "y": 0.3}, - # \\{"x": 0.3, "y": 0.1}, - # ] - # }, - # } - # ], - # }\n - # { - # "id": "2", - # "text_snippet": { - # "content": "Extended sample content", - # "mime_type": "text/plain" - # } - # } - # - # Sample document JSONL file (Shown with artificial line - # breaks. Actual line breaks are denoted by "\n".): - # - # { - # "document": { - # "input_config": { - # "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] - # } - # } - # } - # }\n - # { - # "document": { - # "input_config": { - # "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] - # } - # } - # } - # } - # - # #### AutoML Tables - # - # See [Preparing your training - # data](https://cloud.google.com/automl-tables/docs/predict-batch) for more - # information. - # - # You can use either - # {::Google::Cloud::AutoML::V1::BatchPredictInputConfig#gcs_source gcs_source} - # or - # [bigquery_source][BatchPredictInputConfig.bigquery_source]. - # - # **For gcs_source:** - # - # CSV file(s), each by itself 10GB or smaller and total size must be - # 100GB or smaller, where first file must have a header containing - # column names. If the first row of a subsequent file is the same as - # the header, then it is also treated as a header. All other rows - # contain values for the corresponding columns. - # - # The column names must contain the model's - # [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] - # display_name-s - # (order doesn't matter). The columns corresponding to the model's - # input feature column specs must contain values compatible with the - # column spec's data types. Prediction on all the rows, i.e. the CSV - # lines, will be attempted. - # - # - # Sample rows from a CSV file: - #
-        # "First Name","Last Name","Dob","Addresses"
-        # "John","Doe","1968-01-22","[\\{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},\\{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
-        # "Jane","Doe","1980-10-16","[\\{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},\\{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
-        # 
- # **For bigquery_source:** - # - # The URI of a BigQuery table. The user data size of the BigQuery - # table must be 100GB or smaller. - # - # The column names must contain the model's - # [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] - # display_name-s - # (order doesn't matter). The columns corresponding to the model's - # input feature column specs must contain values compatible with the - # column spec's data types. Prediction on all the rows of the table - # will be attempted. - # - # **Input field definitions:** - # - # `GCS_FILE_PATH` - # : The path to a file on Google Cloud Storage. For example, - # "gs://folder/video.avi". - # - # `TIME_SEGMENT_START` - # : (`TIME_OFFSET`) - # Expresses a beginning, inclusive, of a time segment - # within an example that has a time dimension - # (e.g. video). - # - # `TIME_SEGMENT_END` - # : (`TIME_OFFSET`) - # Expresses an end, exclusive, of a time segment within - # n example that has a time dimension (e.g. video). - # - # `TIME_OFFSET` - # : A number of seconds as measured from the start of an - # example (e.g. video). Fractions are allowed, up to a - # microsecond precision. "inf" is allowed, and it means the end - # of the example. - # - # **Errors:** - # - # If any of the provided CSV files can't be parsed or if more than certain - # percent of CSV rows cannot be processed then the operation fails and - # prediction does not happen. Regardless of overall success or failure the - # per-row failures, up to a certain count cap, will be listed in - # Operation.metadata.partial_failures. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::AutoML::V1::GcsSource] - # Required. The Google Cloud Storage location for the input content. - class BatchPredictInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input configuration of a {::Google::Cloud::AutoML::V1::Document Document}. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::AutoML::V1::GcsSource] - # The Google Cloud Storage location of the document file. Only a single path - # should be given. - # - # Max supported size: 512MB. - # - # Supported extensions: .PDF. - class DocumentInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # * For Translation: - # CSV file `translation.csv`, with each line in format: - # ML_USE,GCS_FILE_PATH - # GCS_FILE_PATH leads to a .TSV file which describes examples that have - # given ML_USE, using the following row format per line: - # TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target - # language) - # - # * For Tables: - # Output depends on whether the dataset was imported from Google Cloud - # Storage or BigQuery. - # Google Cloud Storage case: - # [gcs_destination][google.cloud.automl.v1p1beta.OutputConfig.gcs_destination] - # must be set. Exported are CSV file(s) `tables_1.csv`, - # `tables_2.csv`,...,`tables_N.csv` with each having as header line - # the table's column names, and all other lines contain values for - # the header columns. - # BigQuery case: - # [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] - # pointing to a BigQuery project must be set. In the given project a - # new dataset will be created with name - # `export_data__` - # where will be made - # BigQuery-dataset-name compatible (e.g. most special characters will - # become underscores), and timestamp will be in - # YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that - # dataset a new table called `primary_table` will be created, and - # filled with precisely the same data as this obtained on import. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::AutoML::V1::GcsDestination] - # Required. The Google Cloud Storage location where the output is to be - # written to. For Image Object Detection, Text Extraction, Video - # Classification and Tables, in the given directory a new directory will be - # created with name: - # export_data-- where - # timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export - # output will be written into that directory. - class OutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configuration for BatchPredict Action. - # - # As destination the - # {::Google::Cloud::AutoML::V1::BatchPredictOutputConfig#gcs_destination gcs_destination} - # must be set unless specified otherwise for a domain. If gcs_destination is - # set then in the given directory a new directory is created. Its name - # will be - # "prediction--", - # where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents - # of it depends on the ML problem the predictions are made for. - # - # * For Image Classification: - # In the created directory files `image_classification_1.jsonl`, - # `image_classification_2.jsonl`,...,`image_classification_N.jsonl` - # will be created, where N may be 1, and depends on the - # total number of the successfully predicted images and annotations. - # A single image will be listed only once with all its annotations, - # and its annotations will never be split across files. - # Each .JSONL file will contain, per line, a JSON representation of a - # proto that wraps image's "ID" : "" followed by a list of - # zero or more AnnotationPayload protos (called annotations), which - # have classification detail populated. - # If prediction for any image failed (partially or completely), then an - # additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` - # files will be created (N depends on total number of failed - # predictions). These files will have a JSON representation of a proto - # that wraps the same "ID" : "" but here followed by - # exactly one - # [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) - # containing only `code` and `message`fields. - # - # * For Image Object Detection: - # In the created directory files `image_object_detection_1.jsonl`, - # `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl` - # will be created, where N may be 1, and depends on the - # total number of the successfully predicted images and annotations. - # Each .JSONL file will contain, per line, a JSON representation of a - # proto that wraps image's "ID" : "" followed by a list of - # zero or more AnnotationPayload protos (called annotations), which - # have image_object_detection detail populated. A single image will - # be listed only once with all its annotations, and its annotations - # will never be split across files. - # If prediction for any image failed (partially or completely), then - # additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` - # files will be created (N depends on total number of failed - # predictions). These files will have a JSON representation of a proto - # that wraps the same "ID" : "" but here followed by - # exactly one - # [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) - # containing only `code` and `message`fields. - # * For Video Classification: - # In the created directory a video_classification.csv file, and a .JSON - # file per each video classification requested in the input (i.e. each - # line in given CSV(s)), will be created. - # - # The format of video_classification.csv is: - # GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS - # where: - # GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 - # the prediction input lines (i.e. video_classification.csv has - # precisely the same number of lines as the prediction input had.) - # JSON_FILE_NAME = Name of .JSON file in the output directory, which - # contains prediction responses for the video time segment. - # STATUS = "OK" if prediction completed successfully, or an error code - # with message otherwise. If STATUS is not "OK" then the .JSON file - # for that line may not exist or be empty. - # - # Each .JSON file, assuming STATUS is "OK", will contain a list of - # AnnotationPayload protos in JSON format, which are the predictions - # for the video time segment the file is assigned to in the - # video_classification.csv. All AnnotationPayload protos will have - # video_classification field set, and will be sorted by - # video_classification.type field (note that the returned types are - # governed by `classifaction_types` parameter in - # [PredictService.BatchPredictRequest.params][]). - # - # * For Video Object Tracking: - # In the created directory a video_object_tracking.csv file will be - # created, and multiple files video_object_trackinng_1.json, - # video_object_trackinng_2.json,..., video_object_trackinng_N.json, - # where N is the number of requests in the input (i.e. the number of - # lines in given CSV(s)). - # - # The format of video_object_tracking.csv is: - # GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS - # where: - # GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 - # the prediction input lines (i.e. video_object_tracking.csv has - # precisely the same number of lines as the prediction input had.) - # JSON_FILE_NAME = Name of .JSON file in the output directory, which - # contains prediction responses for the video time segment. - # STATUS = "OK" if prediction completed successfully, or an error - # code with message otherwise. If STATUS is not "OK" then the .JSON - # file for that line may not exist or be empty. - # - # Each .JSON file, assuming STATUS is "OK", will contain a list of - # AnnotationPayload protos in JSON format, which are the predictions - # for each frame of the video time segment the file is assigned to in - # video_object_tracking.csv. All AnnotationPayload protos will have - # video_object_tracking field set. - # * For Text Classification: - # In the created directory files `text_classification_1.jsonl`, - # `text_classification_2.jsonl`,...,`text_classification_N.jsonl` - # will be created, where N may be 1, and depends on the - # total number of inputs and annotations found. - # - # Each .JSONL file will contain, per line, a JSON representation of a - # proto that wraps input text file (or document) in - # the text snippet (or document) proto and a list of - # zero or more AnnotationPayload protos (called annotations), which - # have classification detail populated. A single text file (or - # document) will be listed only once with all its annotations, and its - # annotations will never be split across files. - # - # If prediction for any input file (or document) failed (partially or - # completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., - # `errors_N.jsonl` files will be created (N depends on total number of - # failed predictions). These files will have a JSON representation of a - # proto that wraps input file followed by exactly one - # [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) - # containing only `code` and `message`. - # - # * For Text Sentiment: - # In the created directory files `text_sentiment_1.jsonl`, - # `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` - # will be created, where N may be 1, and depends on the - # total number of inputs and annotations found. - # - # Each .JSONL file will contain, per line, a JSON representation of a - # proto that wraps input text file (or document) in - # the text snippet (or document) proto and a list of - # zero or more AnnotationPayload protos (called annotations), which - # have text_sentiment detail populated. A single text file (or - # document) will be listed only once with all its annotations, and its - # annotations will never be split across files. - # - # If prediction for any input file (or document) failed (partially or - # completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., - # `errors_N.jsonl` files will be created (N depends on total number of - # failed predictions). These files will have a JSON representation of a - # proto that wraps input file followed by exactly one - # [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) - # containing only `code` and `message`. - # - # * For Text Extraction: - # In the created directory files `text_extraction_1.jsonl`, - # `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` - # will be created, where N may be 1, and depends on the - # total number of inputs and annotations found. - # The contents of these .JSONL file(s) depend on whether the input - # used inline text, or documents. - # If input was inline, then each .JSONL file will contain, per line, - # a JSON representation of a proto that wraps given in request text - # snippet's "id" (if specified), followed by input text snippet, - # and a list of zero or more - # AnnotationPayload protos (called annotations), which have - # text_extraction detail populated. A single text snippet will be - # listed only once with all its annotations, and its annotations will - # never be split across files. - # If input used documents, then each .JSONL file will contain, per - # line, a JSON representation of a proto that wraps given in request - # document proto, followed by its OCR-ed representation in the form - # of a text snippet, finally followed by a list of zero or more - # AnnotationPayload protos (called annotations), which have - # text_extraction detail populated and refer, via their indices, to - # the OCR-ed text snippet. A single document (and its text snippet) - # will be listed only once with all its annotations, and its - # annotations will never be split across files. - # If prediction for any text snippet failed (partially or completely), - # then additional `errors_1.jsonl`, `errors_2.jsonl`,..., - # `errors_N.jsonl` files will be created (N depends on total number of - # failed predictions). These files will have a JSON representation of a - # proto that wraps either the "id" : "" (in case of inline) - # or the document proto (in case of document) but here followed by - # exactly one - # [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) - # containing only `code` and `message`. - # - # * For Tables: - # Output depends on whether - # [gcs_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.gcs_destination] - # or - # [bigquery_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.bigquery_destination] - # is set (either is allowed). - # Google Cloud Storage case: - # In the created directory files `tables_1.csv`, `tables_2.csv`,..., - # `tables_N.csv` will be created, where N may be 1, and depends on - # the total number of the successfully predicted rows. - # For all CLASSIFICATION - # [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: - # Each .csv file will contain a header, listing all columns' - # [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] - # given on input followed by M target column names in the format of - # "<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] - # [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>__score" where M is the number of distinct target values, - # i.e. number of distinct values in the target column of the table - # used to train the model. Subsequent lines will contain the - # respective values of successfully predicted rows, with the last, - # i.e. the target, columns having the corresponding prediction - # [scores][google.cloud.automl.v1p1beta.TablesAnnotation.score]. - # For REGRESSION and FORECASTING - # [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: - # Each .csv file will contain a header, listing all columns' - # [display_name-s][google.cloud.automl.v1p1beta.display_name] - # given on input followed by the predicted target column with name - # in the format of - # "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] - # [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" - # Subsequent lines will contain the respective values of - # successfully predicted rows, with the last, i.e. the target, - # column having the predicted target value. - # If prediction for any rows failed, then an additional - # `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be - # created (N depends on total number of failed rows). These files - # will have analogous format as `tables_*.csv`, but always with a - # single target column having - # [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) - # represented as a JSON string, and containing only `code` and - # `message`. - # BigQuery case: - # [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] - # pointing to a BigQuery project must be set. In the given project a - # new dataset will be created with name - # `prediction__` - # where will be made - # BigQuery-dataset-name compatible (e.g. most special characters will - # become underscores), and timestamp will be in - # YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset - # two tables will be created, `predictions`, and `errors`. - # The `predictions` table's column names will be the input columns' - # [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] - # followed by the target column with name in the format of - # "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] - # [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" - # The input feature columns will contain the respective values of - # successfully predicted rows, with the target column having an - # ARRAY of - # [AnnotationPayloads][google.cloud.automl.v1p1beta.AnnotationPayload], - # represented as STRUCT-s, containing - # [TablesAnnotation][google.cloud.automl.v1p1beta.TablesAnnotation]. - # The `errors` table contains rows for which the prediction has - # failed, it has analogous input columns while the target column name - # is in the format of - # "errors_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] - # [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>", - # and as a value has - # [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) - # represented as a STRUCT, and containing only `code` and `message`. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::AutoML::V1::GcsDestination] - # Required. The Google Cloud Storage location of the directory where the - # output is to be written to. - class BatchPredictOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configuration for ModelExport Action. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::AutoML::V1::GcsDestination] - # Required. The Google Cloud Storage location where the model is to be - # written to. This location may only be set for the following model - # formats: - # "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". - # - # Under the directory given as the destination a new one with name - # "model-export--", - # where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, - # will be created. Inside the model and any of its supporting files - # will be written. - # @!attribute [rw] model_format - # @return [::String] - # The format in which the model must be exported. The available, and default, - # formats depend on the problem and model type (if given problem and type - # combination doesn't have a format listed, it means its models are not - # exportable): - # - # * For Image Classification mobile-low-latency-1, mobile-versatile-1, - # mobile-high-accuracy-1: - # "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", - # "docker". - # - # * For Image Classification mobile-core-ml-low-latency-1, - # mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: - # "core_ml" (default). - # - # * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, - # mobile-high-accuracy-1: - # "tflite", "tf_saved_model", "tf_js". - # Formats description: - # - # * tflite - Used for Android mobile devices. - # * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) - # devices. - # * tf_saved_model - A tensorflow model in SavedModel format. - # * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can - # be used in the browser and in Node.js using JavaScript. - # * docker - Used for Docker containers. Use the params field to customize - # the container. The container is verified to work correctly on - # ubuntu 16.04 operating system. See more at - # [containers - # quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) - # * core_ml - Used for iOS mobile devices. - # @!attribute [rw] params - # @return [::Google::Protobuf::Map{::String => ::String}] - # Additional model-type and format specific parameters describing the - # requirements for the to be exported model files, any string must be up to - # 25000 characters long. - # - # * For `docker` format: - # `cpu_architecture` - (string) "x86_64" (default). - # `gpu_architecture` - (string) "none" (default), "nvidia". - class ModelExportOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ParamsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The Google Cloud Storage location for the input content. - # @!attribute [rw] input_uris - # @return [::Array<::String>] - # Required. Google Cloud Storage URIs to input files, up to 2000 - # characters long. Accepted forms: - # * Full object path, e.g. gs://bucket/directory/object.csv - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location where the output is to be written to. - # @!attribute [rw] output_uri_prefix - # @return [::String] - # Required. Google Cloud Storage URI to output directory, up to 2000 - # characters long. - # Accepted forms: - # * Prefix path: gs://bucket/directory - # The requesting user must have write permission to the bucket. - # The directory is created if it doesn't exist. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model.rb deleted file mode 100644 index 37165c8fbf69..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # API proto representing a trained machine learning model. - # @!attribute [rw] translation_model_metadata - # @return [::Google::Cloud::AutoML::V1::TranslationModelMetadata] - # Metadata for translation models. - # - # Note: The following fields are mutually exclusive: `translation_model_metadata`, `image_classification_model_metadata`, `text_classification_model_metadata`, `image_object_detection_model_metadata`, `text_extraction_model_metadata`, `text_sentiment_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_classification_model_metadata - # @return [::Google::Cloud::AutoML::V1::ImageClassificationModelMetadata] - # Metadata for image classification models. - # - # Note: The following fields are mutually exclusive: `image_classification_model_metadata`, `translation_model_metadata`, `text_classification_model_metadata`, `image_object_detection_model_metadata`, `text_extraction_model_metadata`, `text_sentiment_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_classification_model_metadata - # @return [::Google::Cloud::AutoML::V1::TextClassificationModelMetadata] - # Metadata for text classification models. - # - # Note: The following fields are mutually exclusive: `text_classification_model_metadata`, `translation_model_metadata`, `image_classification_model_metadata`, `image_object_detection_model_metadata`, `text_extraction_model_metadata`, `text_sentiment_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_object_detection_model_metadata - # @return [::Google::Cloud::AutoML::V1::ImageObjectDetectionModelMetadata] - # Metadata for image object detection models. - # - # Note: The following fields are mutually exclusive: `image_object_detection_model_metadata`, `translation_model_metadata`, `image_classification_model_metadata`, `text_classification_model_metadata`, `text_extraction_model_metadata`, `text_sentiment_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_extraction_model_metadata - # @return [::Google::Cloud::AutoML::V1::TextExtractionModelMetadata] - # Metadata for text extraction models. - # - # Note: The following fields are mutually exclusive: `text_extraction_model_metadata`, `translation_model_metadata`, `image_classification_model_metadata`, `text_classification_model_metadata`, `image_object_detection_model_metadata`, `text_sentiment_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_sentiment_model_metadata - # @return [::Google::Cloud::AutoML::V1::TextSentimentModelMetadata] - # Metadata for text sentiment models. - # - # Note: The following fields are mutually exclusive: `text_sentiment_model_metadata`, `translation_model_metadata`, `image_classification_model_metadata`, `text_classification_model_metadata`, `image_object_detection_model_metadata`, `text_extraction_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Output only. Resource name of the model. - # Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of the model to show in the interface. The name can be - # up to 32 characters long and can consist only of ASCII Latin letters A-Z - # and a-z, underscores - # (_), and ASCII digits 0-9. It must start with a letter. - # @!attribute [rw] dataset_id - # @return [::String] - # Required. The resource ID of the dataset used to create the model. The dataset must - # come from the same ancestor project and location. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the model training finished and can be used for prediction. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this model was last updated. - # @!attribute [rw] deployment_state - # @return [::Google::Cloud::AutoML::V1::Model::DeploymentState] - # Output only. Deployment state of the model. A model can only serve - # prediction requests after it gets deployed. - # @!attribute [rw] etag - # @return [::String] - # Used to perform a consistent read-modify-write updates. If not set, a blind - # "overwrite" update happens. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata to organize your model. - # - # Label keys and values can be no longer than 64 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - class Model - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Deployment state of the model. - module DeploymentState - # Should not be used, an un-set enum has this value by default. - DEPLOYMENT_STATE_UNSPECIFIED = 0 - - # Model is deployed. - DEPLOYED = 1 - - # Model is not deployed. - UNDEPLOYED = 2 - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model_evaluation.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model_evaluation.rb deleted file mode 100644 index 729817ff4233..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/model_evaluation.rb +++ /dev/null @@ -1,100 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Evaluation results of a model. - # @!attribute [rw] classification_evaluation_metrics - # @return [::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics] - # Model evaluation metrics for image, text, video and tables - # classification. - # Tables problem is considered a classification when the target column - # is CATEGORY DataType. - # - # Note: The following fields are mutually exclusive: `classification_evaluation_metrics`, `translation_evaluation_metrics`, `image_object_detection_evaluation_metrics`, `text_sentiment_evaluation_metrics`, `text_extraction_evaluation_metrics`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] translation_evaluation_metrics - # @return [::Google::Cloud::AutoML::V1::TranslationEvaluationMetrics] - # Model evaluation metrics for translation. - # - # Note: The following fields are mutually exclusive: `translation_evaluation_metrics`, `classification_evaluation_metrics`, `image_object_detection_evaluation_metrics`, `text_sentiment_evaluation_metrics`, `text_extraction_evaluation_metrics`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_object_detection_evaluation_metrics - # @return [::Google::Cloud::AutoML::V1::ImageObjectDetectionEvaluationMetrics] - # Model evaluation metrics for image object detection. - # - # Note: The following fields are mutually exclusive: `image_object_detection_evaluation_metrics`, `classification_evaluation_metrics`, `translation_evaluation_metrics`, `text_sentiment_evaluation_metrics`, `text_extraction_evaluation_metrics`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_sentiment_evaluation_metrics - # @return [::Google::Cloud::AutoML::V1::TextSentimentEvaluationMetrics] - # Evaluation metrics for text sentiment models. - # - # Note: The following fields are mutually exclusive: `text_sentiment_evaluation_metrics`, `classification_evaluation_metrics`, `translation_evaluation_metrics`, `image_object_detection_evaluation_metrics`, `text_extraction_evaluation_metrics`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_extraction_evaluation_metrics - # @return [::Google::Cloud::AutoML::V1::TextExtractionEvaluationMetrics] - # Evaluation metrics for text extraction models. - # - # Note: The following fields are mutually exclusive: `text_extraction_evaluation_metrics`, `classification_evaluation_metrics`, `translation_evaluation_metrics`, `image_object_detection_evaluation_metrics`, `text_sentiment_evaluation_metrics`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Output only. Resource name of the model evaluation. - # Format: - # `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` - # @!attribute [rw] annotation_spec_id - # @return [::String] - # Output only. The ID of the annotation spec that the model evaluation applies to. The - # The ID is empty for the overall model evaluation. - # For Tables annotation specs in the dataset do not exist and this ID is - # always not set, but for CLASSIFICATION - # [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] - # the - # {::Google::Cloud::AutoML::V1::ModelEvaluation#display_name display_name} - # field is used. - # @!attribute [rw] display_name - # @return [::String] - # Output only. The value of - # {::Google::Cloud::AutoML::V1::AnnotationSpec#display_name display_name} - # at the moment when the model was trained. Because this field returns a - # value at model training time, for different models trained from the same - # dataset, the values may differ, since display names could had been changed - # between the two model's trainings. For Tables CLASSIFICATION - # [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] - # distinct values of the target column at the moment of the model evaluation - # are populated here. - # The display_name is empty for the overall model evaluation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this model evaluation was created. - # @!attribute [rw] evaluated_example_count - # @return [::Integer] - # Output only. The number of examples used for model evaluation, i.e. for - # which ground truth from time of model creation is compared against the - # predicted annotations created by the model. - # For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is - # the total number of all examples used for evaluation. - # Otherwise, this is the count of examples that according to the ground - # truth were annotated by the - # {::Google::Cloud::AutoML::V1::ModelEvaluation#annotation_spec_id annotation_spec_id}. - class ModelEvaluation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/operations.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/operations.rb deleted file mode 100644 index 78d79e45a942..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/operations.rb +++ /dev/null @@ -1,197 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Metadata used across all long running operations returned by AutoML API. - # @!attribute [rw] delete_details - # @return [::Google::Cloud::AutoML::V1::DeleteOperationMetadata] - # Details of a Delete operation. - # - # Note: The following fields are mutually exclusive: `delete_details`, `deploy_model_details`, `undeploy_model_details`, `create_model_details`, `create_dataset_details`, `import_data_details`, `batch_predict_details`, `export_data_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] deploy_model_details - # @return [::Google::Cloud::AutoML::V1::DeployModelOperationMetadata] - # Details of a DeployModel operation. - # - # Note: The following fields are mutually exclusive: `deploy_model_details`, `delete_details`, `undeploy_model_details`, `create_model_details`, `create_dataset_details`, `import_data_details`, `batch_predict_details`, `export_data_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] undeploy_model_details - # @return [::Google::Cloud::AutoML::V1::UndeployModelOperationMetadata] - # Details of an UndeployModel operation. - # - # Note: The following fields are mutually exclusive: `undeploy_model_details`, `delete_details`, `deploy_model_details`, `create_model_details`, `create_dataset_details`, `import_data_details`, `batch_predict_details`, `export_data_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_model_details - # @return [::Google::Cloud::AutoML::V1::CreateModelOperationMetadata] - # Details of CreateModel operation. - # - # Note: The following fields are mutually exclusive: `create_model_details`, `delete_details`, `deploy_model_details`, `undeploy_model_details`, `create_dataset_details`, `import_data_details`, `batch_predict_details`, `export_data_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_dataset_details - # @return [::Google::Cloud::AutoML::V1::CreateDatasetOperationMetadata] - # Details of CreateDataset operation. - # - # Note: The following fields are mutually exclusive: `create_dataset_details`, `delete_details`, `deploy_model_details`, `undeploy_model_details`, `create_model_details`, `import_data_details`, `batch_predict_details`, `export_data_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] import_data_details - # @return [::Google::Cloud::AutoML::V1::ImportDataOperationMetadata] - # Details of ImportData operation. - # - # Note: The following fields are mutually exclusive: `import_data_details`, `delete_details`, `deploy_model_details`, `undeploy_model_details`, `create_model_details`, `create_dataset_details`, `batch_predict_details`, `export_data_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] batch_predict_details - # @return [::Google::Cloud::AutoML::V1::BatchPredictOperationMetadata] - # Details of BatchPredict operation. - # - # Note: The following fields are mutually exclusive: `batch_predict_details`, `delete_details`, `deploy_model_details`, `undeploy_model_details`, `create_model_details`, `create_dataset_details`, `import_data_details`, `export_data_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] export_data_details - # @return [::Google::Cloud::AutoML::V1::ExportDataOperationMetadata] - # Details of ExportData operation. - # - # Note: The following fields are mutually exclusive: `export_data_details`, `delete_details`, `deploy_model_details`, `undeploy_model_details`, `create_model_details`, `create_dataset_details`, `import_data_details`, `batch_predict_details`, `export_model_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] export_model_details - # @return [::Google::Cloud::AutoML::V1::ExportModelOperationMetadata] - # Details of ExportModel operation. - # - # Note: The following fields are mutually exclusive: `export_model_details`, `delete_details`, `deploy_model_details`, `undeploy_model_details`, `create_model_details`, `create_dataset_details`, `import_data_details`, `batch_predict_details`, `export_data_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] progress_percent - # @return [::Integer] - # Output only. Progress of operation. Range: [0, 100]. - # Not used currently. - # @!attribute [rw] partial_failures - # @return [::Array<::Google::Rpc::Status>] - # Output only. Partial failures encountered. - # E.g. single files that couldn't be read. - # This field should never exceed 20 entries. - # Status details field will contain standard GCP error details. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the operation was created. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the operation was updated for the last time. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of operations that perform deletes of any entities. - class DeleteOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of DeployModel operation. - class DeployModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of UndeployModel operation. - class UndeployModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of CreateDataset operation. - class CreateDatasetOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of CreateModel operation. - class CreateModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of ImportData operation. - class ImportDataOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of ExportData operation. - # @!attribute [rw] output_info - # @return [::Google::Cloud::AutoML::V1::ExportDataOperationMetadata::ExportDataOutputInfo] - # Output only. Information further describing this export data's output. - class ExportDataOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Further describes this export data's output. - # Supplements - # {::Google::Cloud::AutoML::V1::OutputConfig OutputConfig}. - # @!attribute [rw] gcs_output_directory - # @return [::String] - # The full path of the Google Cloud Storage directory created, into which - # the exported data is written. - class ExportDataOutputInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Details of BatchPredict operation. - # @!attribute [rw] input_config - # @return [::Google::Cloud::AutoML::V1::BatchPredictInputConfig] - # Output only. The input config that was given upon starting this - # batch predict operation. - # @!attribute [rw] output_info - # @return [::Google::Cloud::AutoML::V1::BatchPredictOperationMetadata::BatchPredictOutputInfo] - # Output only. Information further describing this batch predict's output. - class BatchPredictOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Further describes this batch predict's output. - # Supplements - # {::Google::Cloud::AutoML::V1::BatchPredictOutputConfig BatchPredictOutputConfig}. - # @!attribute [rw] gcs_output_directory - # @return [::String] - # The full path of the Google Cloud Storage directory created, into which - # the prediction output is written. - class BatchPredictOutputInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Details of ExportModel operation. - # @!attribute [rw] output_info - # @return [::Google::Cloud::AutoML::V1::ExportModelOperationMetadata::ExportModelOutputInfo] - # Output only. Information further describing the output of this model - # export. - class ExportModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Further describes the output of model export. - # Supplements - # {::Google::Cloud::AutoML::V1::ModelExportOutputConfig ModelExportOutputConfig}. - # @!attribute [rw] gcs_output_directory - # @return [::String] - # The full path of the Google Cloud Storage directory created, into which - # the model will be exported. - class ExportModelOutputInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/prediction_service.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/prediction_service.rb deleted file mode 100644 index 0811f3318b09..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/prediction_service.rb +++ /dev/null @@ -1,270 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Request message for {::Google::Cloud::AutoML::V1::PredictionService::Client#predict PredictionService.Predict}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the model requested to serve the prediction. - # @!attribute [rw] payload - # @return [::Google::Cloud::AutoML::V1::ExamplePayload] - # Required. Payload to perform a prediction on. The payload must match the - # problem type that the model was trained to solve. - # @!attribute [rw] params - # @return [::Google::Protobuf::Map{::String => ::String}] - # Additional domain-specific parameters, any string must be up to 25000 - # characters long. - # - # AutoML Vision Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for an image, it will only produce results that have - # at least this confidence score. The default is 0.5. - # - # AutoML Vision Object Detection - # - # `score_threshold` - # : (float) When Model detects objects on the image, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned. The default is 100. The - # number of returned bounding boxes might be limited by the server. - # - # AutoML Tables - # - # `feature_importance` - # : (boolean) Whether - # [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] - # is populated in the returned list of - # [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] - # objects. The default is false. - class PredictRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ParamsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for {::Google::Cloud::AutoML::V1::PredictionService::Client#predict PredictionService.Predict}. - # @!attribute [rw] payload - # @return [::Array<::Google::Cloud::AutoML::V1::AnnotationPayload>] - # Prediction result. - # AutoML Translation and AutoML Natural Language Sentiment Analysis - # return precisely one payload. - # @!attribute [rw] preprocessed_input - # @return [::Google::Cloud::AutoML::V1::ExamplePayload] - # The preprocessed example that AutoML actually makes prediction on. - # Empty if AutoML does not preprocess the input example. - # - # For AutoML Natural Language (Classification, Entity Extraction, and - # Sentiment Analysis), if the input is a document, the recognized text is - # returned in the - # {::Google::Cloud::AutoML::V1::Document#document_text document_text} - # property. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Additional domain-specific prediction response metadata. - # - # AutoML Vision Object Detection - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding boxes to return per image. - # - # AutoML Natural Language Sentiment Analysis - # - # `sentiment_score` - # : (float, deprecated) A value between -1 and 1, - # -1 maps to least positive sentiment, while 1 maps to the most positive - # one and the higher the score, the more positive the sentiment in the - # document is. Yet these values are relative to the training data, so - # e.g. if all data was positive then -1 is also positive (though - # the least). - # `sentiment_score` is not the same as "score" and "magnitude" - # from Sentiment Analysis in the Natural Language API. - class PredictResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for {::Google::Cloud::AutoML::V1::PredictionService::Client#batch_predict PredictionService.BatchPredict}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the model requested to serve the batch prediction. - # @!attribute [rw] input_config - # @return [::Google::Cloud::AutoML::V1::BatchPredictInputConfig] - # Required. The input configuration for batch prediction. - # @!attribute [rw] output_config - # @return [::Google::Cloud::AutoML::V1::BatchPredictOutputConfig] - # Required. The Configuration specifying where output predictions should - # be written. - # @!attribute [rw] params - # @return [::Google::Protobuf::Map{::String => ::String}] - # Additional domain-specific parameters for the predictions, any string must - # be up to 25000 characters long. - # - # AutoML Natural Language Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for a text snippet, it will only produce results - # that have at least this confidence score. The default is 0.5. - # - # - # AutoML Vision Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for an image, it will only produce results that - # have at least this confidence score. The default is 0.5. - # - # AutoML Vision Object Detection - # - # `score_threshold` - # : (float) When Model detects objects on the image, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned per image. The default is 100, the - # number of bounding boxes returned might be limited by the server. - # AutoML Video Intelligence Classification - # - # `score_threshold` - # : (float) A value from 0.0 to 1.0. When the model - # makes predictions for a video, it will only produce results that - # have at least this confidence score. The default is 0.5. - # - # `segment_classification` - # : (boolean) Set to true to request - # segment-level classification. AutoML Video Intelligence returns - # labels and their confidence scores for the entire segment of the - # video that user specified in the request configuration. - # The default is true. - # - # `shot_classification` - # : (boolean) Set to true to request shot-level - # classification. AutoML Video Intelligence determines the boundaries - # for each camera shot in the entire segment of the video that user - # specified in the request configuration. AutoML Video Intelligence - # then returns labels and their confidence scores for each detected - # shot, along with the start and end time of the shot. - # The default is false. - # - # WARNING: Model evaluation is not done for this classification type, - # the quality of it depends on training data, but there are no metrics - # provided to describe that quality. - # - # `1s_interval_classification` - # : (boolean) Set to true to request - # classification for a video at one-second intervals. AutoML Video - # Intelligence returns labels and their confidence scores for each - # second of the entire segment of the video that user specified in the - # request configuration. The default is false. - # - # WARNING: Model evaluation is not done for this classification - # type, the quality of it depends on training data, but there are no - # metrics provided to describe that quality. - # - # AutoML Video Intelligence Object Tracking - # - # `score_threshold` - # : (float) When Model detects objects on video frames, - # it will only produce bounding boxes which have at least this - # confidence score. Value in 0 to 1 range, default is 0.5. - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding - # boxes returned per image. The default is 100, the - # number of bounding boxes returned might be limited by the server. - # - # `min_bounding_box_size` - # : (float) Only bounding boxes with shortest edge - # at least that long as a relative value of video frame size are - # returned. Value in 0 to 1 range. Default is 0. - class BatchPredictRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ParamsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Result of the Batch Predict. This message is returned in - # {::Google::Longrunning::Operation#response response} of the operation returned - # by the {::Google::Cloud::AutoML::V1::PredictionService::Client#batch_predict PredictionService.BatchPredict}. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Additional domain-specific prediction response metadata. - # - # AutoML Vision Object Detection - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding boxes returned per image. - # - # AutoML Video Intelligence Object Tracking - # - # `max_bounding_box_count` - # : (int64) The maximum number of bounding boxes returned per frame. - class BatchPredictResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/service.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/service.rb deleted file mode 100644 index 3185ecd7a149..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/service.rb +++ /dev/null @@ -1,326 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#create_dataset AutoMl.CreateDataset}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project to create the dataset for. - # @!attribute [rw] dataset - # @return [::Google::Cloud::AutoML::V1::Dataset] - # Required. The dataset to create. - class CreateDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#get_dataset AutoMl.GetDataset}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the dataset to retrieve. - class GetDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#list_datasets AutoMl.ListDatasets}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project from which to list datasets. - # @!attribute [rw] filter - # @return [::String] - # An expression for filtering the results of the request. - # - # * `dataset_metadata` - for existence of the case (e.g. - # `image_classification_dataset_metadata:*`). Some examples of using the filter are: - # - # * `translation_dataset_metadata:*` --> The dataset has - # `translation_dataset_metadata`. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer results than requested. - # If unspecified, server will pick a default size. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results for the server to return - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListDatasetsResponse#next_page_token ListDatasetsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Client#list_datasets AutoMl.ListDatasets} call. - class ListDatasetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for {::Google::Cloud::AutoML::V1::AutoML::Client#list_datasets AutoMl.ListDatasets}. - # @!attribute [rw] datasets - # @return [::Array<::Google::Cloud::AutoML::V1::Dataset>] - # The datasets read. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # Pass to {::Google::Cloud::AutoML::V1::ListDatasetsRequest#page_token ListDatasetsRequest.page_token} to obtain that page. - class ListDatasetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#update_dataset AutoMl.UpdateDataset} - # @!attribute [rw] dataset - # @return [::Google::Cloud::AutoML::V1::Dataset] - # Required. The dataset which replaces the resource on the server. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The update mask applies to the resource. - class UpdateDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#delete_dataset AutoMl.DeleteDataset}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the dataset to delete. - class DeleteDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#import_data AutoMl.ImportData}. - # @!attribute [rw] name - # @return [::String] - # Required. Dataset name. Dataset must already exist. All imported - # annotations and examples will be added. - # @!attribute [rw] input_config - # @return [::Google::Cloud::AutoML::V1::InputConfig] - # Required. The desired input location and its domain specific semantics, - # if any. - class ImportDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#export_data AutoMl.ExportData}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the dataset. - # @!attribute [rw] output_config - # @return [::Google::Cloud::AutoML::V1::OutputConfig] - # Required. The desired output location. - class ExportDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#get_annotation_spec AutoMl.GetAnnotationSpec}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the annotation spec to retrieve. - class GetAnnotationSpecRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#create_model AutoMl.CreateModel}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent project where the model is being created. - # @!attribute [rw] model - # @return [::Google::Cloud::AutoML::V1::Model] - # Required. The model to create. - class CreateModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#get_model AutoMl.GetModel}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the model. - class GetModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#list_models AutoMl.ListModels}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the project, from which to list the models. - # @!attribute [rw] filter - # @return [::String] - # An expression for filtering the results of the request. - # - # * `model_metadata` - for existence of the case (e.g. - # `video_classification_model_metadata:*`). - # * `dataset_id` - for = or !=. Some examples of using the filter are: - # - # * `image_classification_model_metadata:*` --> The model has - # `image_classification_model_metadata`. - # * `dataset_id=5` --> The model was created from a dataset with ID 5. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results for the server to return - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Client#list_models AutoMl.ListModels} call. - class ListModelsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for {::Google::Cloud::AutoML::V1::AutoML::Client#list_models AutoMl.ListModels}. - # @!attribute [rw] model - # @return [::Array<::Google::Cloud::AutoML::V1::Model>] - # List of models in the requested page. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # Pass to {::Google::Cloud::AutoML::V1::ListModelsRequest#page_token ListModelsRequest.page_token} to obtain that page. - class ListModelsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#delete_model AutoMl.DeleteModel}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the model being deleted. - class DeleteModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#update_model AutoMl.UpdateModel} - # @!attribute [rw] model - # @return [::Google::Cloud::AutoML::V1::Model] - # Required. The model which replaces the resource on the server. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The update mask applies to the resource. - class UpdateModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#deploy_model AutoMl.DeployModel}. - # @!attribute [rw] image_object_detection_model_deployment_metadata - # @return [::Google::Cloud::AutoML::V1::ImageObjectDetectionModelDeploymentMetadata] - # Model deployment metadata specific to Image Object Detection. - # - # Note: The following fields are mutually exclusive: `image_object_detection_model_deployment_metadata`, `image_classification_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_classification_model_deployment_metadata - # @return [::Google::Cloud::AutoML::V1::ImageClassificationModelDeploymentMetadata] - # Model deployment metadata specific to Image Classification. - # - # Note: The following fields are mutually exclusive: `image_classification_model_deployment_metadata`, `image_object_detection_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the model to deploy. - class DeployModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#undeploy_model AutoMl.UndeployModel}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the model to undeploy. - class UndeployModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#export_model AutoMl.ExportModel}. - # Models need to be enabled for exporting, otherwise an error code will be - # returned. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the model to export. - # @!attribute [rw] output_config - # @return [::Google::Cloud::AutoML::V1::ModelExportOutputConfig] - # Required. The desired output location and configuration. - class ExportModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#get_model_evaluation AutoMl.GetModelEvaluation}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name for the model evaluation. - class GetModelEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations AutoMl.ListModelEvaluations}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the model to list the model evaluations for. - # If modelId is set as "-", this will list model evaluations from across all - # models of the parent location. - # @!attribute [rw] filter - # @return [::String] - # Required. An expression for filtering the results of the request. - # - # * `annotation_spec_id` - for =, != or existence. See example below for - # the last. - # - # Some examples of using the filter are: - # - # * `annotation_spec_id!=4` --> The model evaluation was done for - # annotation spec with ID different than 4. - # * `NOT annotation_spec_id:*` --> The model evaluation was done for - # aggregate of all annotation specs. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results for the server to return. - # Typically obtained via - # {::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} of the previous - # {::Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations AutoMl.ListModelEvaluations} call. - class ListModelEvaluationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for {::Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations AutoMl.ListModelEvaluations}. - # @!attribute [rw] model_evaluation - # @return [::Array<::Google::Cloud::AutoML::V1::ModelEvaluation>] - # List of model evaluations in the requested page. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # Pass to the {::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest#page_token ListModelEvaluationsRequest.page_token} field of a new - # {::Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations AutoMl.ListModelEvaluations} request to obtain that page. - class ListModelEvaluationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text.rb deleted file mode 100644 index aa705d31cb5d..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Dataset metadata for classification. - # @!attribute [rw] classification_type - # @return [::Google::Cloud::AutoML::V1::ClassificationType] - # Required. Type of the classification problem. - class TextClassificationDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model metadata that is specific to text classification. - # @!attribute [rw] classification_type - # @return [::Google::Cloud::AutoML::V1::ClassificationType] - # Output only. Classification type of the dataset used to train this model. - class TextClassificationModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dataset metadata that is specific to text extraction - class TextExtractionDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model metadata that is specific to text extraction. - class TextExtractionModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dataset metadata for text sentiment. - # @!attribute [rw] sentiment_max - # @return [::Integer] - # Required. A sentiment is expressed as an integer ordinal, where higher value - # means a more positive sentiment. The range of sentiments that will be used - # is between 0 and sentiment_max (inclusive on both ends), and all the values - # in the range must be represented in the dataset before a model can be - # created. - # sentiment_max value must be between 1 and 10 (inclusive). - class TextSentimentDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model metadata that is specific to text sentiment. - class TextSentimentModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_extraction.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_extraction.rb deleted file mode 100644 index 817c0921c657..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_extraction.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Annotation for identifying spans of text. - # @!attribute [rw] text_segment - # @return [::Google::Cloud::AutoML::V1::TextSegment] - # An entity annotation will set this, which is the part of the original - # text to which the annotation pertains. - # @!attribute [rw] score - # @return [::Float] - # Output only. A confidence estimate between 0.0 and 1.0. A higher value - # means greater confidence in correctness of the annotation. - class TextExtractionAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model evaluation metrics for text extraction problems. - # @!attribute [rw] au_prc - # @return [::Float] - # Output only. The Area under precision recall curve metric. - # @!attribute [rw] confidence_metrics_entries - # @return [::Array<::Google::Cloud::AutoML::V1::TextExtractionEvaluationMetrics::ConfidenceMetricsEntry>] - # Output only. Metrics that have confidence thresholds. - # Precision-recall curve can be derived from it. - class TextExtractionEvaluationMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metrics for a single confidence threshold. - # @!attribute [rw] confidence_threshold - # @return [::Float] - # Output only. The confidence threshold value used to compute the metrics. - # Only annotations with score of at least this threshold are considered to - # be ones the model would return. - # @!attribute [rw] recall - # @return [::Float] - # Output only. Recall under the given confidence threshold. - # @!attribute [rw] precision - # @return [::Float] - # Output only. Precision under the given confidence threshold. - # @!attribute [rw] f1_score - # @return [::Float] - # Output only. The harmonic mean of recall and precision. - class ConfidenceMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_segment.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_segment.rb deleted file mode 100644 index 93eddac0a79f..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_segment.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. - # @!attribute [rw] content - # @return [::String] - # Output only. The content of the TextSegment. - # @!attribute [rw] start_offset - # @return [::Integer] - # Required. Zero-based character index of the first character of the text - # segment (counting characters from the beginning of the text). - # @!attribute [rw] end_offset - # @return [::Integer] - # Required. Zero-based character index of the first character past the end of - # the text segment (counting character from the beginning of the text). - # The character at the end_offset is NOT included in the text segment. - class TextSegment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_sentiment.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_sentiment.rb deleted file mode 100644 index 1c4bc080ceb3..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/text_sentiment.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Contains annotation details specific to text sentiment. - # @!attribute [rw] sentiment - # @return [::Integer] - # Output only. The sentiment with the semantic, as given to the - # {::Google::Cloud::AutoML::V1::AutoML::Client#import_data AutoMl.ImportData} when populating the dataset from which the model used - # for the prediction had been trained. - # The sentiment values are between 0 and - # Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), - # with higher value meaning more positive sentiment. They are completely - # relative, i.e. 0 means least positive sentiment and sentiment_max means - # the most positive from the sentiments present in the train data. Therefore - # e.g. if train data had only negative sentiment, then sentiment_max, would - # be still negative (although least negative). - # The sentiment shouldn't be confused with "score" or "magnitude" - # from the previous Natural Language Sentiment Analysis API. - class TextSentimentAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model evaluation metrics for text sentiment problems. - # @!attribute [rw] precision - # @return [::Float] - # Output only. Precision. - # @!attribute [rw] recall - # @return [::Float] - # Output only. Recall. - # @!attribute [rw] f1_score - # @return [::Float] - # Output only. The harmonic mean of recall and precision. - # @!attribute [rw] mean_absolute_error - # @return [::Float] - # Output only. Mean absolute error. Only set for the overall model - # evaluation, not for evaluation of a single annotation spec. - # @!attribute [rw] mean_squared_error - # @return [::Float] - # Output only. Mean squared error. Only set for the overall model - # evaluation, not for evaluation of a single annotation spec. - # @!attribute [rw] linear_kappa - # @return [::Float] - # Output only. Linear weighted kappa. Only set for the overall model - # evaluation, not for evaluation of a single annotation spec. - # @!attribute [rw] quadratic_kappa - # @return [::Float] - # Output only. Quadratic weighted kappa. Only set for the overall model - # evaluation, not for evaluation of a single annotation spec. - # @!attribute [rw] confusion_matrix - # @return [::Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfusionMatrix] - # Output only. Confusion matrix of the evaluation. - # Only set for the overall model evaluation, not for evaluation of a single - # annotation spec. - class TextSentimentEvaluationMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/translation.rb b/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/translation.rb deleted file mode 100644 index b41617bc0ea1..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/cloud/automl/v1/translation.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AutoML - module V1 - # Dataset metadata that is specific to translation. - # @!attribute [rw] source_language_code - # @return [::String] - # Required. The BCP-47 language code of the source language. - # @!attribute [rw] target_language_code - # @return [::String] - # Required. The BCP-47 language code of the target language. - class TranslationDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluation metrics for the dataset. - # @!attribute [rw] bleu_score - # @return [::Float] - # Output only. BLEU score. - # @!attribute [rw] base_bleu_score - # @return [::Float] - # Output only. BLEU score for base model. - class TranslationEvaluationMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Model metadata that is specific to translation. - # @!attribute [rw] base_model - # @return [::String] - # The resource name of the model to use as a baseline to train the custom - # model. If unset, we use the default base model provided by Google - # Translate. Format: - # `projects/{project_id}/locations/{location_id}/models/{model_id}` - # @!attribute [rw] source_language_code - # @return [::String] - # Output only. Inferred from the dataset. - # The source language (The BCP-47 language code) that is used for training. - # @!attribute [rw] target_language_code - # @return [::String] - # Output only. The target language (The BCP-47 language code) that is used - # for training. - class TranslationModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Annotation details specific to translation. - # @!attribute [rw] translated_content - # @return [::Google::Cloud::AutoML::V1::TextSnippet] - # Output only . The translated content. - class TranslationAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/longrunning/operations.rb b/google-cloud-automl-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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/google-cloud-automl-v1/proto_docs/google/protobuf/any.rb b/google-cloud-automl-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-automl-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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/google-cloud-automl-v1/proto_docs/google/protobuf/empty.rb b/google-cloud-automl-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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/google-cloud-automl-v1/proto_docs/google/protobuf/field_mask.rb b/google-cloud-automl-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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/google-cloud-automl-v1/proto_docs/google/protobuf/timestamp.rb b/google-cloud-automl-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index e58202461f88..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must - # be between -315576000000 and 315576000000 inclusive (which corresponds to - # 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. This field is - # the nanosecond portion of the duration, not an alternative to seconds. - # Negative second values with fractions must still have non-negative nanos - # values that count forward in time. Must be between 0 and 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/google-cloud-automl-v1/proto_docs/google/rpc/status.rb b/google-cloud-automl-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/google-cloud-automl-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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/google-cloud-automl-v1/snippets/Gemfile b/google-cloud-automl-v1/snippets/Gemfile deleted file mode 100644 index a30bcdf1095a..000000000000 --- a/google-cloud-automl-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-automl-v1", path: "../" -else - gem "google-cloud-automl-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/google-cloud-automl-v1/snippets/automl/create_dataset.rb b/google-cloud-automl-v1/snippets/automl/create_dataset.rb deleted file mode 100644 index b5039ab44d72..000000000000 --- a/google-cloud-automl-v1/snippets/automl/create_dataset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_CreateDataset_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the create_dataset call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#create_dataset. -# -def create_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::CreateDatasetRequest.new - - # Call the create_dataset method. - result = client.create_dataset request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_CreateDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/create_model.rb b/google-cloud-automl-v1/snippets/automl/create_model.rb deleted file mode 100644 index 5d3c31c2a84e..000000000000 --- a/google-cloud-automl-v1/snippets/automl/create_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_CreateModel_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the create_model call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#create_model. -# -def create_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::CreateModelRequest.new - - # Call the create_model method. - result = client.create_model request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_CreateModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/delete_dataset.rb b/google-cloud-automl-v1/snippets/automl/delete_dataset.rb deleted file mode 100644 index 5d9f3bddfa4c..000000000000 --- a/google-cloud-automl-v1/snippets/automl/delete_dataset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_DeleteDataset_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the delete_dataset call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#delete_dataset. -# -def delete_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new - - # Call the delete_dataset method. - result = client.delete_dataset request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_DeleteDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/delete_model.rb b/google-cloud-automl-v1/snippets/automl/delete_model.rb deleted file mode 100644 index 31d572dc4ae4..000000000000 --- a/google-cloud-automl-v1/snippets/automl/delete_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_DeleteModel_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the delete_model call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#delete_model. -# -def delete_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::DeleteModelRequest.new - - # Call the delete_model method. - result = client.delete_model request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_DeleteModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/deploy_model.rb b/google-cloud-automl-v1/snippets/automl/deploy_model.rb deleted file mode 100644 index 6bf6b9d1894a..000000000000 --- a/google-cloud-automl-v1/snippets/automl/deploy_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_DeployModel_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the deploy_model call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#deploy_model. -# -def deploy_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::DeployModelRequest.new - - # Call the deploy_model method. - result = client.deploy_model request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_DeployModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/export_data.rb b/google-cloud-automl-v1/snippets/automl/export_data.rb deleted file mode 100644 index 0c6ccde37676..000000000000 --- a/google-cloud-automl-v1/snippets/automl/export_data.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_ExportData_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the export_data call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#export_data. -# -def export_data - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::ExportDataRequest.new - - # Call the export_data method. - result = client.export_data request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_ExportData_sync] diff --git a/google-cloud-automl-v1/snippets/automl/export_model.rb b/google-cloud-automl-v1/snippets/automl/export_model.rb deleted file mode 100644 index a8d8b903e76d..000000000000 --- a/google-cloud-automl-v1/snippets/automl/export_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_ExportModel_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the export_model call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#export_model. -# -def export_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::ExportModelRequest.new - - # Call the export_model method. - result = client.export_model request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_ExportModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb b/google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb deleted file mode 100644 index 1370dd7f6de2..000000000000 --- a/google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_GetAnnotationSpec_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the get_annotation_spec call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#get_annotation_spec. -# -def get_annotation_spec - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new - - # Call the get_annotation_spec method. - result = client.get_annotation_spec request - - # The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec. - p result -end -# [END automl_v1_generated_AutoML_GetAnnotationSpec_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_dataset.rb b/google-cloud-automl-v1/snippets/automl/get_dataset.rb deleted file mode 100644 index 653b941b6763..000000000000 --- a/google-cloud-automl-v1/snippets/automl/get_dataset.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_GetDataset_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the get_dataset call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#get_dataset. -# -def get_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::GetDatasetRequest.new - - # Call the get_dataset method. - result = client.get_dataset request - - # The returned object is of type Google::Cloud::AutoML::V1::Dataset. - p result -end -# [END automl_v1_generated_AutoML_GetDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_model.rb b/google-cloud-automl-v1/snippets/automl/get_model.rb deleted file mode 100644 index 3cfec8bd9f5b..000000000000 --- a/google-cloud-automl-v1/snippets/automl/get_model.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_GetModel_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the get_model call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#get_model. -# -def get_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::GetModelRequest.new - - # Call the get_model method. - result = client.get_model request - - # The returned object is of type Google::Cloud::AutoML::V1::Model. - p result -end -# [END automl_v1_generated_AutoML_GetModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb b/google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb deleted file mode 100644 index 66b9f5107d85..000000000000 --- a/google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_GetModelEvaluation_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the get_model_evaluation call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#get_model_evaluation. -# -def get_model_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new - - # Call the get_model_evaluation method. - result = client.get_model_evaluation request - - # The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation. - p result -end -# [END automl_v1_generated_AutoML_GetModelEvaluation_sync] diff --git a/google-cloud-automl-v1/snippets/automl/import_data.rb b/google-cloud-automl-v1/snippets/automl/import_data.rb deleted file mode 100644 index 69bb6c83c5dc..000000000000 --- a/google-cloud-automl-v1/snippets/automl/import_data.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_ImportData_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the import_data call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#import_data. -# -def import_data - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::ImportDataRequest.new - - # Call the import_data method. - result = client.import_data request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_ImportData_sync] diff --git a/google-cloud-automl-v1/snippets/automl/list_datasets.rb b/google-cloud-automl-v1/snippets/automl/list_datasets.rb deleted file mode 100644 index c5a76dbcd997..000000000000 --- a/google-cloud-automl-v1/snippets/automl/list_datasets.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_ListDatasets_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the list_datasets call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#list_datasets. -# -def list_datasets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new - - # Call the list_datasets method. - result = client.list_datasets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::AutoML::V1::Dataset. - p item - end -end -# [END automl_v1_generated_AutoML_ListDatasets_sync] diff --git a/google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb b/google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb deleted file mode 100644 index c9798178e36c..000000000000 --- a/google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_ListModelEvaluations_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the list_model_evaluations call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations. -# -def list_model_evaluations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new - - # Call the list_model_evaluations method. - result = client.list_model_evaluations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation. - p item - end -end -# [END automl_v1_generated_AutoML_ListModelEvaluations_sync] diff --git a/google-cloud-automl-v1/snippets/automl/list_models.rb b/google-cloud-automl-v1/snippets/automl/list_models.rb deleted file mode 100644 index 9b3102e77406..000000000000 --- a/google-cloud-automl-v1/snippets/automl/list_models.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_ListModels_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the list_models call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#list_models. -# -def list_models - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::ListModelsRequest.new - - # Call the list_models method. - result = client.list_models request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::AutoML::V1::Model. - p item - end -end -# [END automl_v1_generated_AutoML_ListModels_sync] diff --git a/google-cloud-automl-v1/snippets/automl/undeploy_model.rb b/google-cloud-automl-v1/snippets/automl/undeploy_model.rb deleted file mode 100644 index 9044e6b31e6d..000000000000 --- a/google-cloud-automl-v1/snippets/automl/undeploy_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_UndeployModel_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the undeploy_model call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#undeploy_model. -# -def undeploy_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::UndeployModelRequest.new - - # Call the undeploy_model method. - result = client.undeploy_model request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_AutoML_UndeployModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/update_dataset.rb b/google-cloud-automl-v1/snippets/automl/update_dataset.rb deleted file mode 100644 index 097b11573307..000000000000 --- a/google-cloud-automl-v1/snippets/automl/update_dataset.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_UpdateDataset_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the update_dataset call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#update_dataset. -# -def update_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new - - # Call the update_dataset method. - result = client.update_dataset request - - # The returned object is of type Google::Cloud::AutoML::V1::Dataset. - p result -end -# [END automl_v1_generated_AutoML_UpdateDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/update_model.rb b/google-cloud-automl-v1/snippets/automl/update_model.rb deleted file mode 100644 index 8b945e7f28c5..000000000000 --- a/google-cloud-automl-v1/snippets/automl/update_model.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_AutoML_UpdateModel_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the update_model call in the AutoML service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::AutoML::Client#update_model. -# -def update_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::AutoML::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::UpdateModelRequest.new - - # Call the update_model method. - result = client.update_model request - - # The returned object is of type Google::Cloud::AutoML::V1::Model. - p result -end -# [END automl_v1_generated_AutoML_UpdateModel_sync] diff --git a/google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb b/google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb deleted file mode 100644 index 97f5c94f0b1a..000000000000 --- a/google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_PredictionService_BatchPredict_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the batch_predict call in the PredictionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::PredictionService::Client#batch_predict. -# -def batch_predict - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::PredictionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::BatchPredictRequest.new - - # Call the batch_predict method. - result = client.batch_predict request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END automl_v1_generated_PredictionService_BatchPredict_sync] diff --git a/google-cloud-automl-v1/snippets/prediction_service/predict.rb b/google-cloud-automl-v1/snippets/prediction_service/predict.rb deleted file mode 100644 index bc742b1e85e0..000000000000 --- a/google-cloud-automl-v1/snippets/prediction_service/predict.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START automl_v1_generated_PredictionService_Predict_sync] -require "google/cloud/automl/v1" - -## -# Snippet for the predict call in the PredictionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AutoML::V1::PredictionService::Client#predict. -# -def predict - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AutoML::V1::PredictionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AutoML::V1::PredictRequest.new - - # Call the predict method. - result = client.predict request - - # The returned object is of type Google::Cloud::AutoML::V1::PredictResponse. - p result -end -# [END automl_v1_generated_PredictionService_Predict_sync] diff --git a/google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json b/google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json deleted file mode 100644 index dd84229de726..000000000000 --- a/google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-automl-v1", - "version": "1.8.1", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.automl.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "automl_v1_generated_PredictionService_Predict_sync", - "title": "Snippet for the predict call in the PredictionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::PredictionService::Client#predict.", - "file": "prediction_service/predict.rb", - "language": "RUBY", - "client_method": { - "short_name": "predict", - "full_name": "::Google::Cloud::AutoML::V1::PredictionService::Client#predict", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::PredictRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::PredictResponse", - "client": { - "short_name": "PredictionService::Client", - "full_name": "::Google::Cloud::AutoML::V1::PredictionService::Client" - }, - "method": { - "short_name": "Predict", - "full_name": "google.cloud.automl.v1.PredictionService.Predict", - "service": { - "short_name": "PredictionService", - "full_name": "google.cloud.automl.v1.PredictionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_PredictionService_BatchPredict_sync", - "title": "Snippet for the batch_predict call in the PredictionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::PredictionService::Client#batch_predict.", - "file": "prediction_service/batch_predict.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_predict", - "full_name": "::Google::Cloud::AutoML::V1::PredictionService::Client#batch_predict", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::BatchPredictRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PredictionService::Client", - "full_name": "::Google::Cloud::AutoML::V1::PredictionService::Client" - }, - "method": { - "short_name": "BatchPredict", - "full_name": "google.cloud.automl.v1.PredictionService.BatchPredict", - "service": { - "short_name": "PredictionService", - "full_name": "google.cloud.automl.v1.PredictionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_CreateDataset_sync", - "title": "Snippet for the create_dataset call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#create_dataset.", - "file": "automl/create_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_dataset", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#create_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::CreateDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "CreateDataset", - "full_name": "google.cloud.automl.v1.AutoMl.CreateDataset", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_GetDataset_sync", - "title": "Snippet for the get_dataset call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#get_dataset.", - "file": "automl/get_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_dataset", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#get_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::GetDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::Dataset", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "GetDataset", - "full_name": "google.cloud.automl.v1.AutoMl.GetDataset", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_ListDatasets_sync", - "title": "Snippet for the list_datasets call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#list_datasets.", - "file": "automl/list_datasets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_datasets", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#list_datasets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::ListDatasetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::ListDatasetsResponse", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "ListDatasets", - "full_name": "google.cloud.automl.v1.AutoMl.ListDatasets", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_UpdateDataset_sync", - "title": "Snippet for the update_dataset call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#update_dataset.", - "file": "automl/update_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_dataset", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#update_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::UpdateDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::Dataset", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "UpdateDataset", - "full_name": "google.cloud.automl.v1.AutoMl.UpdateDataset", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_DeleteDataset_sync", - "title": "Snippet for the delete_dataset call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#delete_dataset.", - "file": "automl/delete_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_dataset", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#delete_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::DeleteDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "DeleteDataset", - "full_name": "google.cloud.automl.v1.AutoMl.DeleteDataset", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_ImportData_sync", - "title": "Snippet for the import_data call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#import_data.", - "file": "automl/import_data.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_data", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#import_data", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::ImportDataRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "ImportData", - "full_name": "google.cloud.automl.v1.AutoMl.ImportData", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_ExportData_sync", - "title": "Snippet for the export_data call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#export_data.", - "file": "automl/export_data.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_data", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#export_data", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::ExportDataRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "ExportData", - "full_name": "google.cloud.automl.v1.AutoMl.ExportData", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_GetAnnotationSpec_sync", - "title": "Snippet for the get_annotation_spec call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#get_annotation_spec.", - "file": "automl/get_annotation_spec.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_annotation_spec", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#get_annotation_spec", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::AnnotationSpec", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "GetAnnotationSpec", - "full_name": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_CreateModel_sync", - "title": "Snippet for the create_model call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#create_model.", - "file": "automl/create_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_model", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#create_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::CreateModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "CreateModel", - "full_name": "google.cloud.automl.v1.AutoMl.CreateModel", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_GetModel_sync", - "title": "Snippet for the get_model call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#get_model.", - "file": "automl/get_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_model", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#get_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::GetModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::Model", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "GetModel", - "full_name": "google.cloud.automl.v1.AutoMl.GetModel", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_ListModels_sync", - "title": "Snippet for the list_models call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#list_models.", - "file": "automl/list_models.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_models", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#list_models", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::ListModelsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::ListModelsResponse", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "ListModels", - "full_name": "google.cloud.automl.v1.AutoMl.ListModels", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_DeleteModel_sync", - "title": "Snippet for the delete_model call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#delete_model.", - "file": "automl/delete_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_model", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#delete_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::DeleteModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "DeleteModel", - "full_name": "google.cloud.automl.v1.AutoMl.DeleteModel", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_UpdateModel_sync", - "title": "Snippet for the update_model call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#update_model.", - "file": "automl/update_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_model", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#update_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::UpdateModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::Model", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "UpdateModel", - "full_name": "google.cloud.automl.v1.AutoMl.UpdateModel", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_DeployModel_sync", - "title": "Snippet for the deploy_model call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#deploy_model.", - "file": "automl/deploy_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_model", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#deploy_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::DeployModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "DeployModel", - "full_name": "google.cloud.automl.v1.AutoMl.DeployModel", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_UndeployModel_sync", - "title": "Snippet for the undeploy_model call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#undeploy_model.", - "file": "automl/undeploy_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "undeploy_model", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#undeploy_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::UndeployModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "UndeployModel", - "full_name": "google.cloud.automl.v1.AutoMl.UndeployModel", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_ExportModel_sync", - "title": "Snippet for the export_model call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#export_model.", - "file": "automl/export_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_model", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#export_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::ExportModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "ExportModel", - "full_name": "google.cloud.automl.v1.AutoMl.ExportModel", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_GetModelEvaluation_sync", - "title": "Snippet for the get_model_evaluation call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#get_model_evaluation.", - "file": "automl/get_model_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_model_evaluation", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#get_model_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::GetModelEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::ModelEvaluation", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "GetModelEvaluation", - "full_name": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "automl_v1_generated_AutoML_ListModelEvaluations_sync", - "title": "Snippet for the list_model_evaluations call in the AutoML service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations.", - "file": "automl/list_model_evaluations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_model_evaluations", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse", - "client": { - "short_name": "AutoML::Client", - "full_name": "::Google::Cloud::AutoML::V1::AutoML::Client" - }, - "method": { - "short_name": "ListModelEvaluations", - "full_name": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", - "service": { - "short_name": "AutoMl", - "full_name": "google.cloud.automl.v1.AutoMl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb deleted file mode 100644 index 856cda1fb3b2..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/automl/v1/service_pb" -require "google/cloud/automl/v1/service_services_pb" -require "google/cloud/automl/v1/automl" - -class ::Google::Cloud::AutoML::V1::AutoML::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) 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 - c.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, 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 - c.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), 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 - c = ::Google::Cloud::AutoML::V1::AutoML::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::AutoML::V1::AutoML::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::AutoML::V1::AutoML::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::AutoML::V1::AutoML::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::AutoML::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::AutoML::V1::AutoML::Operations::Configuration, config - end -end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb deleted file mode 100644 index be60ed069bd5..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/automl/v1/automl" - -class ::Google::Cloud::AutoML::V1::AutoML::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_annotation_spec_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.annotation_spec_path project: "value0", location: "value1", dataset: "value2", annotation_spec: "value3" - assert_equal "projects/value0/locations/value1/datasets/value2/annotationSpecs/value3", path - end - end - - def test_dataset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dataset_path project: "value0", location: "value1", dataset: "value2" - assert_equal "projects/value0/locations/value1/datasets/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AutoML::V1::AutoML::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_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", model: "value2" - assert_equal "projects/value0/locations/value1/models/value2", path - end - end - - def test_model_evaluation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_evaluation_path project: "value0", location: "value1", model: "value2", model_evaluation: "value3" - assert_equal "projects/value0/locations/value1/models/value2/modelEvaluations/value3", path - end - end -end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb deleted file mode 100644 index 433cd2fb25dd..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb +++ /dev/null @@ -1,1088 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/automl/v1/service_pb" -require "google/cloud/automl/v1/automl/rest" - - -class ::Google::Cloud::AutoML::V1::AutoML::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_dataset - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - dataset = {} - - create_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_create_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_dataset({ parent: parent, dataset: dataset }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_dataset parent: parent, dataset: dataset do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_dataset ::Google::Cloud::AutoML::V1::CreateDatasetRequest.new(parent: parent, dataset: dataset) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_dataset({ parent: parent, dataset: dataset }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_dataset(::Google::Cloud::AutoML::V1::CreateDatasetRequest.new(parent: parent, dataset: dataset), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_dataset_client_stub.call_count - end - end - end - - def test_get_dataset - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::Dataset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_get_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_dataset ::Google::Cloud::AutoML::V1::GetDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_dataset(::Google::Cloud::AutoML::V1::GetDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_dataset_client_stub.call_count - end - end - end - - def test_list_datasets - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::ListDatasetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_datasets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_list_datasets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_datasets_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_datasets({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_datasets parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_datasets ::Google::Cloud::AutoML::V1::ListDatasetsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_datasets({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.list_datasets(::Google::Cloud::AutoML::V1::ListDatasetsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_datasets_client_stub.call_count - end - end - end - - def test_update_dataset - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::Dataset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - dataset = {} - update_mask = {} - - update_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_update_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_dataset({ dataset: dataset, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_dataset dataset: dataset, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_dataset ::Google::Cloud::AutoML::V1::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_dataset({ dataset: dataset, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_dataset(::Google::Cloud::AutoML::V1::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_dataset_client_stub.call_count - end - end - end - - def test_delete_dataset - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_delete_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_dataset ::Google::Cloud::AutoML::V1::DeleteDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_dataset(::Google::Cloud::AutoML::V1::DeleteDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_dataset_client_stub.call_count - end - end - end - - def test_import_data - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - input_config = {} - - import_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_import_data_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_data_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.import_data({ name: name, input_config: input_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.import_data name: name, input_config: input_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.import_data ::Google::Cloud::AutoML::V1::ImportDataRequest.new(name: name, input_config: input_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.import_data({ name: name, input_config: input_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.import_data(::Google::Cloud::AutoML::V1::ImportDataRequest.new(name: name, input_config: input_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_data_client_stub.call_count - end - end - end - - def test_export_data - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - output_config = {} - - export_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_export_data_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_data_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.export_data({ name: name, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.export_data name: name, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.export_data ::Google::Cloud::AutoML::V1::ExportDataRequest.new(name: name, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.export_data({ name: name, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.export_data(::Google::Cloud::AutoML::V1::ExportDataRequest.new(name: name, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_data_client_stub.call_count - end - end - end - - def test_get_annotation_spec - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::AnnotationSpec.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_annotation_spec_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_get_annotation_spec_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_annotation_spec_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_annotation_spec({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_annotation_spec name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_annotation_spec ::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_annotation_spec({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_annotation_spec(::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_annotation_spec_client_stub.call_count - end - end - end - - def test_create_model - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - model = {} - - create_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_create_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_model({ parent: parent, model: model }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_model parent: parent, model: model do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_model ::Google::Cloud::AutoML::V1::CreateModelRequest.new(parent: parent, model: model) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_model({ parent: parent, model: model }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_model(::Google::Cloud::AutoML::V1::CreateModelRequest.new(parent: parent, model: model), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_model_client_stub.call_count - end - end - end - - def test_get_model - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::Model.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_get_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_model ::Google::Cloud::AutoML::V1::GetModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_model(::Google::Cloud::AutoML::V1::GetModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_model_client_stub.call_count - end - end - end - - def test_list_models - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::ListModelsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_models_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_list_models_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_models_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_models({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_models parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_models ::Google::Cloud::AutoML::V1::ListModelsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_models({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.list_models(::Google::Cloud::AutoML::V1::ListModelsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_models_client_stub.call_count - end - end - end - - def test_delete_model - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_delete_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_model ::Google::Cloud::AutoML::V1::DeleteModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_model(::Google::Cloud::AutoML::V1::DeleteModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_model_client_stub.call_count - end - end - end - - def test_update_model - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::Model.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - model = {} - update_mask = {} - - update_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_update_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_model({ model: model, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_model model: model, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_model ::Google::Cloud::AutoML::V1::UpdateModelRequest.new(model: model, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_model({ model: model, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_model(::Google::Cloud::AutoML::V1::UpdateModelRequest.new(model: model, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_model_client_stub.call_count - end - end - end - - def test_deploy_model - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - image_object_detection_model_deployment_metadata = {} - name = "hello world" - - deploy_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_deploy_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, deploy_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.deploy_model({ image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.deploy_model image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.deploy_model ::Google::Cloud::AutoML::V1::DeployModelRequest.new(image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.deploy_model({ image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.deploy_model(::Google::Cloud::AutoML::V1::DeployModelRequest.new(image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, deploy_model_client_stub.call_count - end - end - end - - def test_undeploy_model - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - undeploy_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_undeploy_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undeploy_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.undeploy_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.undeploy_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.undeploy_model ::Google::Cloud::AutoML::V1::UndeployModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.undeploy_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.undeploy_model(::Google::Cloud::AutoML::V1::UndeployModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undeploy_model_client_stub.call_count - end - end - end - - def test_export_model - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - output_config = {} - - export_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_export_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.export_model({ name: name, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.export_model name: name, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.export_model ::Google::Cloud::AutoML::V1::ExportModelRequest.new(name: name, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.export_model({ name: name, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.export_model(::Google::Cloud::AutoML::V1::ExportModelRequest.new(name: name, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_model_client_stub.call_count - end - end - end - - def test_get_model_evaluation - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::ModelEvaluation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_model_evaluation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_get_model_evaluation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_model_evaluation_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_model_evaluation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_model_evaluation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_model_evaluation ::Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_model_evaluation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_model_evaluation(::Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_model_evaluation_client_stub.call_count - end - end - end - - def test_list_model_evaluations - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_model_evaluations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.stub :transcode_list_model_evaluations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_model_evaluations_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_model_evaluations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_model_evaluations parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_model_evaluations ::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_model_evaluations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.list_model_evaluations(::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_model_evaluations_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::AutoML::V1::AutoML::Rest::Client::Configuration, config - end -end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb deleted file mode 100644 index a8f7d67c1702..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb +++ /dev/null @@ -1,1257 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/automl/v1/service_pb" -require "google/cloud/automl/v1/automl" - -class ::Google::Cloud::AutoML::V1::AutoML::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_dataset - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - dataset = {} - - create_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_dataset, name - assert_kind_of ::Google::Cloud::AutoML::V1::CreateDatasetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::Dataset), request["dataset"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_dataset({ parent: parent, dataset: dataset }) 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 - c.create_dataset parent: parent, dataset: dataset 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 - c.create_dataset ::Google::Cloud::AutoML::V1::CreateDatasetRequest.new(parent: parent, dataset: dataset) 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 - c.create_dataset({ parent: parent, dataset: dataset }, 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 - c.create_dataset(::Google::Cloud::AutoML::V1::CreateDatasetRequest.new(parent: parent, dataset: dataset), 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, create_dataset_client_stub.call_rpc_count - end - end - - def test_get_dataset - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::Dataset.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_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_dataset, name - assert_kind_of ::Google::Cloud::AutoML::V1::GetDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_dataset({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_dataset name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_dataset ::Google::Cloud::AutoML::V1::GetDatasetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_dataset({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_dataset(::Google::Cloud::AutoML::V1::GetDatasetRequest.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_dataset_client_stub.call_rpc_count - end - end - - def test_list_datasets - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::ListDatasetsResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_datasets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_datasets, name - assert_kind_of ::Google::Cloud::AutoML::V1::ListDatasetsRequest, request - assert_equal "hello world", request["parent"] - 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_datasets_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_datasets({ parent: parent, 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 - c.list_datasets parent: parent, 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 - c.list_datasets ::Google::Cloud::AutoML::V1::ListDatasetsRequest.new(parent: parent, 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 - c.list_datasets({ parent: parent, 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 - c.list_datasets(::Google::Cloud::AutoML::V1::ListDatasetsRequest.new(parent: parent, 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_datasets_client_stub.call_rpc_count - end - end - - def test_update_dataset - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::Dataset.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - dataset = {} - update_mask = {} - - update_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_dataset, name - assert_kind_of ::Google::Cloud::AutoML::V1::UpdateDatasetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::Dataset), request["dataset"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_dataset({ dataset: dataset, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_dataset dataset: dataset, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_dataset ::Google::Cloud::AutoML::V1::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_dataset({ dataset: dataset, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.update_dataset(::Google::Cloud::AutoML::V1::UpdateDatasetRequest.new(dataset: dataset, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_dataset_client_stub.call_rpc_count - end - end - - def test_delete_dataset - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_dataset, name - assert_kind_of ::Google::Cloud::AutoML::V1::DeleteDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_dataset_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_dataset({ 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 - c.delete_dataset 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 - c.delete_dataset ::Google::Cloud::AutoML::V1::DeleteDatasetRequest.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 - c.delete_dataset({ 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 - c.delete_dataset(::Google::Cloud::AutoML::V1::DeleteDatasetRequest.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_dataset_client_stub.call_rpc_count - end - end - - def test_import_data - # 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_config = {} - - import_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_data, name - assert_kind_of ::Google::Cloud::AutoML::V1::ImportDataRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::InputConfig), request["input_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_data_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.import_data({ name: name, input_config: input_config }) 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 - c.import_data name: name, input_config: input_config 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 - c.import_data ::Google::Cloud::AutoML::V1::ImportDataRequest.new(name: name, input_config: input_config) 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 - c.import_data({ name: name, input_config: input_config }, 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 - c.import_data(::Google::Cloud::AutoML::V1::ImportDataRequest.new(name: name, input_config: input_config), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_data_client_stub.call_rpc_count - end - end - - def test_export_data - # 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" - output_config = {} - - export_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_data, name - assert_kind_of ::Google::Cloud::AutoML::V1::ExportDataRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::OutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_data_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.export_data({ name: name, output_config: output_config }) 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 - c.export_data name: name, output_config: output_config 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 - c.export_data ::Google::Cloud::AutoML::V1::ExportDataRequest.new(name: name, output_config: output_config) 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 - c.export_data({ name: name, output_config: output_config }, 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 - c.export_data(::Google::Cloud::AutoML::V1::ExportDataRequest.new(name: name, output_config: output_config), 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, export_data_client_stub.call_rpc_count - end - end - - def test_get_annotation_spec - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::AnnotationSpec.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_annotation_spec_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_annotation_spec, name - assert_kind_of ::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_annotation_spec_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_annotation_spec({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_annotation_spec name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_annotation_spec ::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_annotation_spec({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_annotation_spec(::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.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_annotation_spec_client_stub.call_rpc_count - end - end - - def test_create_model - # 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" - model = {} - - create_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_model, name - assert_kind_of ::Google::Cloud::AutoML::V1::CreateModelRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::Model), request["model"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_model({ parent: parent, model: model }) 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 - c.create_model parent: parent, model: model 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 - c.create_model ::Google::Cloud::AutoML::V1::CreateModelRequest.new(parent: parent, model: model) 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 - c.create_model({ parent: parent, model: model }, 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 - c.create_model(::Google::Cloud::AutoML::V1::CreateModelRequest.new(parent: parent, model: model), 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, create_model_client_stub.call_rpc_count - end - end - - def test_get_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::Model.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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_model, name - assert_kind_of ::Google::Cloud::AutoML::V1::GetModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_model({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_model name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_model ::Google::Cloud::AutoML::V1::GetModelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_model({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_model(::Google::Cloud::AutoML::V1::GetModelRequest.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_model_client_stub.call_rpc_count - end - end - - def test_list_models - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::ListModelsResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_models, name - assert_kind_of ::Google::Cloud::AutoML::V1::ListModelsRequest, request - assert_equal "hello world", request["parent"] - 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_models_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_models({ parent: parent, 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 - c.list_models parent: parent, 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 - c.list_models ::Google::Cloud::AutoML::V1::ListModelsRequest.new(parent: parent, 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 - c.list_models({ parent: parent, 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 - c.list_models(::Google::Cloud::AutoML::V1::ListModelsRequest.new(parent: parent, 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_models_client_stub.call_rpc_count - end - end - - def test_delete_model - # 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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_model, name - assert_kind_of ::Google::Cloud::AutoML::V1::DeleteModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_model({ 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 - c.delete_model 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 - c.delete_model ::Google::Cloud::AutoML::V1::DeleteModelRequest.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 - c.delete_model({ 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 - c.delete_model(::Google::Cloud::AutoML::V1::DeleteModelRequest.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_model_client_stub.call_rpc_count - end - end - - def test_update_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::Model.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. - model = {} - update_mask = {} - - update_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_model, name - assert_kind_of ::Google::Cloud::AutoML::V1::UpdateModelRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::Model), request["model"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_model({ model: model, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_model model: model, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_model ::Google::Cloud::AutoML::V1::UpdateModelRequest.new(model: model, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_model({ model: model, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.update_model(::Google::Cloud::AutoML::V1::UpdateModelRequest.new(model: model, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_model_client_stub.call_rpc_count - end - end - - def test_deploy_model - # 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. - image_object_detection_model_deployment_metadata = {} - name = "hello world" - - deploy_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deploy_model, name - assert_kind_of ::Google::Cloud::AutoML::V1::DeployModelRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::ImageObjectDetectionModelDeploymentMetadata), request["image_object_detection_model_deployment_metadata"] - assert_equal :image_object_detection_model_deployment_metadata, request.model_deployment_metadata - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deploy_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.deploy_model({ image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, 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 - c.deploy_model image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, 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 - c.deploy_model ::Google::Cloud::AutoML::V1::DeployModelRequest.new(image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, 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 - c.deploy_model({ image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, 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 - c.deploy_model(::Google::Cloud::AutoML::V1::DeployModelRequest.new(image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata, 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_model_client_stub.call_rpc_count - end - end - - def test_undeploy_model - # 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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undeploy_model, name - assert_kind_of ::Google::Cloud::AutoML::V1::UndeployModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undeploy_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.undeploy_model({ 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 - c.undeploy_model 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 - c.undeploy_model ::Google::Cloud::AutoML::V1::UndeployModelRequest.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 - c.undeploy_model({ 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 - c.undeploy_model(::Google::Cloud::AutoML::V1::UndeployModelRequest.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_model_client_stub.call_rpc_count - end - end - - def test_export_model - # 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" - output_config = {} - - export_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_model, name - assert_kind_of ::Google::Cloud::AutoML::V1::ExportModelRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::ModelExportOutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_model_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.export_model({ name: name, output_config: output_config }) 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 - c.export_model name: name, output_config: output_config 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 - c.export_model ::Google::Cloud::AutoML::V1::ExportModelRequest.new(name: name, output_config: output_config) 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 - c.export_model({ name: name, output_config: output_config }, 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 - c.export_model(::Google::Cloud::AutoML::V1::ExportModelRequest.new(name: name, output_config: output_config), 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, export_model_client_stub.call_rpc_count - end - end - - def test_get_model_evaluation - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::ModelEvaluation.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_model_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_model_evaluation, name - assert_kind_of ::Google::Cloud::AutoML::V1::GetModelEvaluationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_model_evaluation_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_model_evaluation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_model_evaluation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_model_evaluation ::Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_model_evaluation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_model_evaluation(::Google::Cloud::AutoML::V1::GetModelEvaluationRequest.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_model_evaluation_client_stub.call_rpc_count - end - end - - def test_list_model_evaluations - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_model_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_model_evaluations, name - assert_kind_of ::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest, request - assert_equal "hello world", request["parent"] - 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_model_evaluations_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_model_evaluations({ parent: parent, 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 - c.list_model_evaluations parent: parent, 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 - c.list_model_evaluations ::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new(parent: parent, 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 - c.list_model_evaluations({ parent: parent, 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 - c.list_model_evaluations(::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new(parent: parent, 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_model_evaluations_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::AutoML::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::AutoML::V1::AutoML::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::AutoML::V1::AutoML::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::AutoML::V1::AutoML::Operations, client.operations_client - end -end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb deleted file mode 100644 index 7cc57a046005..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/automl/v1/prediction_service_pb" -require "google/cloud/automl/v1/prediction_service_services_pb" -require "google/cloud/automl/v1/prediction_service" - -class ::Google::Cloud::AutoML::V1::PredictionService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::PredictionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) 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 - c.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, 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 - c.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), 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 - c = ::Google::Cloud::AutoML::V1::PredictionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::AutoML::V1::PredictionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::AutoML::V1::PredictionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::AutoML::V1::PredictionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::PredictionService::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::AutoML::V1::PredictionService::Operations::Configuration, config - end -end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb deleted file mode 100644 index f5f666866b67..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/automl/v1/prediction_service" - -class ::Google::Cloud::AutoML::V1::PredictionService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", model: "value2" - assert_equal "projects/value0/locations/value1/models/value2", path - end - end -end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb deleted file mode 100644 index 5a2ef57b39ce..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb +++ /dev/null @@ -1,212 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/automl/v1/prediction_service_pb" -require "google/cloud/automl/v1/prediction_service/rest" - - -class ::Google::Cloud::AutoML::V1::PredictionService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_predict - # Create test objects. - client_result = ::Google::Cloud::AutoML::V1::PredictResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - payload = {} - params = {} - - predict_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::PredictionService::Rest::ServiceStub.stub :transcode_predict_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, predict_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.predict({ name: name, payload: payload, params: params }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.predict name: name, payload: payload, params: params do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.predict ::Google::Cloud::AutoML::V1::PredictRequest.new(name: name, payload: payload, params: params) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.predict({ name: name, payload: payload, params: params }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.predict(::Google::Cloud::AutoML::V1::PredictRequest.new(name: name, payload: payload, params: params), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, predict_client_stub.call_count - end - end - end - - def test_batch_predict - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - input_config = {} - output_config = {} - params = {} - - batch_predict_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AutoML::V1::PredictionService::Rest::ServiceStub.stub :transcode_batch_predict_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_predict_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_predict({ name: name, input_config: input_config, output_config: output_config, params: params }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_predict name: name, input_config: input_config, output_config: output_config, params: params do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_predict ::Google::Cloud::AutoML::V1::BatchPredictRequest.new(name: name, input_config: input_config, output_config: output_config, params: params) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_predict({ name: name, input_config: input_config, output_config: output_config, params: params }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_predict(::Google::Cloud::AutoML::V1::BatchPredictRequest.new(name: name, input_config: input_config, output_config: output_config, params: params), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_predict_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client::Configuration, config - end -end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb deleted file mode 100644 index 74ff6f3b9cb7..000000000000 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb +++ /dev/null @@ -1,249 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/automl/v1/prediction_service_pb" -require "google/cloud/automl/v1/prediction_service" - -class ::Google::Cloud::AutoML::V1::PredictionService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_predict - # Create GRPC objects. - grpc_response = ::Google::Cloud::AutoML::V1::PredictResponse.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" - payload = {} - params = {} - - predict_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :predict, name - assert_kind_of ::Google::Cloud::AutoML::V1::PredictRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::ExamplePayload), request["payload"] - assert_equal({}, request["params"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, predict_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.predict({ name: name, payload: payload, params: params }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.predict name: name, payload: payload, params: params do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.predict ::Google::Cloud::AutoML::V1::PredictRequest.new(name: name, payload: payload, params: params) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.predict({ name: name, payload: payload, params: params }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.predict(::Google::Cloud::AutoML::V1::PredictRequest.new(name: name, payload: payload, params: params), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, predict_client_stub.call_rpc_count - end - end - - def test_batch_predict - # 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_config = {} - output_config = {} - params = {} - - batch_predict_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_predict, name - assert_kind_of ::Google::Cloud::AutoML::V1::BatchPredictRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::BatchPredictInputConfig), request["input_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AutoML::V1::BatchPredictOutputConfig), request["output_config"] - assert_equal({}, request["params"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_predict_client_stub do - # Create client - c = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_predict({ name: name, input_config: input_config, output_config: output_config, params: params }) 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 - c.batch_predict name: name, input_config: input_config, output_config: output_config, params: params 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 - c.batch_predict ::Google::Cloud::AutoML::V1::BatchPredictRequest.new(name: name, input_config: input_config, output_config: output_config, params: params) 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 - c.batch_predict({ name: name, input_config: input_config, output_config: output_config, params: params }, 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 - c.batch_predict(::Google::Cloud::AutoML::V1::BatchPredictRequest.new(name: name, input_config: input_config, output_config: output_config, params: params), 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_predict_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::PredictionService::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::AutoML::V1::PredictionService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::AutoML::V1::PredictionService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::AutoML::V1::PredictionService::Operations, client.operations_client - end -end diff --git a/google-cloud-automl-v1/test/helper.rb b/google-cloud-automl-v1/test/helper.rb deleted file mode 100644 index 4fb6756ac7e2..000000000000 --- a/google-cloud-automl-v1/test/helper.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Load JUnit XML formatter from googleapis/ruby-common-tools to write -# tmp/reports/sponge_log.xml for Kokoro/TestGrid build health tracking. -if ENV["CI"] || ENV["KOKORO_JOB_NAME"] - begin - require "gapic/minitest_junit_preloader" - rescue LoadError - end -end - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/librarian.yaml b/librarian.yaml index b24a281f1776..cda4e0fd967e 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -470,18 +470,6 @@ libraries: ruby: wrapper_of: - v1:1.2 - - name: google-cloud-automl-v1 - version: 1.8.1 - apis: - - path: google/cloud/automl/v1 - ruby: - ruby_cloud_opts: - ruby-cloud-env-prefix: AUTOML - ruby-cloud-namespace-override: AutoMl=AutoML;Automl=AutoML - ruby-cloud-path-override: auto_ml=automl - ruby-cloud-yard-strict: "false" - keep: - - lib/google/cloud/automl/v1/_helpers.rb - name: google-cloud-automl-v1beta1 version: 0.19.1 apis: From 67f49a77c0801bd1b991d73c7cdc92fa74814d0f Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 18 Sep 2026 16:54:41 -0400 Subject: [PATCH 2/3] fix: restore version.rb for tombstone gemspec --- .../lib/google/cloud/automl/v1/version.rb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb new file mode 100644 index 000000000000..8589b9a2cd78 --- /dev/null +++ b/google-cloud-automl-v1/lib/google/cloud/automl/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 AutoML + module V1 + VERSION = "1.8.1" + end + end + end +end From 55b7caad2ee6b8ca54e3935b3f0d0d85c2d5da8c Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 18 Sep 2026 17:11:30 -0400 Subject: [PATCH 3/3] fix: use AutoML module name in gemspec --- google-cloud-automl-v1/google-cloud-automl-v1.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-automl-v1/google-cloud-automl-v1.gemspec b/google-cloud-automl-v1/google-cloud-automl-v1.gemspec index b46edf3bb612..f4731760b813 100644 --- a/google-cloud-automl-v1/google-cloud-automl-v1.gemspec +++ b/google-cloud-automl-v1/google-cloud-automl-v1.gemspec @@ -2,7 +2,7 @@ require File.expand_path("lib/google/cloud/automl/v1/version", __dir__) Gem::Specification.new do |gem| gem.name = "google-cloud-automl-v1" - gem.version = Google::Cloud::Automl::V1::VERSION + gem.version = Google::Cloud::AutoML::V1::VERSION gem.authors = ["Google LLC"] gem.email = "googleapis-packages@google.com" gem.description =