From 09ab5a9f8dff934568c215729d836af806105b92 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 18 Feb 2026 22:01:17 +0000 Subject: [PATCH 1/2] feat: adds endpointing sensitivity to streaming recognition features PiperOrigin-RevId: 871987204 Source-Link: https://github.com/googleapis/googleapis/commit/b2f57f3efafac433fc1f50b4aaf128bb117f6a47 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3d8601e1b1813be20ff9eb30e0f1871b5381e2bc Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwZWVjaC12Mi8uT3dsQm90LnlhbWwiLCJoIjoiM2Q4NjAxZTFiMTgxM2JlMjBmZjllYjMwZTBmMTg3MWI1MzgxZTJiYyJ9 --- .../google-cloud-speech-v2/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-speech-v2/.rubocop.yml | 33 + .../google-cloud-speech-v2/.toys.rb | 28 + .../google-cloud-speech-v2/.yardopts | 12 + .../google-cloud-speech-v2/AUTHENTICATION.md | 122 + .../google-cloud-speech-v2/CHANGELOG.md | 2 + .../google-cloud-speech-v2/Gemfile | 11 + .../google-cloud-speech-v2/LICENSE.md | 201 ++ .../google-cloud-speech-v2/README.md | 154 + .../google-cloud-speech-v2/Rakefile | 169 + .../gapic_metadata.json | 133 + .../google-cloud-speech-v2.gemspec | 29 + .../lib/google-cloud-speech-v2.rb | 21 + .../lib/google/cloud/speech/v2.rb | 45 + .../cloud/speech/v2/bindings_override.rb | 75 + .../google/cloud/speech/v2/cloud_speech_pb.rb | 134 + .../speech/v2/cloud_speech_services_pb.rb | 98 + .../cloud/speech/v2/locations_metadata_pb.rb | 48 + .../lib/google/cloud/speech/v2/rest.rb | 38 + .../lib/google/cloud/speech/v2/speech.rb | 56 + .../google/cloud/speech/v2/speech/client.rb | 2922 +++++++++++++++++ .../cloud/speech/v2/speech/credentials.rb | 51 + .../cloud/speech/v2/speech/operations.rb | 841 +++++ .../google/cloud/speech/v2/speech/paths.rb | 168 + .../lib/google/cloud/speech/v2/speech/rest.rb | 54 + .../cloud/speech/v2/speech/rest/client.rb | 2647 +++++++++++++++ .../cloud/speech/v2/speech/rest/operations.rb | 925 ++++++ .../speech/v2/speech/rest/service_stub.rb | 1435 ++++++++ .../lib/google/cloud/speech/v2/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++ .../google/cloud/speech/v2/cloud_speech.rb | 2086 ++++++++++++ .../cloud/speech/v2/locations_metadata.rb | 120 + .../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 | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../google-cloud-speech-v2/snippets/Gemfile | 32 + ...ippet_metadata_google.cloud.speech.v2.json | 935 ++++++ .../snippets/speech/batch_recognize.rb | 54 + .../snippets/speech/create_custom_class.rb | 54 + .../snippets/speech/create_phrase_set.rb | 54 + .../snippets/speech/create_recognizer.rb | 54 + .../snippets/speech/delete_custom_class.rb | 54 + .../snippets/speech/delete_phrase_set.rb | 54 + .../snippets/speech/delete_recognizer.rb | 54 + .../snippets/speech/get_config.rb | 47 + .../snippets/speech/get_custom_class.rb | 47 + .../snippets/speech/get_phrase_set.rb | 47 + .../snippets/speech/get_recognizer.rb | 47 + .../snippets/speech/list_custom_classes.rb | 51 + .../snippets/speech/list_phrase_sets.rb | 51 + .../snippets/speech/list_recognizers.rb | 51 + .../snippets/speech/recognize.rb | 47 + .../snippets/speech/streaming_recognize.rb | 56 + .../snippets/speech/undelete_custom_class.rb | 54 + .../snippets/speech/undelete_phrase_set.rb | 54 + .../snippets/speech/undelete_recognizer.rb | 54 + .../snippets/speech/update_config.rb | 47 + .../snippets/speech/update_custom_class.rb | 54 + .../snippets/speech/update_phrase_set.rb | 54 + .../snippets/speech/update_recognizer.rb | 54 + .../cloud/speech/v2/speech_operations_test.rb | 400 +++ .../cloud/speech/v2/speech_paths_test.rb | 127 + .../cloud/speech/v2/speech_rest_test.rb | 1335 ++++++++ .../google/cloud/speech/v2/speech_test.rb | 1662 ++++++++++ .../google-cloud-speech-v2/test/helper.rb | 25 + 75 files changed, 20255 insertions(+) create mode 100644 owl-bot-staging/google-cloud-speech-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-speech-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/helper.rb diff --git a/owl-bot-staging/google-cloud-speech-v2/.gitignore b/owl-bot-staging/google-cloud-speech-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json new file mode 100644 index 000000000000..a731ceb554c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "speech.googleapis.com", + "api_shortname": "speech", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest", + "distribution_name": "google-cloud-speech-v2", + "is_cloud": true, + "language": "ruby", + "name": "speech", + "name_pretty": "Cloud Speech-to-Text V2 API", + "product_documentation": "https://cloud.google.com/speech-to-text", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPEECH", + "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml new file mode 100644 index 000000000000..11a141b34f5b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-speech-v2.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-speech-v2.rb" diff --git a/owl-bot-staging/google-cloud-speech-v2/.toys.rb b/owl-bot-staging/google-cloud-speech-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.toys.rb @@ -0,0 +1,28 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/.yardopts b/owl-bot-staging/google-cloud-speech-v2/.yardopts new file mode 100644 index 000000000000..bbc8579c72a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Speech-to-Text V2 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..d5ea6bd0837e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-speech-v2 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-speech-v2 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/speech/v2" + +client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/speech/v2" + +::Google::Cloud::Speech::V2::Speech::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Speech::V2::Speech::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-speech-v2 +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/speech/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Speech::V2::Speech::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-speech-v2/Gemfile b/owl-bot-staging/google-cloud-speech-v2/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v2/LICENSE.md b/owl-bot-staging/google-cloud-speech-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-speech-v2/README.md b/owl-bot-staging/google-cloud-speech-v2/README.md new file mode 100644 index 000000000000..357f59f2dd7b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Speech-to-Text V2 API + +Converts audio to text by applying powerful neural network models. + +Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. + +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 Speech-to-Text V2 API. Most users should consider using +the main client gem, +[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-speech-v2 +``` + +## 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/speech.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/speech/v2" + +client = ::Google::Cloud::Speech::V2::Speech::Client.new +request = ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new # (request fields as keyword arguments...) +response = client.create_recognizer request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/speech-to-text) +for general usage information. + +## 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/speech/v2" +require "logger" + +client = ::Google::Cloud::Speech::V2::Speech::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.0+. + +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-speech`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-speech-v2`. +_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-speech`. +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-speech-v2`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-speech-v2/Rakefile b/owl-bot-staging/google-cloud-speech-v2/Rakefile new file mode 100644 index 000000000000..d2dc0b8f0e77 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/Rakefile @@ -0,0 +1,169 @@ +# 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 "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-speech-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPEECH_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPEECH_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/speech/v2/speech/credentials" + ::Google::Cloud::Speech::V2::Speech::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPEECH_PROJECT"] = project + ENV["SPEECH_TEST_PROJECT"] = project + ENV["SPEECH_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-speech-v2 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-speech-v2 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-speech-v2 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-speech-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-speech-v2" + header "google-cloud-speech-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-speech-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-speech-v2 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-speech-v2 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-speech-v2 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json new file mode 100644 index 000000000000..d420dfa5479a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json @@ -0,0 +1,133 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.speech.v2", + "libraryPackage": "::Google::Cloud::Speech::V2", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Speech::V2::Speech::Client", + "rpcs": { + "CreateRecognizer": { + "methods": [ + "create_recognizer" + ] + }, + "ListRecognizers": { + "methods": [ + "list_recognizers" + ] + }, + "GetRecognizer": { + "methods": [ + "get_recognizer" + ] + }, + "UpdateRecognizer": { + "methods": [ + "update_recognizer" + ] + }, + "DeleteRecognizer": { + "methods": [ + "delete_recognizer" + ] + }, + "UndeleteRecognizer": { + "methods": [ + "undelete_recognizer" + ] + }, + "Recognize": { + "methods": [ + "recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streaming_recognize" + ] + }, + "BatchRecognize": { + "methods": [ + "batch_recognize" + ] + }, + "GetConfig": { + "methods": [ + "get_config" + ] + }, + "UpdateConfig": { + "methods": [ + "update_config" + ] + }, + "CreateCustomClass": { + "methods": [ + "create_custom_class" + ] + }, + "ListCustomClasses": { + "methods": [ + "list_custom_classes" + ] + }, + "GetCustomClass": { + "methods": [ + "get_custom_class" + ] + }, + "UpdateCustomClass": { + "methods": [ + "update_custom_class" + ] + }, + "DeleteCustomClass": { + "methods": [ + "delete_custom_class" + ] + }, + "UndeleteCustomClass": { + "methods": [ + "undelete_custom_class" + ] + }, + "CreatePhraseSet": { + "methods": [ + "create_phrase_set" + ] + }, + "ListPhraseSets": { + "methods": [ + "list_phrase_sets" + ] + }, + "GetPhraseSet": { + "methods": [ + "get_phrase_set" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "update_phrase_set" + ] + }, + "DeletePhraseSet": { + "methods": [ + "delete_phrase_set" + ] + }, + "UndeletePhraseSet": { + "methods": [ + "undelete_phrase_set" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec b/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec new file mode 100644 index 000000000000..352e0bb5d42e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/speech/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-speech-v2" + gem.version = Google::Cloud::Speech::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." + gem.summary = "Converts audio to text by applying powerful neural network models." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb new file mode 100644 index 000000000000..ca01b088ebe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb @@ -0,0 +1,21 @@ +# 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/speech/v2" diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb new file mode 100644 index 000000000000..e2a296043fce --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb @@ -0,0 +1,45 @@ +# 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/speech/v2/speech" +require "google/cloud/speech/v2/version" + +module Google + module Cloud + module Speech + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/speech/v2" + # client = ::Google::Cloud::Speech::V2::Speech::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/speech/v2" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/speech/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb new file mode 100644 index 000000000000..a89a217f0dc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb @@ -0,0 +1,75 @@ +# 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" + +module Google + module Cloud + module Speech + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/speech/v2/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module V2 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Speech"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb new file mode 100644 index 000000000000..74ff2fb094b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v2/cloud_speech.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n)google/cloud/speech/v2/cloud_speech.proto\x12\x16google.cloud.speech.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbe\x01\n\x17\x43reateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rrecognizer_id\x18\x03 \x01(\t\x12\x38\n\x06parent\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 speech.googleapis.com/Recognizer\"\xe7\x0c\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0e\n\x06method\x18\x04 \x01(\t\x12<\n\x0ckms_key_name\x18\x06 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12K\n\x14kms_key_version_name\x18\x07 \x01(\tB-\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12P\n\x17\x62\x61tch_recognize_request\x18\x08 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeRequestH\x00\x12T\n\x19\x63reate_recognizer_request\x18\t \x01(\x0b\x32/.google.cloud.speech.v2.CreateRecognizerRequestH\x00\x12T\n\x19update_recognizer_request\x18\n \x01(\x0b\x32/.google.cloud.speech.v2.UpdateRecognizerRequestH\x00\x12T\n\x19\x64\x65lete_recognizer_request\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.DeleteRecognizerRequestH\x00\x12X\n\x1bundelete_recognizer_request\x18\x0c \x01(\x0b\x32\x31.google.cloud.speech.v2.UndeleteRecognizerRequestH\x00\x12W\n\x1b\x63reate_custom_class_request\x18\r \x01(\x0b\x32\x30.google.cloud.speech.v2.CreateCustomClassRequestH\x00\x12W\n\x1bupdate_custom_class_request\x18\x0e \x01(\x0b\x32\x30.google.cloud.speech.v2.UpdateCustomClassRequestH\x00\x12W\n\x1b\x64\x65lete_custom_class_request\x18\x0f \x01(\x0b\x32\x30.google.cloud.speech.v2.DeleteCustomClassRequestH\x00\x12[\n\x1dundelete_custom_class_request\x18\x10 \x01(\x0b\x32\x32.google.cloud.speech.v2.UndeleteCustomClassRequestH\x00\x12S\n\x19\x63reate_phrase_set_request\x18\x11 \x01(\x0b\x32..google.cloud.speech.v2.CreatePhraseSetRequestH\x00\x12S\n\x19update_phrase_set_request\x18\x12 \x01(\x0b\x32..google.cloud.speech.v2.UpdatePhraseSetRequestH\x00\x12S\n\x19\x64\x65lete_phrase_set_request\x18\x13 \x01(\x0b\x32..google.cloud.speech.v2.DeletePhraseSetRequestH\x00\x12W\n\x1bundelete_phrase_set_request\x18\x14 \x01(\x0b\x32\x30.google.cloud.speech.v2.UndeletePhraseSetRequestH\x00\x12P\n\x15update_config_request\x18\x15 \x01(\x0b\x32+.google.cloud.speech.v2.UpdateConfigRequestB\x02\x18\x01H\x00\x12\x18\n\x10progress_percent\x18\x16 \x01(\x05\x12R\n\x18\x62\x61tch_recognize_metadata\x18\x17 \x01(\x0b\x32..google.cloud.speech.v2.BatchRecognizeMetadataH\x01\x42\t\n\x07requestB\n\n\x08metadata\"\x90\x01\n\x16ListRecognizersRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"k\n\x17ListRecognizersResponse\x12\x37\n\x0brecognizers\x18\x01 \x03(\x0b\x32\".google.cloud.speech.v2.Recognizer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\"\x9e\x01\n\x17UpdateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8d\x01\n\x17\x44\x65leteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"x\n\x19UndeleteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xc5\x07\n\nRecognizer\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x14\n\x05model\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x0elanguage_codes\x18\x11 \x03(\tB\x05\x18\x01\xe0\x41\x01\x12M\n\x1a\x64\x65\x66\x61ult_recognition_config\x18\x06 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12H\n\x0b\x61nnotations\x18\x07 \x03(\x0b\x32\x33.google.cloud.speech.v2.Recognizer.AnnotationsEntry\x12<\n\x05state\x18\x08 \x01(\x0e\x32(.google.cloud.speech.v2.Recognizer.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\x0f \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x10 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:j\xea\x41g\n speech.googleapis.com/Recognizer\x12@projects/{project}/locations/{location}/recognizers/{recognizer}R\x01\x01\"\x1a\n\x18\x41utoDetectDecodingConfig\"\xf0\x02\n\x16\x45xplicitDecodingConfig\x12S\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32<.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13\x61udio_channel_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xbe\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\t\n\x05MULAW\x10\x02\x12\x08\n\x04\x41LAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x08\n\x04\x46LAC\x10\x06\x12\x07\n\x03MP3\x10\x07\x12\x0c\n\x08OGG_OPUS\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x0b\n\x07MP4_AAC\x10\n\x12\x0b\n\x07M4A_AAC\x10\x0b\x12\x0b\n\x07MOV_AAC\x10\x0c\"Z\n\x18SpeakerDiarizationConfig\x12\x1e\n\x11min_speaker_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11max_speaker_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"0\n\x12\x43ustomPromptConfig\x12\x1a\n\rcustom_prompt\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xc7\x04\n\x13RecognitionFeatures\x12\x18\n\x10profanity_filter\x18\x01 \x01(\x08\x12 \n\x18\x65nable_word_time_offsets\x18\x02 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x04 \x01(\x08\x12!\n\x19\x65nable_spoken_punctuation\x18\x0e \x01(\x08\x12\x1c\n\x14\x65nable_spoken_emojis\x18\x0f \x01(\x08\x12X\n\x12multi_channel_mode\x18\x11 \x01(\x0e\x32<.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode\x12L\n\x12\x64iarization_config\x18\t \x01(\x0b\x32\x30.google.cloud.speech.v2.SpeakerDiarizationConfig\x12\x18\n\x10max_alternatives\x18\x10 \x01(\x05\x12M\n\x14\x63ustom_prompt_config\x18\x12 \x01(\x0b\x32*.google.cloud.speech.v2.CustomPromptConfigB\x03\xe0\x41\x01\"\\\n\x10MultiChannelMode\x12\"\n\x1eMULTI_CHANNEL_MODE_UNSPECIFIED\x10\x00\x12$\n SEPARATE_RECOGNITION_PER_CHANNEL\x10\x01\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v2.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\"1\n\x11TranslationConfig\x12\x1c\n\x0ftarget_language\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbf\x02\n\x10SpeechAdaptation\x12Q\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet\x12;\n\x0e\x63ustom_classes\x18\x02 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x1a\x9a\x01\n\x13\x41\x64\x61ptationPhraseSet\x12:\n\nphrase_set\x18\x01 \x01(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSetH\x00\x12>\n\x11inline_phrase_set\x18\x02 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetH\x00\x42\x07\n\x05value\">\n\x0e\x44\x65noiserConfig\x12\x15\n\rdenoise_audio\x18\x01 \x01(\x08\x12\x15\n\rsnr_threshold\x18\x02 \x01(\x02\"\xe4\x04\n\x11RecognitionConfig\x12P\n\x14\x61uto_decoding_config\x18\x07 \x01(\x0b\x32\x30.google.cloud.speech.v2.AutoDetectDecodingConfigH\x00\x12R\n\x18\x65xplicit_decoding_config\x18\x08 \x01(\x0b\x32..google.cloud.speech.v2.ExplicitDecodingConfigH\x00\x12\x12\n\x05model\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0elanguage_codes\x18\n \x03(\tB\x03\xe0\x41\x01\x12=\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32+.google.cloud.speech.v2.RecognitionFeatures\x12<\n\nadaptation\x18\x06 \x01(\x0b\x32(.google.cloud.speech.v2.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.TranscriptNormalizationB\x03\xe0\x41\x01\x12J\n\x12translation_config\x18\x0f \x01(\x0b\x32).google.cloud.speech.v2.TranslationConfigB\x03\xe0\x41\x01\x12\x44\n\x0f\x64\x65noiser_config\x18\x10 \x01(\x0b\x32&.google.cloud.speech.v2.DenoiserConfigB\x03\xe0\x41\x01\x42\x11\n\x0f\x64\x65\x63oding_config\"\xee\x01\n\x10RecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x11\n\x07\x63ontent\x18\x05 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x9d\x01\n\x1bRecognitionResponseMetadata\x12\x1c\n\nrequest_id\x18\t \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x38\n\x15total_billed_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1b\n\x06prompt\x18\n \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_prompt\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v2.WordInfo\"\xa3\x01\n\x08WordInfo\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x15\n\rspeaker_label\x18\x06 \x01(\t\"\xcc\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\x9c\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x03 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\xf9\x04\n\x1cStreamingRecognitionFeatures\x12$\n\x1c\x65nable_voice_activity_events\x18\x01 \x01(\x08\x12\x17\n\x0finterim_results\x18\x02 \x01(\x08\x12i\n\x16voice_activity_timeout\x18\x03 \x01(\x0b\x32I.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout\x12q\n\x17\x65ndpointing_sensitivity\x18\x08 \x01(\x0e\x32K.google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivityB\x03\xe0\x41\x01\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xb2\x01\n\x16\x45ndpointingSensitivity\x12\'\n#ENDPOINTING_SENSITIVITY_UNSPECIFIED\x10\x00\x12$\n ENDPOINTING_SENSITIVITY_STANDARD\x10\x01\x12&\n\"ENDPOINTING_SENSITIVITY_SUPERSHORT\x10\x02\x12!\n\x1d\x45NDPOINTING_SENSITIVITY_SHORT\x10\x03\"\xdf\x01\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfigB\x03\xe0\x41\x02\x12/\n\x0b\x63onfig_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12P\n\x12streaming_features\x18\x02 \x01(\x0b\x32\x34.google.cloud.speech.v2.StreamingRecognitionFeatures\"\xcf\x01\n\x19StreamingRecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12N\n\x10streaming_config\x18\x06 \x01(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionConfigH\x00\x12\x0f\n\x05\x61udio\x18\x05 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x88\x04\n\x15\x42\x61tchRecognizeRequest\x12<\n\nrecognizer\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x05\x66iles\x18\x03 \x03(\x0b\x32\x32.google.cloud.speech.v2.BatchRecognizeFileMetadata\x12R\n\x19recognition_output_config\x18\x06 \x01(\x0b\x32/.google.cloud.speech.v2.RecognitionOutputConfig\x12]\n\x13processing_strategy\x18\x07 \x01(\x0e\x32@.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy\"O\n\x12ProcessingStrategy\x12#\n\x1fPROCESSING_STRATEGY_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44YNAMIC_BATCHING\x10\x01\"\x1e\n\x0fGcsOutputConfig\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x14\n\x12InlineOutputConfig\"\x1e\n\x1cNativeOutputFileFormatConfig\"\x1b\n\x19VttOutputFileFormatConfig\"\x1b\n\x19SrtOutputFileFormatConfig\"\xda\x01\n\x12OutputFormatConfig\x12\x44\n\x06native\x18\x01 \x01(\x0b\x32\x34.google.cloud.speech.v2.NativeOutputFileFormatConfig\x12>\n\x03vtt\x18\x02 \x01(\x0b\x32\x31.google.cloud.speech.v2.VttOutputFileFormatConfig\x12>\n\x03srt\x18\x03 \x01(\x0b\x32\x31.google.cloud.speech.v2.SrtOutputFileFormatConfig\"\x86\x02\n\x17RecognitionOutputConfig\x12\x44\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\'.google.cloud.speech.v2.GcsOutputConfigH\x00\x12L\n\x16inline_response_config\x18\x02 \x01(\x0b\x32*.google.cloud.speech.v2.InlineOutputConfigH\x00\x12M\n\x14output_format_config\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v2.OutputFormatConfigB\x03\xe0\x41\x01\x42\x08\n\x06output\"\x82\x02\n\x16\x42\x61tchRecognizeResponse\x12L\n\x07results\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeResponse.ResultsEntry\x12\x38\n\x15total_billed_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a`\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.speech.v2.BatchRecognizeFileResult:\x02\x38\x01\"\xa0\x01\n\x15\x42\x61tchRecognizeResults\x12@\n\x07results\x18\x01 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"Q\n\x12\x43loudStorageResult\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x16\n\x0evtt_format_uri\x18\x02 \x01(\t\x12\x16\n\x0esrt_format_uri\x18\x03 \x01(\t\"}\n\x0cInlineResult\x12\x41\n\ntranscript\x18\x01 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResults\x12\x14\n\x0cvtt_captions\x18\x02 \x01(\t\x12\x14\n\x0csrt_captions\x18\x03 \x01(\t\"\xf1\x02\n\x18\x42\x61tchRecognizeFileResult\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x08metadata\x18\x03 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\x12J\n\x14\x63loud_storage_result\x18\x05 \x01(\x0b\x32*.google.cloud.speech.v2.CloudStorageResultH\x00\x12=\n\rinline_result\x18\x06 \x01(\x0b\x32$.google.cloud.speech.v2.InlineResultH\x00\x12\x0f\n\x03uri\x18\x01 \x01(\tB\x02\x18\x01\x12\x45\n\ntranscript\x18\x04 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResultsB\x02\x18\x01\x42\x08\n\x06result\"o\n#BatchRecognizeTranscriptionMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x0b\n\x03uri\x18\x03 \x01(\t\"\xfe\x01\n\x16\x42\x61tchRecognizeMetadata\x12i\n\x16transcription_metadata\x18\x01 \x03(\x0b\x32I.google.cloud.speech.v2.BatchRecognizeMetadata.TranscriptionMetadataEntry\x1ay\n\x1aTranscriptionMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata:\x02\x38\x01\"\xa7\x01\n\x1a\x42\x61tchRecognizeFileMetadata\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x0e\n\x0c\x61udio_source\"\xf4\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xc7\x03\n\x1aStreamingRecognizeResponse\x12\x43\n\x07results\x18\x06 \x03(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x03 \x01(\x0e\x32\x42.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType\x12\x36\n\x13speech_event_offset\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\x08metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\x85\x01\n\x0fSpeechEventType\x12!\n\x1dSPEECH_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\"\xe8\x01\n\x06\x43onfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:Q\xea\x41N\n\x1cspeech.googleapis.com/Config\x12.projects/{project}/locations/{location}/config\"F\n\x10GetConfigRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cspeech.googleapis.com/Config\"{\n\x13UpdateConfigRequest\x12\x33\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1e.google.cloud.speech.v2.ConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xad\x07\n\x0b\x43ustomClass\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05items\x18\x05 \x03(\x0b\x32-.google.cloud.speech.v2.CustomClass.ClassItem\x12=\n\x05state\x18\x0f \x01(\x0e\x32).google.cloud.speech.v2.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x34.google.cloud.speech.v2.CustomClass.AnnotationsEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:o\xea\x41l\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}R\x01\x01\"\xae\x07\n\tPhraseSet\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x07phrases\x18\x03 \x03(\x0b\x32(.google.cloud.speech.v2.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12;\n\x05state\x18\x0f \x01(\x0e\x32\'.google.cloud.speech.v2.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x32.google.cloud.speech.v2.PhraseSet.AnnotationsEntry\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:h\xea\x41\x65\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}R\x01\x01\"\xc5\x01\n\x18\x43reateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\x0f\x63ustom_class_id\x18\x03 \x01(\t\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\"\x92\x01\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"\xa2\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8f\x01\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"z\n\x1aUndeleteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xbb\x01\n\x16\x43reatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rphrase_set_id\x18\x03 \x01(\t\x12\x37\n\x06parent\x18\x04 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\"\x8f\x01\n\x15ListPhraseSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"i\n\x16ListPhraseSetsResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v2.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\x9c\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8b\x01\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"v\n\x18UndeletePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t2\xbf%\n\x06Speech\x12\xec\x01\n\x10\x43reateRecognizer\x12/.google.cloud.speech.v2.CreateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x1fparent,recognizer,recognizer_id\x82\xd3\xe4\x93\x02=\"//v2/{parent=projects/*/locations/*}/recognizers:\nrecognizer\x12\xb4\x01\n\x0fListRecognizers\x12..google.cloud.speech.v2.ListRecognizersRequest\x1a/.google.cloud.speech.v2.ListRecognizersResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2/{parent=projects/*/locations/*}/recognizers\x12\xa1\x01\n\rGetRecognizer\x12,.google.cloud.speech.v2.GetRecognizerRequest\x1a\".google.cloud.speech.v2.Recognizer\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2/{name=projects/*/locations/*/recognizers/*}\x12\xee\x01\n\x10UpdateRecognizer\x12/.google.cloud.speech.v2.UpdateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x16recognizer,update_mask\x82\xd3\xe4\x93\x02H2:/v2/{recognizer.name=projects/*/locations/*/recognizers/*}:\nrecognizer\x12\xc4\x01\n\x10\x44\x65leteRecognizer\x12/.google.cloud.speech.v2.DeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"`\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2/{name=projects/*/locations/*/recognizers/*}\x12\xd4\x01\n\x12UndeleteRecognizer\x12\x31.google.cloud.speech.v2.UndeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v2/{name=projects/*/locations/*/recognizers/*}:undelete:\x01*\x12\xf9\x01\n\tRecognize\x12(.google.cloud.speech.v2.RecognizeRequest\x1a).google.cloud.speech.v2.RecognizeResponse\"\x96\x01\xda\x41%recognizer,config,config_mask,content\xda\x41!recognizer,config,config_mask,uri\x82\xd3\xe4\x93\x02\x44\"?/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v2.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v2.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x12\x84\x02\n\x0e\x42\x61tchRecognize\x12-.google.cloud.speech.v2.BatchRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41+\n\x16\x42\x61tchRecognizeResponse\x12\x11OperationMetadata\xda\x41#recognizer,config,config_mask,files\x82\xd3\xe4\x93\x02I\"D/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize:\x01*\x12\x8e\x01\n\tGetConfig\x12(.google.cloud.speech.v2.GetConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2/{name=projects/*/locations/*/config}\x12\xb1\x01\n\x0cUpdateConfig\x12+.google.cloud.speech.v2.UpdateConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"T\xda\x41\x12\x63onfig,update_mask\x82\xd3\xe4\x93\x02\x39\x32//v2/{config.name=projects/*/locations/*/config}:\x06\x63onfig\x12\xf7\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v2.CreateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x41\"1/v2/{parent=projects/*/locations/*}/customClasses:\x0c\x63ustom_class\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v2.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v2.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{parent=projects/*/locations/*}/customClasses\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v2.GetCustomClassRequest\x1a#.google.cloud.speech.v2.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{name=projects/*/locations/*/customClasses/*}\x12\xf9\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v2.UpdateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v2/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xc9\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v2.DeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v2/{name=projects/*/locations/*/customClasses/*}\x12\xd9\x01\n\x13UndeleteCustomClass\x12\x32.google.cloud.speech.v2.UndeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v2/{name=projects/*/locations/*/customClasses/*}:undelete:\x01*\x12\xe8\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v2.CreatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02<\"./v2/{parent=projects/*/locations/*}/phraseSets:\nphrase_set\x12\xb0\x01\n\x0eListPhraseSets\x12-.google.cloud.speech.v2.ListPhraseSetsRequest\x1a..google.cloud.speech.v2.ListPhraseSetsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v2/{parent=projects/*/locations/*}/phraseSets\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v2.GetPhraseSetRequest\x1a!.google.cloud.speech.v2.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xea\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v2.UpdatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xc0\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v2.DeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xd0\x01\n\x11UndeletePhraseSet\x12\x30.google.cloud.speech.v2.UndeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v2/{name=projects/*/locations/*/phraseSets/*}:undelete:\x01*\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x03\n\x1a\x63om.google.cloud.speech.v2B\x10\x43loudSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Speech + module V2 + CreateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateRecognizerRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OperationMetadata").msgclass + ListRecognizersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersRequest").msgclass + ListRecognizersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersResponse").msgclass + GetRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetRecognizerRequest").msgclass + UpdateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateRecognizerRequest").msgclass + DeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteRecognizerRequest").msgclass + UndeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteRecognizerRequest").msgclass + Recognizer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer").msgclass + Recognizer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer.State").enummodule + AutoDetectDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AutoDetectDecodingConfig").msgclass + ExplicitDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig").msgclass + ExplicitDecodingConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding").enummodule + SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeakerDiarizationConfig").msgclass + CustomPromptConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomPromptConfig").msgclass + RecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures").msgclass + RecognitionFeatures::MultiChannelMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode").enummodule + TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization").msgclass + TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization.Entry").msgclass + TranslationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranslationConfig").msgclass + SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation").msgclass + SpeechAdaptation::AdaptationPhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet").msgclass + DenoiserConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DenoiserConfig").msgclass + RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionConfig").msgclass + RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeRequest").msgclass + RecognitionResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionResponseMetadata").msgclass + SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionAlternative").msgclass + WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.WordInfo").msgclass + SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionResult").msgclass + RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeResponse").msgclass + StreamingRecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures").msgclass + StreamingRecognitionFeatures::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout").msgclass + StreamingRecognitionFeatures::EndpointingSensitivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivity").enummodule + StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass + StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass + BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass + BatchRecognizeRequest::ProcessingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy").enummodule + GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GcsOutputConfig").msgclass + InlineOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineOutputConfig").msgclass + NativeOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.NativeOutputFileFormatConfig").msgclass + VttOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.VttOutputFileFormatConfig").msgclass + SrtOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SrtOutputFileFormatConfig").msgclass + OutputFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OutputFormatConfig").msgclass + RecognitionOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionOutputConfig").msgclass + BatchRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResponse").msgclass + BatchRecognizeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResults").msgclass + CloudStorageResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CloudStorageResult").msgclass + InlineResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineResult").msgclass + BatchRecognizeFileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileResult").msgclass + BatchRecognizeTranscriptionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata").msgclass + BatchRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeMetadata").msgclass + BatchRecognizeFileMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileMetadata").msgclass + StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionResult").msgclass + StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse").msgclass + StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType").enummodule + Config = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Config").msgclass + GetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetConfigRequest").msgclass + UpdateConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateConfigRequest").msgclass + CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass").msgclass + CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.ClassItem").msgclass + CustomClass::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.State").enummodule + PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet").msgclass + PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.Phrase").msgclass + PhraseSet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.State").enummodule + CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateCustomClassRequest").msgclass + ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesRequest").msgclass + ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesResponse").msgclass + GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetCustomClassRequest").msgclass + UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateCustomClassRequest").msgclass + DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteCustomClassRequest").msgclass + UndeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteCustomClassRequest").msgclass + CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreatePhraseSetRequest").msgclass + ListPhraseSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsRequest").msgclass + ListPhraseSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsResponse").msgclass + GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetPhraseSetRequest").msgclass + UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdatePhraseSetRequest").msgclass + DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeletePhraseSetRequest").msgclass + UndeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeletePhraseSetRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb new file mode 100644 index 000000000000..5a22ae3fcf4a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb @@ -0,0 +1,98 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/speech/v2/cloud_speech.proto for package 'google.cloud.speech.v2' +# Original file comments: +# 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 +# +# 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/speech/v2/cloud_speech_pb' + +module Google + module Cloud + module Speech + module V2 + module Speech + # Enables speech transcription and resource management. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.speech.v2.Speech' + + # Creates a [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :CreateRecognizer, ::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Google::Longrunning::Operation + # Lists Recognizers. + rpc :ListRecognizers, ::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Google::Cloud::Speech::V2::ListRecognizersResponse + # Returns the requested + # [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + # exist. + rpc :GetRecognizer, ::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Google::Cloud::Speech::V2::Recognizer + # Updates the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :UpdateRecognizer, ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Google::Longrunning::Operation + # Deletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :DeleteRecognizer, ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Google::Longrunning::Operation + # Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :UndeleteRecognizer, ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Google::Longrunning::Operation + # Performs synchronous Speech recognition: receive results after all audio + # has been sent and processed. + rpc :Recognize, ::Google::Cloud::Speech::V2::RecognizeRequest, ::Google::Cloud::Speech::V2::RecognizeResponse + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V2::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V2::StreamingRecognizeResponse) + # Performs batch asynchronous speech recognition: send a request with N + # audio files and receive a long running operation that can be polled to see + # when the transcriptions are finished. + rpc :BatchRecognize, ::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Google::Longrunning::Operation + # Returns the requested [Config][google.cloud.speech.v2.Config]. + rpc :GetConfig, ::Google::Cloud::Speech::V2::GetConfigRequest, ::Google::Cloud::Speech::V2::Config + # Updates the [Config][google.cloud.speech.v2.Config]. + rpc :UpdateConfig, ::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Google::Cloud::Speech::V2::Config + # Creates a [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :CreateCustomClass, ::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Google::Longrunning::Operation + # Lists CustomClasses. + rpc :ListCustomClasses, ::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Google::Cloud::Speech::V2::ListCustomClassesResponse + # Returns the requested + # [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :GetCustomClass, ::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Google::Cloud::Speech::V2::CustomClass + # Updates the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :UpdateCustomClass, ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Google::Longrunning::Operation + # Deletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :DeleteCustomClass, ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Google::Longrunning::Operation + # Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :UndeleteCustomClass, ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Google::Longrunning::Operation + # Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :CreatePhraseSet, ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Google::Longrunning::Operation + # Lists PhraseSets. + rpc :ListPhraseSets, ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Google::Cloud::Speech::V2::ListPhraseSetsResponse + # Returns the requested + # [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :GetPhraseSet, ::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Google::Cloud::Speech::V2::PhraseSet + # Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Google::Longrunning::Operation + # Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :DeletePhraseSet, ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Google::Longrunning::Operation + # Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :UndeletePhraseSet, ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb new file mode 100644 index 000000000000..364f8dbcd6b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v2/locations_metadata.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/speech/v2/locations_metadata.proto\x12\x16google.cloud.speech.v2\"6\n\x0cModelFeature\x12\x0f\n\x07\x66\x65\x61ture\x18\x01 \x01(\t\x12\x15\n\rrelease_state\x18\x02 \x01(\t\"L\n\rModelFeatures\x12;\n\rmodel_feature\x18\x01 \x03(\x0b\x32$.google.cloud.speech.v2.ModelFeature\"\xbe\x01\n\rModelMetadata\x12P\n\x0emodel_features\x18\x01 \x03(\x0b\x32\x38.google.cloud.speech.v2.ModelMetadata.ModelFeaturesEntry\x1a[\n\x12ModelFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelFeatures:\x02\x38\x01\"\xae\x01\n\x10LanguageMetadata\x12\x44\n\x06models\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.LanguageMetadata.ModelsEntry\x1aT\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelMetadata:\x02\x38\x01\"\xc8\x01\n\x0e\x41\x63\x63\x65ssMetadata\x12N\n\x0f\x63onstraint_type\x18\x01 \x01(\x0e\x32\x35.google.cloud.speech.v2.AccessMetadata.ConstraintType\"f\n\x0e\x43onstraintType\x12\x1f\n\x1b\x43ONSTRAINT_TYPE_UNSPECIFIED\x10\x00\x12\x33\n/RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT\x10\x01\"\x91\x01\n\x11LocationsMetadata\x12;\n\tlanguages\x18\x01 \x01(\x0b\x32(.google.cloud.speech.v2.LanguageMetadata\x12?\n\x0f\x61\x63\x63\x65ss_metadata\x18\x02 \x01(\x0b\x32&.google.cloud.speech.v2.AccessMetadataBj\n\x1a\x63om.google.cloud.speech.v2B\x16LocationsMetadataProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Speech + module V2 + ModelFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeature").msgclass + ModelFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeatures").msgclass + ModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelMetadata").msgclass + LanguageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LanguageMetadata").msgclass + AccessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata").msgclass + AccessMetadata::ConstraintType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata.ConstraintType").enummodule + LocationsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LocationsMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb new file mode 100644 index 000000000000..9f0d92b6e97b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb @@ -0,0 +1,38 @@ +# 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/speech/v2/speech/rest" +require "google/cloud/speech/v2/bindings_override" +require "google/cloud/speech/v2/version" + +module Google + module Cloud + module Speech + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/speech/v2/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb new file mode 100644 index 000000000000..5a66d0bd8b48 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb @@ -0,0 +1,56 @@ +# 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/speech/v2/version" + +require "google/cloud/speech/v2/speech/credentials" +require "google/cloud/speech/v2/speech/paths" +require "google/cloud/speech/v2/speech/operations" +require "google/cloud/speech/v2/speech/client" +require "google/cloud/speech/v2/speech/rest" + +module Google + module Cloud + module Speech + module V2 + ## + # Enables speech transcription and resource management. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/speech/v2/speech" + # client = ::Google::Cloud::Speech::V2::Speech::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/speech/v2/speech/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module Speech + end + end + end + end +end + +helper_path = ::File.join __dir__, "speech", "helpers.rb" +require "google/cloud/speech/v2/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb new file mode 100644 index 000000000000..eddbc08258d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb @@ -0,0 +1,2922 @@ +# 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/speech/v2/cloud_speech_pb" +require "google/cloud/location" + +module Google + module Cloud + module Speech + module V2 + module Speech + ## + # Client for the Speech service. + # + # Enables speech transcription and resource management. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V2::Speech::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V2::Speech::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", "Speech", "V2"] + 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.timeout = 5000.0 + default_config.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 Speech 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::Speech::V2::Speech::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 + @speech_stub.universe_domain + end + + ## + # Create a new Speech client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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/speech/v2/cloud_speech_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 + + @speech_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Speech::V2::Speech::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 + ) + + @speech_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 + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @speech_stub.endpoint + config.universe_domain = @speech_stub.universe_domain + config.logger = @speech_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Speech::V2::Speech::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @speech_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload create_recognizer(request, options = nil) + # Pass arguments to `create_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) + # Pass arguments to `create_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the Recognizer, but do not + # actually create it. + # @param recognizer_id [::String] + # The ID to use for the Recognizer, which will become the final component of + # the Recognizer's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this Recognizer will be created. + # The expected format is `projects/{project}/locations/{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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new + # + # # Call the create_recognizer method. + # result = client.create_recognizer 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :create_recognizer, 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 + + ## + # Lists Recognizers. + # + # @overload list_recognizers(request, options = nil) + # Pass arguments to `list_recognizers` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_recognizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of Recognizers to list. The expected + # format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of Recognizers to return. The service may return fewer + # than this value. If unspecified, at most 5 Recognizers will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new + # + # # Call the list_recognizers method. + # result = client.list_recognizers 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::Speech::V2::Recognizer. + # p item + # end + # + def list_recognizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest + + # Converts hash 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_recognizers.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::Speech::V2::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_recognizers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_recognizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :list_recognizers, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @speech_stub, :list_recognizers, 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 + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + # exist. + # + # @overload get_recognizer(request, options = nil) + # Pass arguments to `get_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(name: nil) + # Pass arguments to `get_recognizer` via keyword arguments. Note that at + # least one keyword argument is 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 name of the Recognizer to retrieve. The expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::Recognizer] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::Recognizer] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new + # + # # Call the get_recognizer method. + # result = client.get_recognizer request + # + # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. + # p result + # + def get_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_recognizer, 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload update_recognizer(request, options = nil) + # Pass arguments to `update_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to update. + # + # The Recognizer's `name` field is used to identify the Recognizer to update. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire Recognizer resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated Recognizer, but do not + # actually update it. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new + # + # # Call the update_recognizer method. + # result = client.update_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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.recognizer&.name + header_params["recognizer.name"] = request.recognizer.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_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_recognizer, 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload delete_recognizer(request, options = nil) + # Pass arguments to `delete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_recognizer` via keyword arguments. Note that at + # least one keyword argument is 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 name of the Recognizer to delete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted Recognizer, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the Recognizer is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new + # + # # Call the delete_recognizer method. + # result = client.delete_recognizer 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :delete_recognizer, 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 + + ## + # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload undelete_recognizer(request, options = nil) + # Pass arguments to `undelete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at + # least one keyword argument is 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 name of the Recognizer to undelete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted Recognizer, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new + # + # # Call the undelete_recognizer method. + # result = client.undelete_recognizer 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 undelete_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest + + # Converts hash 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.undelete_recognizer.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::Speech::V2::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.undelete_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :undelete_recognizer, 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 + + ## + # Performs synchronous Speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field + # can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the + # values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param content [::String] + # The audio data bytes encoded as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As + # with all bytes fields, proto buffers use a pure binary representation, + # whereas JSON representations use base64. + # + # Note: The following parameters are mutually exclusive: `content`, `uri`. 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 uri [::String] + # URI that points to a file that contains audio data bytes as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file + # must not be compressed (for example, gzip). Currently, only Google Cloud + # Storage URIs are supported, which must be specified in the following + # format: `gs://bucket_name/object_name` (other URI formats return + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + # information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following parameters are mutually exclusive: `uri`, `content`. 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::RecognizeResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest + + # Converts hash 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.recognize.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::Speech::V2::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.recognizer + header_params["recognizer"] = request.recognizer + 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.recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :recognize, 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 + + ## + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Speech::V2::StreamingRecognizeRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_recognize method to start streaming. + # output = client.streaming_recognize input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_recognize request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V2::StreamingRecognizeRequest + end + + # Converts hash 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.streaming_recognize.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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.streaming_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :streaming_recognize, 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 + + ## + # Performs batch asynchronous speech recognition: send a request with N + # audio files and receive a long running operation that can be polled to see + # when the transcriptions are finished. + # + # @overload batch_recognize(request, options = nil) + # Pass arguments to `batch_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) + # Pass arguments to `batch_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override + # the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all given fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] + # Audio files with file metadata for ASR. + # The maximum number of files allowed to be specified is 15. + # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] + # Configuration options for where to output the transcripts of each file. + # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] + # Processing strategy to use for this request. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new + # + # # Call the batch_recognize method. + # result = client.batch_recognize 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_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest + + # Converts hash 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_recognize.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::Speech::V2::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.recognizer + header_params["recognizer"] = request.recognizer + 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_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :batch_recognize, 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 + + ## + # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload get_config(request, options = nil) + # Pass arguments to `get_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_config(name: nil) + # Pass arguments to `get_config` via keyword arguments. Note that at + # least one keyword argument is 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 name of the config to retrieve. There is exactly one config + # resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetConfigRequest.new + # + # # Call the get_config method. + # result = client.get_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def get_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest + + # Converts hash 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_config.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::Speech::V2::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_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_config, 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload update_config(request, options = nil) + # Pass arguments to `update_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_config(config: nil, update_mask: nil) + # Pass arguments to `update_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V2::Config, ::Hash] + # Required. The config to update. + # + # The config's `name` field is used to identify the config to be updated. + # The expected format is `projects/{project}/locations/{location}/config`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new + # + # # Call the update_config method. + # result = client.update_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def update_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest + + # Converts hash 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_config.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::Speech::V2::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.config&.name + header_params["config.name"] = request.config.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_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_config, 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 {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the CustomClass, but do not + # actually create it. + # @param custom_class_id [::String] + # The ID to use for the CustomClass, which will become the final component of + # the CustomClass's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this CustomClass will be created. + # The expected format is `projects/{project}/locations/{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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :create_custom_class, 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 + + ## + # Lists CustomClasses. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of CustomClass resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Number of results per requests. A valid page_size ranges from 0 to 100 + # inclusive. If the page_size is zero or unspecified, a page size of 5 will + # be chosen. If the page size exceeds 100, it will be coerced down to 100. + # Note that a call might return fewer results than the requested page size. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must + # match the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes 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::Speech::V2::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest + + # Converts hash 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_custom_classes.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::Speech::V2::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_custom_classes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @speech_stub, :list_custom_classes, 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 + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is 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 name of the CustomClass to retrieve. The expected format is + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_custom_class, 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to update. + # + # The CustomClass's `name` field is used to identify the CustomClass to + # update. Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If empty, all fields are considered for + # update. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated CustomClass, but do + # not actually update it. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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.custom_class&.name + header_params["custom_class.name"] = request.custom_class.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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_custom_class, 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is 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 name of the CustomClass to delete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted CustomClass, but do + # not actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the CustomClass is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :delete_custom_class, 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 + + ## + # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload undelete_custom_class(request, options = nil) + # Pass arguments to `undelete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at + # least one keyword argument is 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 name of the CustomClass to undelete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted CustomClass, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new + # + # # Call the undelete_custom_class method. + # result = client.undelete_custom_class 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 undelete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest + + # Converts hash 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.undelete_custom_class.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::Speech::V2::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.undelete_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :undelete_custom_class, 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 + + ## + # Creates a {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the PhraseSet, but do not + # actually create it. + # @param phrase_set_id [::String] + # The ID to use for the PhraseSet, which will become the final component of + # the PhraseSet's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this PhraseSet will be created. + # The expected format is `projects/{project}/locations/{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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :create_phrase_set, 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 + + ## + # Lists PhraseSets. + # + # @overload list_phrase_sets(request, options = nil) + # Pass arguments to `list_phrase_sets` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of PhraseSet resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of PhraseSets to return. The service may return fewer + # than this value. If unspecified, at most 5 PhraseSets will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new + # + # # Call the list_phrase_sets method. + # result = client.list_phrase_sets 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::Speech::V2::PhraseSet. + # p item + # end + # + def list_phrase_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest + + # Converts hash 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_phrase_sets.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::Speech::V2::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_phrase_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_phrase_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :list_phrase_sets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @speech_stub, :list_phrase_sets, 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 + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is 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 name of the PhraseSet to retrieve. The expected format is + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_phrase_set, 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to update. + # + # The PhraseSet's `name` field is used to identify the PhraseSet to update. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire PhraseSet resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated PhraseSet, but do not + # actually update it. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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.phrase_set&.name + header_params["phrase_set.name"] = request.phrase_set.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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_phrase_set, 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is 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 name of the PhraseSet to delete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted PhraseSet, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the PhraseSet is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :delete_phrase_set, 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 + + ## + # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload undelete_phrase_set(request, options = nil) + # Pass arguments to `undelete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is 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 name of the PhraseSet to undelete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted PhraseSet, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new + # + # # Call the undelete_phrase_set method. + # result = client.undelete_phrase_set 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 undelete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest + + # Converts hash 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.undelete_phrase_set.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::Speech::V2::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.undelete_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :undelete_phrase_set, 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 Speech API. + # + # This class represents the configuration for Speech, + # 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::Speech::V2::Speech::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_recognizer to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V2::Speech::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.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::Speech::V2::Speech::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. + # * `: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 = "speech.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 Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :create_recognizer + ## + # RPC-specific configuration for `list_recognizers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_recognizers + ## + # RPC-specific configuration for `get_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recognizer + ## + # RPC-specific configuration for `update_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :update_recognizer + ## + # RPC-specific configuration for `delete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_recognizer + ## + # RPC-specific configuration for `undelete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_recognizer + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `streaming_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_recognize + ## + # RPC-specific configuration for `batch_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_recognize + ## + # RPC-specific configuration for `get_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_config + ## + # RPC-specific configuration for `update_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_config + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + ## + # RPC-specific configuration for `undelete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_custom_class + ## + # RPC-specific configuration for `create_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `list_phrase_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_sets + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `undelete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_phrase_set + + # @private + def initialize parent_rpcs = nil + create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer + @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config + list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers + @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config + get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer + @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config + update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer + @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config + delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer + @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config + undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer + @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize + @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config + batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize + @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config + get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config + @get_config = ::Gapic::Config::Method.new get_config_config + update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config + @update_config = ::Gapic::Config::Method.new update_config_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class + @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets + @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set + @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb new file mode 100644 index 000000000000..815acecc565d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb @@ -0,0 +1,51 @@ +# 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 Speech + module V2 + module Speech + # Credentials for the Speech API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SPEECH_CREDENTIALS", + "SPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPEECH_CREDENTIALS_JSON", + "SPEECH_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb new file mode 100644 index 000000000000..7972b3add947 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb @@ -0,0 +1,841 @@ +# 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 Speech + module V2 + module Speech + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V2::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::Speech::V2::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::Speech::V2::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::Speech::V2::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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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. + # * `: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 = "speech.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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb new file mode 100644 index 000000000000..b1310528c078 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb @@ -0,0 +1,168 @@ +# 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 Speech + module V2 + module Speech + # Path helper methods for the Speech API. + module Paths + ## + # Create a fully-qualified Config resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/config` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def config_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/config" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified CustomClass resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @param project [String] + # @param location [String] + # @param custom_class [String] + # + # @return [::String] + def custom_class_path project:, location:, custom_class: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" + 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + ## + # Create a fully-qualified Recognizer resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/recognizers/{recognizer}` + # + # @param project [String] + # @param location [String] + # @param recognizer [String] + # + # @return [::String] + def recognizer_path project:, location:, recognizer: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/recognizers/#{recognizer}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb new file mode 100644 index 000000000000..c28a87547a1b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb @@ -0,0 +1,54 @@ +# 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/speech/v2/version" +require "google/cloud/speech/v2/bindings_override" + +require "google/cloud/speech/v2/speech/credentials" +require "google/cloud/speech/v2/speech/paths" +require "google/cloud/speech/v2/speech/rest/operations" +require "google/cloud/speech/v2/speech/rest/client" + +module Google + module Cloud + module Speech + module V2 + ## + # Enables speech transcription and resource management. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/speech/v2/speech/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module Speech + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/speech/v2/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb new file mode 100644 index 000000000000..5baef8881324 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb @@ -0,0 +1,2647 @@ +# 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/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/speech/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Speech + module V2 + module Speech + module Rest + ## + # REST client for the Speech service. + # + # Enables speech transcription and resource management. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V2::Speech::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V2::Speech::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", "Speech", "V2"] + 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.timeout = 5000.0 + default_config.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 Speech 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::Speech::V2::Speech::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 + @speech_stub.universe_domain + end + + ## + # Create a new Speech REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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::Speech::V2::Speech::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 + + @speech_stub = ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @speech_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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @speech_stub.endpoint + config.universe_domain = @speech_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @speech_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Speech::V2::Speech::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @speech_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload create_recognizer(request, options = nil) + # Pass arguments to `create_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) + # Pass arguments to `create_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the Recognizer, but do not + # actually create it. + # @param recognizer_id [::String] + # The ID to use for the Recognizer, which will become the final component of + # the Recognizer's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this Recognizer will be created. + # The expected format is `projects/{project}/locations/{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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new + # + # # Call the create_recognizer method. + # result = client.create_recognizer 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.create_recognizer 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 + + ## + # Lists Recognizers. + # + # @overload list_recognizers(request, options = nil) + # Pass arguments to `list_recognizers` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_recognizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of Recognizers to list. The expected + # format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of Recognizers to return. The service may return fewer + # than this value. If unspecified, at most 5 Recognizers will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new + # + # # Call the list_recognizers method. + # result = client.list_recognizers 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::Speech::V2::Recognizer. + # p item + # end + # + def list_recognizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest + + # Converts hash 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_recognizers.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::Speech::V2::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_recognizers.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_recognizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.list_recognizers request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_recognizers, "recognizers", 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 + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + # exist. + # + # @overload get_recognizer(request, options = nil) + # Pass arguments to `get_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(name: nil) + # Pass arguments to `get_recognizer` via keyword arguments. Note that at + # least one keyword argument is 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 name of the Recognizer to retrieve. The expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Recognizer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Recognizer] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new + # + # # Call the get_recognizer method. + # result = client.get_recognizer request + # + # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. + # p result + # + def get_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_recognizer 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload update_recognizer(request, options = nil) + # Pass arguments to `update_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to update. + # + # The Recognizer's `name` field is used to identify the Recognizer to update. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire Recognizer resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated Recognizer, but do not + # actually update it. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new + # + # # Call the update_recognizer method. + # result = client.update_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_recognizer 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload delete_recognizer(request, options = nil) + # Pass arguments to `delete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_recognizer` via keyword arguments. Note that at + # least one keyword argument is 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 name of the Recognizer to delete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted Recognizer, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the Recognizer is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new + # + # # Call the delete_recognizer method. + # result = client.delete_recognizer 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest + + # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.delete_recognizer 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 + + ## + # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload undelete_recognizer(request, options = nil) + # Pass arguments to `undelete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at + # least one keyword argument is 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 name of the Recognizer to undelete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted Recognizer, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new + # + # # Call the undelete_recognizer method. + # result = client.undelete_recognizer 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 undelete_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest + + # Converts hash 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.undelete_recognizer.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::Speech::V2::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.undelete_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.undelete_recognizer 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 + + ## + # Performs synchronous Speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field + # can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the + # values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param content [::String] + # The audio data bytes encoded as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As + # with all bytes fields, proto buffers use a pure binary representation, + # whereas JSON representations use base64. + # + # Note: The following parameters are mutually exclusive: `content`, `uri`. 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 uri [::String] + # URI that points to a file that contains audio data bytes as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file + # must not be compressed (for example, gzip). Currently, only Google Cloud + # Storage URIs are supported, which must be specified in the following + # format: `gs://bucket_name/object_name` (other URI formats return + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + # information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following parameters are mutually exclusive: `uri`, `content`. 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest + + # Converts hash 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.recognize.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::Speech::V2::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.recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.recognize 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 + + ## + # Performs batch asynchronous speech recognition: send a request with N + # audio files and receive a long running operation that can be polled to see + # when the transcriptions are finished. + # + # @overload batch_recognize(request, options = nil) + # Pass arguments to `batch_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) + # Pass arguments to `batch_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override + # the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all given fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] + # Audio files with file metadata for ASR. + # The maximum number of files allowed to be specified is 15. + # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] + # Configuration options for where to output the transcripts of each file. + # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] + # Processing strategy to use for this request. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new + # + # # Call the batch_recognize method. + # result = client.batch_recognize 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_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest + + # Converts hash 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_recognize.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::Speech::V2::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_recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.batch_recognize 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 + + ## + # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload get_config(request, options = nil) + # Pass arguments to `get_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_config(name: nil) + # Pass arguments to `get_config` via keyword arguments. Note that at + # least one keyword argument is 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 name of the config to retrieve. There is exactly one config + # resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetConfigRequest.new + # + # # Call the get_config method. + # result = client.get_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def get_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest + + # Converts hash 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_config.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::Speech::V2::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_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_config 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload update_config(request, options = nil) + # Pass arguments to `update_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_config(config: nil, update_mask: nil) + # Pass arguments to `update_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V2::Config, ::Hash] + # Required. The config to update. + # + # The config's `name` field is used to identify the config to be updated. + # The expected format is `projects/{project}/locations/{location}/config`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new + # + # # Call the update_config method. + # result = client.update_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def update_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest + + # Converts hash 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_config.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::Speech::V2::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_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_config 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 {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the CustomClass, but do not + # actually create it. + # @param custom_class_id [::String] + # The ID to use for the CustomClass, which will become the final component of + # the CustomClass's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this CustomClass will be created. + # The expected format is `projects/{project}/locations/{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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.create_custom_class 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 + + ## + # Lists CustomClasses. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of CustomClass resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Number of results per requests. A valid page_size ranges from 0 to 100 + # inclusive. If the page_size is zero or unspecified, a page size of 5 will + # be chosen. If the page size exceeds 100, it will be coerced down to 100. + # Note that a call might return fewer results than the requested page size. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} must + # match the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes 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::Speech::V2::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest + + # Converts hash 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_custom_classes.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::Speech::V2::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_custom_classes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.list_custom_classes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_custom_classes, "custom_classes", 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 + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is 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 name of the CustomClass to retrieve. The expected format is + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_custom_class 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to update. + # + # The CustomClass's `name` field is used to identify the CustomClass to + # update. Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If empty, all fields are considered for + # update. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated CustomClass, but do + # not actually update it. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_custom_class 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is 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 name of the CustomClass to delete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted CustomClass, but do + # not actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the CustomClass is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest + + # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.delete_custom_class 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 + + ## + # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload undelete_custom_class(request, options = nil) + # Pass arguments to `undelete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at + # least one keyword argument is 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 name of the CustomClass to undelete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted CustomClass, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new + # + # # Call the undelete_custom_class method. + # result = client.undelete_custom_class 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 undelete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest + + # Converts hash 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.undelete_custom_class.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::Speech::V2::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.undelete_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.undelete_custom_class 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 + + ## + # Creates a {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the PhraseSet, but do not + # actually create it. + # @param phrase_set_id [::String] + # The ID to use for the PhraseSet, which will become the final component of + # the PhraseSet's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this PhraseSet will be created. + # The expected format is `projects/{project}/locations/{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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.create_phrase_set 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 + + ## + # Lists PhraseSets. + # + # @overload list_phrase_sets(request, options = nil) + # Pass arguments to `list_phrase_sets` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of PhraseSet resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of PhraseSets to return. The service may return fewer + # than this value. If unspecified, at most 5 PhraseSets will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new + # + # # Call the list_phrase_sets method. + # result = client.list_phrase_sets 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::Speech::V2::PhraseSet. + # p item + # end + # + def list_phrase_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest + + # Converts hash 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_phrase_sets.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::Speech::V2::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_phrase_sets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_phrase_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.list_phrase_sets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_phrase_sets, "phrase_sets", 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 + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is 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 name of the PhraseSet to retrieve. The expected format is + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_phrase_set 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 + + ## + # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to update. + # + # The PhraseSet's `name` field is used to identify the PhraseSet to update. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire PhraseSet resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated PhraseSet, but do not + # actually update it. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_phrase_set 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is 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 name of the PhraseSet to delete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted PhraseSet, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the PhraseSet is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest + + # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.delete_phrase_set 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 + + ## + # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload undelete_phrase_set(request, options = nil) + # Pass arguments to `undelete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is 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 name of the PhraseSet to undelete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted PhraseSet, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @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/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new + # + # # Call the undelete_phrase_set method. + # result = client.undelete_phrase_set 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 undelete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest + + # Converts hash 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.undelete_phrase_set.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::Speech::V2::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.undelete_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.undelete_phrase_set 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 Speech REST API. + # + # This class represents the configuration for Speech 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::Speech::V2::Speech::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_recognizer to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V2::Speech::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.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. + # * `: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 = "speech.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + 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 Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :create_recognizer + ## + # RPC-specific configuration for `list_recognizers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_recognizers + ## + # RPC-specific configuration for `get_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recognizer + ## + # RPC-specific configuration for `update_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :update_recognizer + ## + # RPC-specific configuration for `delete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_recognizer + ## + # RPC-specific configuration for `undelete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_recognizer + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `batch_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_recognize + ## + # RPC-specific configuration for `get_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_config + ## + # RPC-specific configuration for `update_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_config + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + ## + # RPC-specific configuration for `undelete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_custom_class + ## + # RPC-specific configuration for `create_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `list_phrase_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_sets + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `undelete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_phrase_set + + # @private + def initialize parent_rpcs = nil + create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer + @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config + list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers + @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config + get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer + @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config + update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer + @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config + delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer + @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config + undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer + @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize + @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config + get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config + @get_config = ::Gapic::Config::Method.new get_config_config + update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config + @update_config = ::Gapic::Config::Method.new update_config_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class + @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets + @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set + @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb new file mode 100644 index 000000000000..f2d7c9d11500 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb @@ -0,0 +1,925 @@ +# 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 Speech + module V2 + module Speech + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V2::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::Speech::V2::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::Speech::V2::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::Speech::V2::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 + + ## + # 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. + # * `: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 = "speech.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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + 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 + + ## + # @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: "/v2/{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: "/v2/{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: "/v2/{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: "/v2/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb new file mode 100644 index 000000000000..643afd7c54c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb @@ -0,0 +1,1435 @@ +# 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/speech/v2/cloud_speech_pb" + +module Google + module Cloud + module Speech + module V2 + module Speech + module Rest + ## + # REST service stub for the Speech 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_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] + # 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_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_recognizer_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_recognizer", + 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 list_recognizers REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] + # 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::Speech::V2::ListRecognizersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::ListRecognizersResponse] + # A result object deserialized from the server's reply + def list_recognizers request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_recognizers_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_recognizers", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.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_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] + # 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::Speech::V2::Recognizer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Recognizer] + # A result object deserialized from the server's reply + def get_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_recognizer_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_recognizer", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::Recognizer.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_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_recognizer_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_recognizer", + 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_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] + # 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_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_recognizer_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_recognizer", + 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 undelete_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] + # 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 undelete_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_recognizer_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: "undelete_recognizer", + 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 recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] + # 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::Speech::V2::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::RecognizeResponse] + # A result object deserialized from the server's reply + def recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_recognize_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: "recognize", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::RecognizeResponse.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_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] + # 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_recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_recognize_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_recognize", + 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_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] + # 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::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # A result object deserialized from the server's reply + def get_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_config_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_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::Config.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_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] + # 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::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # A result object deserialized from the server's reply + def update_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_config_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_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::Config.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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] + # 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_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_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_custom_class", + 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 list_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] + # 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::Speech::V2::ListCustomClassesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::ListCustomClassesResponse] + # A result object deserialized from the server's reply + def list_custom_classes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_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_custom_classes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] + # 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::Speech::V2::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::CustomClass] + # A result object deserialized from the server's reply + def get_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_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_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::CustomClass.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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_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_custom_class", + 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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] + # 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_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_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_custom_class", + 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 undelete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] + # 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 undelete_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_custom_class_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: "undelete_custom_class", + 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 create_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] + # 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_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_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_phrase_set", + 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 list_phrase_sets REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] + # 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::Speech::V2::ListPhraseSetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::ListPhraseSetsResponse] + # A result object deserialized from the server's reply + def list_phrase_sets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_sets_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_phrase_sets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] + # 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::Speech::V2::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # A result object deserialized from the server's reply + def get_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_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_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::PhraseSet.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_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_phrase_set", + 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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] + # 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_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_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_phrase_set", + 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 undelete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] + # 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 undelete_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_phrase_set_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: "undelete_phrase_set", + 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 create_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] + # 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_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/recognizers", + body: "recognizer", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_recognizers REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] + # 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_recognizers_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/recognizers", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] + # 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_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] + # 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_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{recognizer.name}", + body: "recognizer", + matches: [ + ["recognizer.name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] + # 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_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{recognizer}:recognize", + body: "*", + matches: [ + ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] + # 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_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{recognizer}:batchRecognize", + body: "*", + matches: [ + ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] + # 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_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] + # 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_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{config.name}", + body: "config", + matches: [ + ["config.name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/customClasses", + body: "custom_class", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] + # 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_custom_classes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/customClasses", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{custom_class.name}", + body: "custom_class", + matches: [ + ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/phraseSets", + body: "phrase_set", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_phrase_sets REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] + # 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_phrase_sets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/phraseSets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{phrase_set.name}", + body: "phrase_set", + matches: [ + ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb new file mode 100644 index 000000000000..b3aeb607f80f --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb @@ -0,0 +1,28 @@ +# 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 Speech + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md new file mode 100644 index 000000000000..97cb89a70a74 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Speech-to-Text V2 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# 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. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!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. + # + # 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 + 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. + # @!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 + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# 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 + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb new file mode 100644 index 000000000000..727666e1d47d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb @@ -0,0 +1,2086 @@ +# 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 Speech + module V2 + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#create_recognizer CreateRecognizer} method. + # @!attribute [rw] recognizer + # @return [::Google::Cloud::Speech::V2::Recognizer] + # Required. The Recognizer to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the Recognizer, but do not + # actually create it. + # @!attribute [rw] recognizer_id + # @return [::String] + # The ID to use for the Recognizer, which will become the final component of + # the Recognizer's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location where this Recognizer will be created. + # The expected format is `projects/{project}/locations/{location}`. + class CreateRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of a long-running operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was created. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was last updated. + # @!attribute [rw] resource + # @return [::String] + # The resource path for the target of the operation. + # @!attribute [rw] method + # @return [::String] + # The method that triggered the operation. + # @!attribute [rw] kms_key_name + # @return [::String] + # The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the content of the Operation is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which content of the Operation is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + # @!attribute [rw] batch_recognize_request + # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest] + # The BatchRecognizeRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] create_recognizer_request + # @return [::Google::Cloud::Speech::V2::CreateRecognizerRequest] + # The CreateRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `create_recognizer_request`, `batch_recognize_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_recognizer_request + # @return [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] + # The UpdateRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_recognizer_request + # @return [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] + # The DeleteRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `delete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] undelete_recognizer_request + # @return [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] + # The UndeleteRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `undelete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] create_custom_class_request + # @return [::Google::Cloud::Speech::V2::CreateCustomClassRequest] + # The CreateCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `create_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_custom_class_request + # @return [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] + # The UpdateCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_custom_class_request + # @return [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] + # The DeleteCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `delete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] undelete_custom_class_request + # @return [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] + # The UndeleteCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `undelete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] create_phrase_set_request + # @return [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] + # The CreatePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `create_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_phrase_set_request + # @return [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] + # The UpdatePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_phrase_set_request + # @return [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] + # The DeletePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `delete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] undelete_phrase_set_request + # @return [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] + # The UndeletePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `undelete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_config_request + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Speech::V2::UpdateConfigRequest] + # The UpdateConfigRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_config_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] progress_percent + # @return [::Integer] + # The percent progress of the Operation. Values can range from 0-100. If the + # value is 100, then the operation is finished. + # @!attribute [rw] batch_recognize_metadata + # @return [::Google::Cloud::Speech::V2::BatchRecognizeMetadata] + # Metadata specific to the BatchRecognize method. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location of Recognizers to list. The expected + # format is `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Recognizers to return. The service may return fewer + # than this value. If unspecified, at most 5 Recognizers will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match + # the call that provided the page token. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether, or not, to show resources that have been deleted. + class ListRecognizersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. + # @!attribute [rw] recognizers + # @return [::Array<::Google::Cloud::Speech::V2::Recognizer>] + # The list of requested Recognizers. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::Speech::V2::ListRecognizersRequest#page_token page_token} to + # retrieve the next page. If this field is omitted, there are no subsequent + # pages. This token expires after 72 hours. + class ListRecognizersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_recognizer GetRecognizer} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Recognizer to retrieve. The expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. + class GetRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_recognizer UpdateRecognizer} method. + # @!attribute [rw] recognizer + # @return [::Google::Cloud::Speech::V2::Recognizer] + # Required. The Recognizer to update. + # + # The Recognizer's `name` field is used to identify the Recognizer to update. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire Recognizer resource. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the updated Recognizer, but do not + # actually update it. + class UpdateRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer DeleteRecognizer} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Recognizer to delete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the deleted Recognizer, but do not + # actually delete it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the Recognizer is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class DeleteRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer UndeleteRecognizer} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Recognizer to undelete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the undeleted Recognizer, but do + # not actually undelete it. + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class UndeleteRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Recognizer message. Stores recognition configuration and metadata. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the Recognizer. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the Recognizer. + # @!attribute [rw] display_name + # @return [::String] + # User-settable, human-readable name for the Recognizer. Must be 63 + # characters or less. + # @!attribute [rw] model + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. This field is now deprecated. Prefer the + # {::Google::Cloud::Speech::V2::RecognitionConfig#model `model`} field in the + # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. + # + # Which model to use for recognition requests. Select the model best suited + # to your domain to get best results. + # + # Guidance for choosing which model to use can be found in the [Transcription + # Models + # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + # and the models supported in each region can be found in the [Table Of + # Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # @!attribute [rw] language_codes + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # Optional. This field is now deprecated. Prefer the + # {::Google::Cloud::Speech::V2::RecognitionConfig#language_codes `language_codes`} + # field in the + # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. + # + # The language of the supplied audio as a + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # + # Supported languages for each model are listed in the [Table of Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # + # If additional languages are provided, recognition result will contain + # recognition in the most likely language detected. The recognition result + # will include the language tag of the language detected in the audio. + # When you create or update a Recognizer, these values are + # stored in normalized BCP-47 form. For example, "en-us" is stored as + # "en-US". + # @!attribute [rw] default_recognition_config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Default configuration to use for requests with this Recognizer. + # This can be overwritten by inline configuration in the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config RecognizeRequest.config} + # field. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V2::Recognizer::State] + # Output only. The Recognizer lifecycle state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this Recognizer was modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this Recognizer was requested for deletion. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this Recognizer will be purged. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this Recognizer is in the process of being + # updated. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the Recognizer is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which the Recognizer is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + class Recognizer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of states that define the lifecycle of a Recognizer. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # The Recognizer is active and ready for use. + ACTIVE = 2 + + # This Recognizer has been deleted. + DELETED = 4 + end + end + + # Automatically detected decoding parameters. + # Supported for the following encodings: + # + # * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container. + # + # * WAV_MULAW: 8-bit companded mulaw samples in a WAV container. + # + # * WAV_ALAW: 8-bit companded alaw samples in a WAV container. + # + # * RFC4867_5_AMR: AMR frames with an rfc4867.5 header. + # + # * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header. + # + # * FLAC: FLAC frames in the "native FLAC" container format. + # + # * MP3: MPEG audio frames with optional (ignored) ID3 metadata. + # + # * OGG_OPUS: Opus audio frames in an Ogg container. + # + # * WEBM_OPUS: Opus audio frames in a WebM container. + # + # * MP4_AAC: AAC audio frames in an MP4 container. + # + # * M4A_AAC: AAC audio frames in an M4A container. + # + # * MOV_AAC: AAC audio frames in an MOV container. + class AutoDetectDecodingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Explicitly specified decoding parameters. + # @!attribute [rw] encoding + # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig::AudioEncoding] + # Required. Encoding of the audio data sent for recognition. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Optional. Sample rate in Hertz of the audio data sent for recognition. + # Valid values are: 8000-48000, and 16000 is optimal. For best results, set + # the sampling rate of the audio source to 16000 Hz. If that's not possible, + # use the native sample rate of the audio source (instead of resampling). + # Note that this field is marked as OPTIONAL for backward compatibility + # reasons. It is (and has always been) effectively REQUIRED. + # @!attribute [rw] audio_channel_count + # @return [::Integer] + # Optional. Number of channels present in the audio data sent for + # recognition. Note that this field is marked as OPTIONAL for backward + # compatibility reasons. It is (and has always been) effectively REQUIRED. + # + # The maximum allowed value is 8. + class ExplicitDecodingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Supported audio data encodings. + module AudioEncoding + # Default value. This value is unused. + AUDIO_ENCODING_UNSPECIFIED = 0 + + # Headerless 16-bit signed little-endian PCM samples. + LINEAR16 = 1 + + # Headerless 8-bit companded mulaw samples. + MULAW = 2 + + # Headerless 8-bit companded alaw samples. + ALAW = 3 + + # AMR frames with an rfc4867.5 header. + AMR = 4 + + # AMR-WB frames with an rfc4867.5 header. + AMR_WB = 5 + + # FLAC frames in the "native FLAC" container format. + FLAC = 6 + + # MPEG audio frames with optional (ignored) ID3 metadata. + MP3 = 7 + + # Opus audio frames in an Ogg container. + OGG_OPUS = 8 + + # Opus audio frames in a WebM container. + WEBM_OPUS = 9 + + # AAC audio frames in an MP4 container. + MP4_AAC = 10 + + # AAC audio frames in an M4A container. + M4A_AAC = 11 + + # AAC audio frames in an MOV container. + MOV_AAC = 12 + end + end + + # Configuration to enable speaker diarization. + # @!attribute [rw] min_speaker_count + # @return [::Integer] + # Optional. The system automatically determines the number of speakers. This + # value is not currently used. + # @!attribute [rw] max_speaker_count + # @return [::Integer] + # Optional. The system automatically determines the number of speakers. This + # value is not currently used. + class SpeakerDiarizationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration to enable custom prompt in chirp3. + # @!attribute [rw] custom_prompt + # @return [::String] + # Optional. The custom instructions to override the existing instructions for + # chirp3. + class CustomPromptConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Available recognition features. + # @!attribute [rw] profanity_filter + # @return [::Boolean] + # If set to `true`, the server will attempt to filter out profanities, + # replacing all but the initial character in each filtered word with + # asterisks, for instance, "f***". If set to `false` or omitted, profanities + # won't be filtered out. + # @!attribute [rw] enable_word_time_offsets + # @return [::Boolean] + # If `true`, the top result includes a list of words and the start and end + # time offsets (timestamps) for those words. If `false`, no word-level time + # offset information is returned. The default is `false`. + # @!attribute [rw] enable_word_confidence + # @return [::Boolean] + # If `true`, the top result includes a list of words and the confidence for + # those words. If `false`, no word-level confidence information is returned. + # The default is `false`. + # @!attribute [rw] enable_automatic_punctuation + # @return [::Boolean] + # If `true`, adds punctuation to recognition result hypotheses. This feature + # is only available in select languages. The default `false` value does not + # add punctuation to result hypotheses. + # @!attribute [rw] enable_spoken_punctuation + # @return [::Boolean] + # The spoken punctuation behavior for the call. If `true`, replaces spoken + # punctuation with the corresponding symbols in the request. For example, + # "how are you question mark" becomes "how are you?". See + # https://cloud.google.com/speech-to-text/docs/spoken-punctuation for + # support. If `false`, spoken punctuation is not replaced. + # @!attribute [rw] enable_spoken_emojis + # @return [::Boolean] + # The spoken emoji behavior for the call. If `true`, adds spoken emoji + # formatting for the request. This will replace spoken emojis with the + # corresponding Unicode symbols in the final transcript. If `false`, spoken + # emojis are not replaced. + # @!attribute [rw] multi_channel_mode + # @return [::Google::Cloud::Speech::V2::RecognitionFeatures::MultiChannelMode] + # Mode for recognizing multi-channel audio. + # @!attribute [rw] diarization_config + # @return [::Google::Cloud::Speech::V2::SpeakerDiarizationConfig] + # Configuration to enable speaker diarization. To enable diarization, set + # this field to an empty SpeakerDiarizationConfig message. + # @!attribute [rw] max_alternatives + # @return [::Integer] + # Maximum number of recognition hypotheses to be returned. + # The server may return fewer than `max_alternatives`. + # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + # one. If omitted, will return a maximum of one. + # @!attribute [rw] custom_prompt_config + # @return [::Google::Cloud::Speech::V2::CustomPromptConfig] + # Optional. Configuration to enable custom prompt for chirp3. + class RecognitionFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options for how to recognize multi-channel audio. + module MultiChannelMode + # Default value for the multi-channel mode. If the audio contains + # multiple channels, only the first channel will be transcribed; other + # channels will be ignored. + MULTI_CHANNEL_MODE_UNSPECIFIED = 0 + + # If selected, each channel in the provided audio is transcribed + # independently. This cannot be selected if the selected + # {::Google::Cloud::Speech::V2::Recognizer#model model} is `latest_short`. + SEPARATE_RECOGNITION_PER_CHANNEL = 1 + end + end + + # Transcription normalization configuration. Use transcription normalization + # to automatically replace parts of the transcript with phrases of your + # choosing. For StreamingRecognize, this normalization only applies to stable + # partial transcripts (stability > 0.8) and final transcripts. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::Speech::V2::TranscriptNormalization::Entry>] + # A list of replacement entries. We will perform replacement with one entry + # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + # => "mountain dog"] will never be applied because we will always process the + # first entry before it. At most 100 entries. + class TranscriptNormalization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single replacement configuration. + # @!attribute [rw] search + # @return [::String] + # What to replace. Max length is 100 characters. + # @!attribute [rw] replace + # @return [::String] + # What to replace with. Max length is 100 characters. + # @!attribute [rw] case_sensitive + # @return [::Boolean] + # Whether the search is case sensitive. + class Entry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Translation configuration. Use to translate the given audio into text for the + # desired language. + # @!attribute [rw] target_language + # @return [::String] + # Required. The language code to translate to. + class TranslationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides "hints" to the speech recognizer to favor specific words and phrases + # in the results. PhraseSets can be specified as an inline resource, or a + # reference to an existing PhraseSet resource. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V2::SpeechAdaptation::AdaptationPhraseSet>] + # A list of inline or referenced PhraseSets. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] + # A list of inline CustomClasses. Existing CustomClass resources can be + # referenced directly in a PhraseSet. + class SpeechAdaptation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A biasing PhraseSet, which can be either a string referencing the name of + # an existing PhraseSets resource, or an inline definition of a PhraseSet. + # @!attribute [rw] phrase_set + # @return [::String] + # The name of an existing PhraseSet resource. The user must have read + # access to the resource and it must not be deleted. + # + # Note: The following fields are mutually exclusive: `phrase_set`, `inline_phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_phrase_set + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # An inline defined PhraseSet. + # + # Note: The following fields are mutually exclusive: `inline_phrase_set`, `phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AdaptationPhraseSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Denoiser config. May not be supported for all models and may + # have no effect. + # @!attribute [rw] denoise_audio + # @return [::Boolean] + # Denoise audio before sending to the transcription model. + # @!attribute [rw] snr_threshold + # @return [::Float] + # Signal-to-Noise Ratio (SNR) threshold for the denoiser. Here SNR means the + # loudness of the speech signal. Audio with an SNR below this threshold, + # meaning the speech is too quiet, will be prevented from being sent to the + # transcription model. + # + # If snr_threshold=0, no filtering will be applied. + class DenoiserConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides information to the Recognizer that specifies how to process the + # recognition request. + # @!attribute [rw] auto_decoding_config + # @return [::Google::Cloud::Speech::V2::AutoDetectDecodingConfig] + # Automatically detect decoding parameters. + # Preferred for supported formats. + # + # Note: The following fields are mutually exclusive: `auto_decoding_config`, `explicit_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] explicit_decoding_config + # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig] + # Explicitly specified decoding parameters. + # Required if using headerless PCM audio (linear16, mulaw, alaw). + # + # Note: The following fields are mutually exclusive: `explicit_decoding_config`, `auto_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] model + # @return [::String] + # Optional. Which model to use for recognition requests. Select the model + # best suited to your domain to get best results. + # + # Guidance for choosing which model to use can be found in the [Transcription + # Models + # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + # and the models supported in each region can be found in the [Table Of + # Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # Optional. The language of the supplied audio as a + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # Language tags are normalized to BCP-47 before they are used eg "en-us" + # becomes "en-US". + # + # Supported languages for each model are listed in the [Table of Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # + # If additional languages are provided, recognition result will contain + # recognition in the most likely language detected. The recognition result + # will include the language tag of the language detected in the audio. + # @!attribute [rw] features + # @return [::Google::Cloud::Speech::V2::RecognitionFeatures] + # Speech recognition features to enable. + # @!attribute [rw] adaptation + # @return [::Google::Cloud::Speech::V2::SpeechAdaptation] + # Speech adaptation context that weights recognizer predictions for specific + # words and phrases. + # @!attribute [rw] transcript_normalization + # @return [::Google::Cloud::Speech::V2::TranscriptNormalization] + # Optional. Use transcription normalization to automatically replace parts of + # the transcript with phrases of your choosing. For StreamingRecognize, this + # normalization only applies to stable partial transcripts (stability > 0.8) + # and final transcripts. + # @!attribute [rw] translation_config + # @return [::Google::Cloud::Speech::V2::TranslationConfig] + # Optional. Optional configuration used to automatically run translation on + # the given audio to the desired language for supported models. + # @!attribute [rw] denoiser_config + # @return [::Google::Cloud::Speech::V2::DenoiserConfig] + # Optional. Optional denoiser config. May not be supported for all models + # and may have no effect. + class RecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. Either + # `content` or `uri` must be supplied. Supplying both or neither returns + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content + # limits](https://cloud.google.com/speech-to-text/quotas#content). + # @!attribute [rw] recognizer + # @return [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field + # can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the + # values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @!attribute [rw] content + # @return [::String] + # The audio data bytes encoded as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As + # with all bytes fields, proto buffers use a pure binary representation, + # whereas JSON representations use base64. + # + # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @return [::String] + # URI that points to a file that contains audio data bytes as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file + # must not be compressed (for example, gzip). Currently, only Google Cloud + # Storage URIs are supported, which must be specified in the following + # format: `gs://bucket_name/object_name` (other URI formats return + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + # information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class RecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about the recognition request and response. + # @!attribute [rw] request_id + # @return [::String] + # Global request identifier auto-generated by the API. + # @!attribute [rw] total_billed_duration + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + # @!attribute [r] prompt + # @return [::String] + # Optional. Output only. Provides the prompt used for the recognition + # request. + class RecognitionResponseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Alternative hypotheses (a.k.a. n-best list). + # @!attribute [rw] transcript + # @return [::String] + # Transcript text representing the words that the user spoke. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is + # set to `true`. This field is not guaranteed to be accurate and users should + # not rely on it to be always provided. The default of 0.0 is a sentinel + # value indicating `confidence` was not set. + # @!attribute [rw] words + # @return [::Array<::Google::Cloud::Speech::V2::WordInfo>] + # A list of word-specific information for each recognized word. + # When the + # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} + # is set, you will see all the words from the beginning of the audio. + class SpeechRecognitionAlternative + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Word-specific information for recognized words. + # @!attribute [rw] start_offset + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the start of the spoken word. + # This field is only set if + # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} + # is `true` and only in the top hypothesis. This is an experimental feature + # and the accuracy of the time offset can vary. + # @!attribute [rw] end_offset + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the end of the spoken word. + # This field is only set if + # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} + # is `true` and only in the top hypothesis. This is an experimental feature + # and the accuracy of the time offset can vary. + # @!attribute [rw] word + # @return [::String] + # The word corresponding to this set of information. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is + # set to `true`. This field is not guaranteed to be accurate and users should + # not rely on it to be always provided. The default of 0.0 is a sentinel + # value indicating `confidence` was not set. + # @!attribute [rw] speaker_label + # @return [::String] + # A distinct label is assigned for every speaker within the audio. This field + # specifies which one of those speakers was detected to have spoken this + # word. `speaker_label` is set if + # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} + # is given and only in the top alternative. + class WordInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A speech recognition result corresponding to a portion of the audio. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses. These alternatives are + # ordered in terms of accuracy, with the top (first) alternative being the + # most probable, as ranked by the recognizer. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For `audio_channel_count` = `N`, its output values can range from `1` to + # `N`. + # @!attribute [rw] result_end_offset + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the beginning of the + # audio. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class SpeechRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to sequential + # portions of audio. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # Metadata about the recognition. + class RecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Available recognition features specific to streaming recognition requests. + # @!attribute [rw] enable_voice_activity_events + # @return [::Boolean] + # If `true`, responses with voice activity speech events will be returned as + # they are detected. + # @!attribute [rw] interim_results + # @return [::Boolean] + # Whether or not to stream interim results to the client. If set to true, + # interim results will be streamed to the client. Otherwise, only the final + # response will be streamed back. + # @!attribute [rw] voice_activity_timeout + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::VoiceActivityTimeout] + # If set, the server will automatically close the stream after the specified + # duration has elapsed after the last VOICE_ACTIVITY speech event has been + # sent. The field `voice_activity_events` must also be set to true. + # @!attribute [rw] endpointing_sensitivity + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::EndpointingSensitivity] + # Optional. Endpointing sensitivity for this stream. + class StreamingRecognitionFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Events that a timeout can be set on for voice activity. + # @!attribute [rw] speech_start_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream if no speech begins. If this is set and + # no speech is detected in this duration at the start of the stream, the + # server will close the stream. + # @!attribute [rw] speech_end_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream after speech ends. If this is set and no + # speech is detected in this duration after speech was detected, the server + # will close the stream. + class VoiceActivityTimeout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Endpointing sensitivity is intended for applications that want to minimize + # result latency, possibly at the expense of quality. Some utterances may be + # broken up into multiple fragments. + module EndpointingSensitivity + # If no value is specified, the values for + # ENDPOINTING_SENSITIVITY_STANDARD will be used. + ENDPOINTING_SENSITIVITY_UNSPECIFIED = 0 + + # Standard sensitivity, no optimization for latency. + ENDPOINTING_SENSITIVITY_STANDARD = 1 + + # Super short sensitivity, optimized for super short utterances like single + # words ("Yes", "No", "Hello", etc.) or a single phrase, command or short + # query (e.g. "check balance", "five dollars", "call Mom"). + ENDPOINTING_SENSITIVITY_SUPERSHORT = 2 + + # Short sensitivity, optimized for short utterances like single sentences. + # (e.g. "Remind me to call the dentist tomorrow morning at nine", + # "Navigate to the nearest coffee shop that is currently open") + ENDPOINTING_SENSITIVITY_SHORT = 3 + end + end + + # Provides configuration information for the StreamingRecognize request. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Required. Features and audio metadata to use for the Automatic Speech + # Recognition. This field in combination with the + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} that + # override the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} override + # the values in the Recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # Recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} + # completely overrides and replaces the config in the recognizer for this + # recognition request. + # @!attribute [rw] streaming_features + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures] + # Speech recognition features to enable specific to streaming audio + # recognition requests. + class StreamingRecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize StreamingRecognize} + # method. Multiple + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest StreamingRecognizeRequest} + # messages are sent in one call. + # + # If the {::Google::Cloud::Speech::V2::Recognizer Recognizer} referenced by + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} + # contains a fully specified request configuration then the stream may only + # contain messages with only + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. + # + # Otherwise the first message must contain a + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} and + # a + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#streaming_config streaming_config} + # message that together fully specify the request configuration and must not + # contain {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio}. All + # subsequent messages must only have + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. + # @!attribute [rw] recognizer + # @return [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionConfig] + # StreamingRecognitionConfig to be used in this recognition attempt. + # If provided, it will override the default RecognitionConfig stored in the + # Recognizer. + # + # Note: The following fields are mutually exclusive: `streaming_config`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] audio + # @return [::String] + # Inline audio bytes to be Recognized. + # Maximum size for this field is 15 KB per request. + # + # Note: The following fields are mutually exclusive: `audio`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class StreamingRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} + # method. + # @!attribute [rw] recognizer + # @return [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override + # the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all given fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata>] + # Audio files with file metadata for ASR. + # The maximum number of files allowed to be specified is 15. + # @!attribute [rw] recognition_output_config + # @return [::Google::Cloud::Speech::V2::RecognitionOutputConfig] + # Configuration options for where to output the transcripts of each file. + # @!attribute [rw] processing_strategy + # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] + # Processing strategy to use for this request. + class BatchRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible processing strategies for batch requests. + module ProcessingStrategy + # Default value for the processing strategy. The request is processed as + # soon as its received. + PROCESSING_STRATEGY_UNSPECIFIED = 0 + + # If selected, processes the request during lower utilization periods for a + # price discount. The request is fulfilled within 24 hours. + DYNAMIC_BATCHING = 1 + end + end + + # Output configurations for Cloud Storage. + # @!attribute [rw] uri + # @return [::String] + # The Cloud Storage URI prefix with which recognition results will be + # written. + class GcsOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations for inline response. + class InlineOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations for serialized `BatchRecognizeResults` protos. + class NativeOutputFileFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations for [WebVTT](https://www.w3.org/TR/webvtt1/) formatted + # subtitle file. + class VttOutputFileFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations [SubRip + # Text](https://www.matroska.org/technical/subtitles.html#srt-subtitles) + # formatted subtitle file. + class SrtOutputFileFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the format of the results stored to `output`. + # @!attribute [rw] native + # @return [::Google::Cloud::Speech::V2::NativeOutputFileFormatConfig] + # Configuration for the native output format. If this field is set or if no + # other output format field is set, then transcripts will be written to the + # sink in the native format. + # @!attribute [rw] vtt + # @return [::Google::Cloud::Speech::V2::VttOutputFileFormatConfig] + # Configuration for the VTT output format. If this field is set, then + # transcripts will be written to the sink in the VTT format. + # @!attribute [rw] srt + # @return [::Google::Cloud::Speech::V2::SrtOutputFileFormatConfig] + # Configuration for the SRT output format. If this field is set, then + # transcripts will be written to the sink in the SRT format. + class OutputFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration options for the output(s) of recognition. + # @!attribute [rw] gcs_output_config + # @return [::Google::Cloud::Speech::V2::GcsOutputConfig] + # If this message is populated, recognition results are written to the + # provided Google Cloud Storage URI. + # + # Note: The following fields are mutually exclusive: `gcs_output_config`, `inline_response_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_response_config + # @return [::Google::Cloud::Speech::V2::InlineOutputConfig] + # If this message is populated, recognition results are provided in the + # {::Google::Cloud::Speech::V2::BatchRecognizeResponse BatchRecognizeResponse} + # message of the Operation when completed. This is only supported when + # calling {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} + # with just one audio file. + # + # Note: The following fields are mutually exclusive: `inline_response_config`, `gcs_output_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] output_format_config + # @return [::Google::Cloud::Speech::V2::OutputFormatConfig] + # Optional. Configuration for the format of the results stored to `output`. + # If unspecified transcripts will be written in the `NATIVE` format only. + class RecognitionOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} that is + # packaged into a longrunning {::Google::Longrunning::Operation Operation}. + # @!attribute [rw] results + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeFileResult}] + # Map from filename to the final result for that file. + # @!attribute [rw] total_billed_duration + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + class BatchRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::BatchRecognizeFileResult] + class ResultsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Output type for Cloud Storage of BatchRecognize transcripts. Though this + # proto isn't returned in this API anywhere, the Cloud Storage transcripts will + # be this proto serialized and should be parsed as such. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to sequential + # portions of audio. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # Metadata about the recognition. + class BatchRecognizeResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Final results written to Cloud Storage. + # @!attribute [rw] uri + # @return [::String] + # The Cloud Storage URI to which recognition results were written. + # @!attribute [rw] vtt_format_uri + # @return [::String] + # The Cloud Storage URI to which recognition results were written as VTT + # formatted captions. This is populated only when `VTT` output is requested. + # @!attribute [rw] srt_format_uri + # @return [::String] + # The Cloud Storage URI to which recognition results were written as SRT + # formatted captions. This is populated only when `SRT` output is requested. + class CloudStorageResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Final results returned inline in the recognition response. + # @!attribute [rw] transcript + # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] + # The transcript for the audio file. + # @!attribute [rw] vtt_captions + # @return [::String] + # The transcript for the audio file as VTT formatted captions. This is + # populated only when `VTT` output is requested. + # @!attribute [rw] srt_captions + # @return [::String] + # The transcript for the audio file as SRT formatted captions. This is + # populated only when `SRT` output is requested. + class InlineResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Final results for a single file. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Error if one was encountered. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # @!attribute [rw] cloud_storage_result + # @return [::Google::Cloud::Speech::V2::CloudStorageResult] + # Recognition results written to Cloud Storage. This is + # populated only when + # {::Google::Cloud::Speech::V2::GcsOutputConfig GcsOutputConfig} is set in + # the + # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + # + # Note: The following fields are mutually exclusive: `cloud_storage_result`, `inline_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_result + # @return [::Google::Cloud::Speech::V2::InlineResult] + # Recognition results. This is populated only when + # {::Google::Cloud::Speech::V2::InlineOutputConfig InlineOutputConfig} is set in + # the + # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + # + # Note: The following fields are mutually exclusive: `inline_result`, `cloud_storage_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Deprecated. Use `cloud_storage_result.native_format_uri` instead. + # @!attribute [rw] transcript + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] + # Deprecated. Use `inline_result.transcript` instead. + class BatchRecognizeFileResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about transcription for a single file (for example, progress + # percent). + # @!attribute [rw] progress_percent + # @return [::Integer] + # How much of the file has been transcribed so far. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Error if one was encountered. + # @!attribute [rw] uri + # @return [::String] + # The Cloud Storage URI to which recognition results will be written. + class BatchRecognizeTranscriptionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Operation metadata for + # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}. + # @!attribute [rw] transcription_metadata + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata}] + # Map from provided filename to the transcription metadata for that file. + class BatchRecognizeMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata] + class TranscriptionMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata about a single file in a batch for BatchRecognize. + # @!attribute [rw] uri + # @return [::String] + # Cloud Storage URI for the audio file. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource as well as the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} at the + # request level. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} that + # override the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} override + # the values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} + # completely overrides and replaces the config in the recognizer for this + # recognition request. + class BatchRecognizeFileMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A streaming speech recognition result corresponding to a portion of the audio + # that is currently being processed. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses. These alternatives are + # ordered in terms of accuracy, with the top (first) alternative being the + # most probable, as ranked by the recognizer. + # @!attribute [rw] is_final + # @return [::Boolean] + # If `false`, this + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult} + # represents an interim result that may change. If `true`, this is the final + # time the speech service will return this particular + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult}, + # the recognizer will not return any further hypotheses for this portion of + # the transcript and corresponding audio. + # @!attribute [rw] stability + # @return [::Float] + # An estimate of the likelihood that the recognizer will not change its guess + # about this interim result. Values range from 0.0 (completely unstable) + # to 1.0 (completely stable). This field is only provided for interim results + # ({::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false`). + # The default of 0.0 is a sentinel value indicating `stability` was not set. + # @!attribute [rw] result_end_offset + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the beginning of the + # audio. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For + # `audio_channel_count` = `N`, its output values can range from `1` to `N`. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class StreamingRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StreamingRecognizeResponse` is the only message returned to the client by + # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` + # messages are streamed back to the client. If there is no recognizable + # audio then no messages are streamed back to the client. + # + # Here are some examples of `StreamingRecognizeResponse`s that might + # be returned while processing audio: + # + # 1. results { alternatives { transcript: "tube" } stability: 0.01 } + # + # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } + # + # 3. results { alternatives { transcript: "to be" } stability: 0.9 } + # results { alternatives { transcript: " or not to be" } stability: 0.01 } + # + # 4. results { alternatives { transcript: "to be or not to be" + # confidence: 0.92 } + # alternatives { transcript: "to bee or not to bee" } + # is_final: true } + # + # 5. results { alternatives { transcript: " that's" } stability: 0.01 } + # + # 6. results { alternatives { transcript: " that is" } stability: 0.9 } + # results { alternatives { transcript: " the question" } stability: 0.01 } + # + # 7. results { alternatives { transcript: " that is the question" + # confidence: 0.98 } + # alternatives { transcript: " that was the question" } + # is_final: true } + # + # Notes: + # + # - Only two of the above responses #4 and #7 contain final results; they are + # indicated by `is_final: true`. Concatenating these together generates the + # full transcript: "to be or not to be that is the question". + # + # - The others contain interim `results`. #3 and #6 contain two interim + # `results`: the first portion has a high stability and is less likely to + # change; the second portion has a low stability and is very likely to + # change. A UI designer might choose to show only high stability `results`. + # + # - The specific `stability` and `confidence` values shown above are only for + # illustrative purposes. Actual values may vary. + # + # - In each response, only one of these fields will be set: + # `error`, + # `speech_event_type`, or + # one or more (repeated) `results`. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V2::StreamingRecognitionResult>] + # This repeated list contains zero or more results that + # correspond to consecutive portions of the audio currently being processed. + # It contains zero or one + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`true` + # result (the newly settled portion), followed by zero or more + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false` + # results (the interim results). + # @!attribute [rw] speech_event_type + # @return [::Google::Cloud::Speech::V2::StreamingRecognizeResponse::SpeechEventType] + # Indicates the type of speech event. + # @!attribute [rw] speech_event_offset + # @return [::Google::Protobuf::Duration] + # Time offset between the beginning of the audio and event emission. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # Metadata about the recognition. + class StreamingRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of speech event. + module SpeechEventType + # No speech event specified. + SPEECH_EVENT_TYPE_UNSPECIFIED = 0 + + # This event indicates that the server has detected the end of the user's + # speech utterance and expects no additional speech. Therefore, the server + # will not process additional audio and will close the gRPC bidirectional + # stream. This event is only sent if there was a force cutoff due to + # silence being detected early. This event is only available through the + # `latest_short` {::Google::Cloud::Speech::V2::Recognizer#model model}. + END_OF_SINGLE_UTTERANCE = 1 + + # This event indicates that the server has detected the beginning of human + # voice activity in the stream. This event can be returned multiple times + # if speech starts and stops repeatedly throughout the stream. This event + # is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2 + + # This event indicates that the server has detected the end of human voice + # activity in the stream. This event can be returned multiple times if + # speech starts and stops repeatedly throughout the stream. This event is + # only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3 + end + end + + # Message representing the config for the Speech-to-Text API. This includes an + # optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys) + # with which incoming data will be encrypted. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The name of the config resource. There is exactly + # one config resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. An optional [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if + # present, will be used to encrypt Speech-to-Text resources at-rest. Updating + # this key will not encrypt existing resources using this key; only new + # resources will be encrypted using this key. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this resource was modified. + class Config + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_config GetConfig} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the config to retrieve. There is exactly one config + # resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + class GetConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_config UpdateConfig} method. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::Config] + # Required. The config to update. + # + # The config's `name` field is used to identify the config to be updated. + # The expected format is `projects/{project}/locations/{location}/config`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CustomClass for biasing in speech recognition. Used to define a set of words + # or phrases that represents a common concept or theme likely to appear in your + # audio, for example a list of passenger ship names. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the CustomClass. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the CustomClass. + # @!attribute [rw] display_name + # @return [::String] + # Optional. User-settable, human-readable name for the CustomClass. Must be + # 63 characters or less. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::Speech::V2::CustomClass::ClassItem>] + # A collection of class items. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V2::CustomClass::State] + # Output only. The CustomClass lifecycle state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this resource was modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource was requested for deletion. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource will be purged. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this CustomClass is in the process of being + # updated. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the CustomClass is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which the CustomClass is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + class CustomClass + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An item of the class. + # @!attribute [rw] value + # @return [::String] + # The class item's value. + class ClassItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of states that define the lifecycle of a CustomClass. + module State + # Unspecified state. This is only used/useful for distinguishing + # unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 2 + + # This CustomClass has been deleted. + DELETED = 4 + end + end + + # PhraseSet for biasing in speech recognition. A PhraseSet is used to provide + # "hints" to the speech recognizer to favor specific words and phrases in the + # results. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the PhraseSet. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the PhraseSet. + # @!attribute [rw] phrases + # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet::Phrase>] + # A list of word and phrases. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Positive value will increase the probability that a specific + # phrase will be recognized over other similar sounding phrases. The higher + # the boost, the higher the chance of false positive recognition as well. + # Valid `boost` values are between 0 (exclusive) and 20. We recommend using a + # binary search approach to finding the optimal value for your use case as + # well as adding phrases both with and without boost to your requests. + # @!attribute [rw] display_name + # @return [::String] + # User-settable, human-readable name for the PhraseSet. Must be 63 + # characters or less. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V2::PhraseSet::State] + # Output only. The PhraseSet lifecycle state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this resource was modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource was requested for deletion. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource will be purged. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this PhraseSet is in the process of being + # updated. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the PhraseSet is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which the PhraseSet is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + class PhraseSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A Phrase contains words and phrase "hints" so that the speech recognition + # is more likely to recognize them. This can be used to improve the accuracy + # for specific words and phrases, for example, if specific commands are + # typically spoken by the user. This can also be used to add additional words + # to the vocabulary of the recognizer. + # + # List items can also include CustomClass references containing groups of + # words that represent common concepts that occur in natural language. + # @!attribute [rw] value + # @return [::String] + # The phrase itself. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Overrides the boost set at the phrase set level. + # Positive value will increase the probability that a specific phrase will + # be recognized over other similar sounding phrases. The higher the boost, + # the higher the chance of false positive recognition as well. Negative + # boost values would correspond to anti-biasing. Anti-biasing is not + # enabled, so negative boost values will return an error. Boost values must + # be between 0 and 20. Any values outside that range will return an error. + # We recommend using a binary search approach to finding the optimal value + # for your use case as well as adding phrases both with and without boost + # to your requests. + class Phrase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of states that define the lifecycle of a PhraseSet. + module State + # Unspecified state. This is only used/useful for distinguishing + # unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 2 + + # This PhraseSet has been deleted. + DELETED = 4 + end + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#create_custom_class CreateCustomClass} method. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V2::CustomClass] + # Required. The CustomClass to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the CustomClass, but do not + # actually create it. + # @!attribute [rw] custom_class_id + # @return [::String] + # The ID to use for the CustomClass, which will become the final component of + # the CustomClass's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location where this CustomClass will be created. + # The expected format is `projects/{project}/locations/{location}`. + class CreateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location of CustomClass resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of results per requests. A valid page_size ranges from 0 to 100 + # inclusive. If the page_size is zero or unspecified, a page size of 5 will + # be chosen. If the page size exceeds 100, it will be coerced down to 100. + # Note that a call might return fewer results than the requested page size. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must + # match the call that provided the page token. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether, or not, to show resources that have been deleted. + class ListCustomClassesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] + # The list of requested CustomClasses. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::Speech::V2::ListCustomClassesRequest#page_token page_token} to + # retrieve the next page. If this field is omitted, there are no subsequent + # pages. This token expires after 72 hours. + class ListCustomClassesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_custom_class GetCustomClass} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomClass to retrieve. The expected format is + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + class GetCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_custom_class UpdateCustomClass} method. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V2::CustomClass] + # Required. The CustomClass to update. + # + # The CustomClass's `name` field is used to identify the CustomClass to + # update. Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. If empty, all fields are considered for + # update. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the updated CustomClass, but do + # not actually update it. + class UpdateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class DeleteCustomClass} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomClass to delete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the deleted CustomClass, but do + # not actually delete it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the CustomClass is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class DeleteCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class UndeleteCustomClass} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomClass to undelete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the undeleted CustomClass, but do + # not actually undelete it. + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class UndeleteCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set CreatePhraseSet} method. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # Required. The PhraseSet to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the PhraseSet, but do not + # actually create it. + # @!attribute [rw] phrase_set_id + # @return [::String] + # The ID to use for the PhraseSet, which will become the final component of + # the PhraseSet's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location where this PhraseSet will be created. + # The expected format is `projects/{project}/locations/{location}`. + class CreatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location of PhraseSet resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of PhraseSets to return. The service may return fewer + # than this value. If unspecified, at most 5 PhraseSets will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match + # the call that provided the page token. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether, or not, to show resources that have been deleted. + class ListPhraseSetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet>] + # The list of requested PhraseSets. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest#page_token page_token} to + # retrieve the next page. If this field is omitted, there are no subsequent + # pages. This token expires after 72 hours. + class ListPhraseSetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set GetPhraseSet} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PhraseSet to retrieve. The expected format is + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + class GetPhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set UpdatePhraseSet} method. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # Required. The PhraseSet to update. + # + # The PhraseSet's `name` field is used to identify the PhraseSet to update. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire PhraseSet resource. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the updated PhraseSet, but do not + # actually update it. + class UpdatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set DeletePhraseSet} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PhraseSet to delete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the deleted PhraseSet, but do not + # actually delete it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the PhraseSet is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class DeletePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set UndeletePhraseSet} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PhraseSet to undelete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the undeleted PhraseSet, but do + # not actually undelete it. + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class UndeletePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb new file mode 100644 index 000000000000..84cc8a10dfcd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb @@ -0,0 +1,120 @@ +# 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 Speech + module V2 + # Represents a singular feature of a model. If the feature is `recognizer`, + # the release_state of the feature represents the release_state of the model + # @!attribute [rw] feature + # @return [::String] + # The name of the feature (Note: the feature can be `recognizer`) + # @!attribute [rw] release_state + # @return [::String] + # The release state of the feature + class ModelFeature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the collection of features belonging to a model + # @!attribute [rw] model_feature + # @return [::Array<::Google::Cloud::Speech::V2::ModelFeature>] + # Repeated field that contains all features of the model + class ModelFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata about the models in a given region for a specific locale. + # Currently this is just the features of the model + # @!attribute [rw] model_features + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelFeatures}] + # Map of the model name -> features of that model + class ModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::ModelFeatures] + class ModelFeaturesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The metadata about locales available in a given region. Currently this is + # just the models that are available for each locale + # @!attribute [rw] models + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelMetadata}] + # Map of locale (language code) -> models + class LanguageMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::ModelMetadata] + class ModelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The access metadata for a particular region. This can be applied if the org + # policy for the given project disallows a particular region. + # @!attribute [rw] constraint_type + # @return [::Google::Cloud::Speech::V2::AccessMetadata::ConstraintType] + # Describes the different types of constraints that are applied. + class AccessMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the different types of constraints that can be applied on a + # region. + module ConstraintType + # Unspecified constraint applied. + CONSTRAINT_TYPE_UNSPECIFIED = 0 + + # The project's org policy disallows the given region. + RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1 + end + end + + # Main metadata for the Locations API for STT V2. Currently this is just the + # metadata about locales, models, and features + # @!attribute [rw] languages + # @return [::Google::Cloud::Speech::V2::LanguageMetadata] + # Information about available locales, models, and features represented in + # the hierarchical structure of locales -> models -> features + # @!attribute [rw] access_metadata + # @return [::Google::Cloud::Speech::V2::AccessMetadata] + # Information about access metadata for the region and given project. + class LocationsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# 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 from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# 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/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile new file mode 100644 index 000000000000..9099ccea67fd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# 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-speech-v2", path: "../" +else + gem "google-cloud-speech-v2" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json b/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json new file mode 100644 index 000000000000..5c30e3c81908 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json @@ -0,0 +1,935 @@ +{ + "client_library": { + "name": "google-cloud-speech-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.speech.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "speech_v2_generated_Speech_CreateRecognizer_sync", + "title": "Snippet for the create_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_recognizer.", + "file": "speech/create_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::CreateRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "CreateRecognizer", + "full_name": "google.cloud.speech.v2.Speech.CreateRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_ListRecognizers_sync", + "title": "Snippet for the list_recognizers call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_recognizers.", + "file": "speech/list_recognizers.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_recognizers", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_recognizers", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::ListRecognizersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::ListRecognizersResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "ListRecognizers", + "full_name": "google.cloud.speech.v2.Speech.ListRecognizers", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetRecognizer_sync", + "title": "Snippet for the get_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_recognizer.", + "file": "speech/get_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::Recognizer", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetRecognizer", + "full_name": "google.cloud.speech.v2.Speech.GetRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdateRecognizer_sync", + "title": "Snippet for the update_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_recognizer.", + "file": "speech/update_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdateRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdateRecognizer", + "full_name": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_DeleteRecognizer_sync", + "title": "Snippet for the delete_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_recognizer.", + "file": "speech/delete_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::DeleteRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "DeleteRecognizer", + "full_name": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UndeleteRecognizer_sync", + "title": "Snippet for the undelete_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer.", + "file": "speech/undelete_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UndeleteRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UndeleteRecognizer", + "full_name": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_Recognize_sync", + "title": "Snippet for the recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#recognize.", + "file": "speech/recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "recognize", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::RecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::RecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "Recognize", + "full_name": "google.cloud.speech.v2.Speech.Recognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_StreamingRecognize_sync", + "title": "Snippet for the streaming_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#streaming_recognize.", + "file": "speech/streaming_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_recognize", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::StreamingRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::StreamingRecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "StreamingRecognize", + "full_name": "google.cloud.speech.v2.Speech.StreamingRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_BatchRecognize_sync", + "title": "Snippet for the batch_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#batch_recognize.", + "file": "speech/batch_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_recognize", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#batch_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::BatchRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "BatchRecognize", + "full_name": "google.cloud.speech.v2.Speech.BatchRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetConfig_sync", + "title": "Snippet for the get_config call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_config.", + "file": "speech/get_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_config", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::Config", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetConfig", + "full_name": "google.cloud.speech.v2.Speech.GetConfig", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdateConfig_sync", + "title": "Snippet for the update_config call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_config.", + "file": "speech/update_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_config", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdateConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::Config", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdateConfig", + "full_name": "google.cloud.speech.v2.Speech.UpdateConfig", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_CreateCustomClass_sync", + "title": "Snippet for the create_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_custom_class.", + "file": "speech/create_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::CreateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "CreateCustomClass", + "full_name": "google.cloud.speech.v2.Speech.CreateCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_ListCustomClasses_sync", + "title": "Snippet for the list_custom_classes call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_custom_classes.", + "file": "speech/list_custom_classes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_custom_classes", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::ListCustomClassesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::ListCustomClassesResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "ListCustomClasses", + "full_name": "google.cloud.speech.v2.Speech.ListCustomClasses", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetCustomClass_sync", + "title": "Snippet for the get_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_custom_class.", + "file": "speech/get_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::CustomClass", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetCustomClass", + "full_name": "google.cloud.speech.v2.Speech.GetCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdateCustomClass_sync", + "title": "Snippet for the update_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_custom_class.", + "file": "speech/update_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdateCustomClass", + "full_name": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_DeleteCustomClass_sync", + "title": "Snippet for the delete_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_custom_class.", + "file": "speech/delete_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::DeleteCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "DeleteCustomClass", + "full_name": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UndeleteCustomClass_sync", + "title": "Snippet for the undelete_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class.", + "file": "speech/undelete_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UndeleteCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UndeleteCustomClass", + "full_name": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_CreatePhraseSet_sync", + "title": "Snippet for the create_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_phrase_set.", + "file": "speech/create_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::CreatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "CreatePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_ListPhraseSets_sync", + "title": "Snippet for the list_phrase_sets call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets.", + "file": "speech/list_phrase_sets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_phrase_sets", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::ListPhraseSetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::ListPhraseSetsResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "ListPhraseSets", + "full_name": "google.cloud.speech.v2.Speech.ListPhraseSets", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetPhraseSet_sync", + "title": "Snippet for the get_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_phrase_set.", + "file": "speech/get_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetPhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::PhraseSet", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetPhraseSet", + "full_name": "google.cloud.speech.v2.Speech.GetPhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdatePhraseSet_sync", + "title": "Snippet for the update_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_phrase_set.", + "file": "speech/update_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdatePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_DeletePhraseSet_sync", + "title": "Snippet for the delete_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set.", + "file": "speech/delete_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::DeletePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "DeletePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UndeletePhraseSet_sync", + "title": "Snippet for the undelete_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set.", + "file": "speech/undelete_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UndeletePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UndeletePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb new file mode 100644 index 000000000000..4f957e4b6175 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_BatchRecognize_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the batch_recognize call in the Speech 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::Speech::V2::Speech::Client#batch_recognize. +# +def batch_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new + + # Call the batch_recognize method. + result = client.batch_recognize 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 speech_v2_generated_Speech_BatchRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb new file mode 100644 index 000000000000..b68ec04f2ee7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_CreateCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the create_custom_class call in the Speech 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::Speech::V2::Speech::Client#create_custom_class. +# +def create_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new + + # Call the create_custom_class method. + result = client.create_custom_class 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 speech_v2_generated_Speech_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb new file mode 100644 index 000000000000..eba29d95b333 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_CreatePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the create_phrase_set call in the Speech 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::Speech::V2::Speech::Client#create_phrase_set. +# +def create_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new + + # Call the create_phrase_set method. + result = client.create_phrase_set 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 speech_v2_generated_Speech_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb new file mode 100644 index 000000000000..75242ecadf32 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_CreateRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the create_recognizer call in the Speech 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::Speech::V2::Speech::Client#create_recognizer. +# +def create_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new + + # Call the create_recognizer method. + result = client.create_recognizer 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 speech_v2_generated_Speech_CreateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb new file mode 100644 index 000000000000..e8ddd07289dd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_DeleteCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the delete_custom_class call in the Speech 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::Speech::V2::Speech::Client#delete_custom_class. +# +def delete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new + + # Call the delete_custom_class method. + result = client.delete_custom_class 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 speech_v2_generated_Speech_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb new file mode 100644 index 000000000000..ed0f5b5e30c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_DeletePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the delete_phrase_set call in the Speech 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::Speech::V2::Speech::Client#delete_phrase_set. +# +def delete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new + + # Call the delete_phrase_set method. + result = client.delete_phrase_set 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 speech_v2_generated_Speech_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb new file mode 100644 index 000000000000..0884f27f9d8e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_DeleteRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the delete_recognizer call in the Speech 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::Speech::V2::Speech::Client#delete_recognizer. +# +def delete_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new + + # Call the delete_recognizer method. + result = client.delete_recognizer 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 speech_v2_generated_Speech_DeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb new file mode 100644 index 000000000000..3fc3f9e7fcd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb @@ -0,0 +1,47 @@ +# 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 speech_v2_generated_Speech_GetConfig_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_config call in the Speech 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::Speech::V2::Speech::Client#get_config. +# +def get_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetConfigRequest.new + + # Call the get_config method. + result = client.get_config request + + # The returned object is of type Google::Cloud::Speech::V2::Config. + p result +end +# [END speech_v2_generated_Speech_GetConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb new file mode 100644 index 000000000000..784ffc18c23d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb @@ -0,0 +1,47 @@ +# 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 speech_v2_generated_Speech_GetCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_custom_class call in the Speech 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::Speech::V2::Speech::Client#get_custom_class. +# +def get_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetCustomClassRequest.new + + # Call the get_custom_class method. + result = client.get_custom_class request + + # The returned object is of type Google::Cloud::Speech::V2::CustomClass. + p result +end +# [END speech_v2_generated_Speech_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb new file mode 100644 index 000000000000..9708b47cf3e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb @@ -0,0 +1,47 @@ +# 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 speech_v2_generated_Speech_GetPhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_phrase_set call in the Speech 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::Speech::V2::Speech::Client#get_phrase_set. +# +def get_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new + + # Call the get_phrase_set method. + result = client.get_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. + p result +end +# [END speech_v2_generated_Speech_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb new file mode 100644 index 000000000000..3aaa1b269594 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb @@ -0,0 +1,47 @@ +# 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 speech_v2_generated_Speech_GetRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_recognizer call in the Speech 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::Speech::V2::Speech::Client#get_recognizer. +# +def get_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetRecognizerRequest.new + + # Call the get_recognizer method. + result = client.get_recognizer request + + # The returned object is of type Google::Cloud::Speech::V2::Recognizer. + p result +end +# [END speech_v2_generated_Speech_GetRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb new file mode 100644 index 000000000000..a9e5534d5b7b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb @@ -0,0 +1,51 @@ +# 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 speech_v2_generated_Speech_ListCustomClasses_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the list_custom_classes call in the Speech 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::Speech::V2::Speech::Client#list_custom_classes. +# +def list_custom_classes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new + + # Call the list_custom_classes method. + result = client.list_custom_classes 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::Speech::V2::CustomClass. + p item + end +end +# [END speech_v2_generated_Speech_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb new file mode 100644 index 000000000000..438c90e974fe --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb @@ -0,0 +1,51 @@ +# 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 speech_v2_generated_Speech_ListPhraseSets_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the list_phrase_sets call in the Speech 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::Speech::V2::Speech::Client#list_phrase_sets. +# +def list_phrase_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new + + # Call the list_phrase_sets method. + result = client.list_phrase_sets 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::Speech::V2::PhraseSet. + p item + end +end +# [END speech_v2_generated_Speech_ListPhraseSets_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb new file mode 100644 index 000000000000..5ca1e1af20ed --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb @@ -0,0 +1,51 @@ +# 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 speech_v2_generated_Speech_ListRecognizers_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the list_recognizers call in the Speech 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::Speech::V2::Speech::Client#list_recognizers. +# +def list_recognizers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListRecognizersRequest.new + + # Call the list_recognizers method. + result = client.list_recognizers 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::Speech::V2::Recognizer. + p item + end +end +# [END speech_v2_generated_Speech_ListRecognizers_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb new file mode 100644 index 000000000000..194e4add7771 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb @@ -0,0 +1,47 @@ +# 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 speech_v2_generated_Speech_Recognize_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the recognize call in the Speech 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::Speech::V2::Speech::Client#recognize. +# +def recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::RecognizeRequest.new + + # Call the recognize method. + result = client.recognize request + + # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. + p result +end +# [END speech_v2_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb new file mode 100644 index 000000000000..a09a15c0f87a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb @@ -0,0 +1,56 @@ +# 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 speech_v2_generated_Speech_StreamingRecognize_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the streaming_recognize call in the Speech 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::Speech::V2::Speech::Client#streaming_recognize. +# +def streaming_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_recognize method to start streaming. + output = client.streaming_recognize input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse + output.each do |current_response| + p current_response + end +end +# [END speech_v2_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb new file mode 100644 index 000000000000..c674fe781687 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_UndeleteCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the undelete_custom_class call in the Speech 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::Speech::V2::Speech::Client#undelete_custom_class. +# +def undelete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new + + # Call the undelete_custom_class method. + result = client.undelete_custom_class 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 speech_v2_generated_Speech_UndeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb new file mode 100644 index 000000000000..13f47439e6f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_UndeletePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the undelete_phrase_set call in the Speech 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::Speech::V2::Speech::Client#undelete_phrase_set. +# +def undelete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new + + # Call the undelete_phrase_set method. + result = client.undelete_phrase_set 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 speech_v2_generated_Speech_UndeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb new file mode 100644 index 000000000000..9e9efaa6f2f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_UndeleteRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the undelete_recognizer call in the Speech 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::Speech::V2::Speech::Client#undelete_recognizer. +# +def undelete_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new + + # Call the undelete_recognizer method. + result = client.undelete_recognizer 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 speech_v2_generated_Speech_UndeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb new file mode 100644 index 000000000000..f0e6f043b9b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb @@ -0,0 +1,47 @@ +# 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 speech_v2_generated_Speech_UpdateConfig_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_config call in the Speech 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::Speech::V2::Speech::Client#update_config. +# +def update_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateConfigRequest.new + + # Call the update_config method. + result = client.update_config request + + # The returned object is of type Google::Cloud::Speech::V2::Config. + p result +end +# [END speech_v2_generated_Speech_UpdateConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb new file mode 100644 index 000000000000..41f39d156939 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_UpdateCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_custom_class call in the Speech 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::Speech::V2::Speech::Client#update_custom_class. +# +def update_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new + + # Call the update_custom_class method. + result = client.update_custom_class 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 speech_v2_generated_Speech_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb new file mode 100644 index 000000000000..c35958f5d92a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_UpdatePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_phrase_set call in the Speech 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::Speech::V2::Speech::Client#update_phrase_set. +# +def update_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new + + # Call the update_phrase_set method. + result = client.update_phrase_set 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 speech_v2_generated_Speech_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb new file mode 100644 index 000000000000..6eba5f9d7d62 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb @@ -0,0 +1,54 @@ +# 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 speech_v2_generated_Speech_UpdateRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_recognizer call in the Speech 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::Speech::V2::Speech::Client#update_recognizer. +# +def update_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new + + # Call the update_recognizer method. + result = client.update_recognizer 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 speech_v2_generated_Speech_UpdateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb new file mode 100644 index 000000000000..f6538455ac47 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb @@ -0,0 +1,400 @@ +# 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/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/cloud_speech_services_pb" +require "google/cloud/speech/v2/speech" + +class ::Google::Cloud::Speech::V2::Speech::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 + client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, 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 + client.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 + client.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 + client.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 + client.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 + client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb new file mode 100644 index 000000000000..d704a59e482c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb @@ -0,0 +1,127 @@ +# 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/speech/v2/speech" + +class ::Google::Cloud::Speech::V2::Speech::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_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/config", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_custom_class_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" + assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V2::Speech::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_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + end + end + + def test_recognizer_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.recognizer_path project: "value0", location: "value1", recognizer: "value2" + assert_equal "projects/value0/locations/value1/recognizers/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb new file mode 100644 index 000000000000..30ed3613ce74 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb @@ -0,0 +1,1335 @@ +# 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/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/speech/rest" + + +class ::Google::Cloud::Speech::V2::Speech::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_recognizer + # 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. + recognizer = {} + validate_only = true + recognizer_id = "hello world" + parent = "hello world" + + create_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_recognizer_client_stub.call_count + end + end + end + + def test_list_recognizers + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_recognizers_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_recognizers_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_recognizers_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_recognizers_client_stub.call_count + end + end + end + + def test_get_recognizer + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::Recognizer.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_recognizer({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_recognizer name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_recognizer({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_recognizer_client_stub.call_count + end + end + end + + def test_update_recognizer + # 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. + recognizer = {} + update_mask = {} + validate_only = true + + update_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_recognizer_client_stub.call_count + end + end + end + + def test_delete_recognizer + # 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" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_recognizer_client_stub.call_count + end + end + end + + def test_undelete_recognizer + # 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" + validate_only = true + etag = "hello world" + + undelete_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_recognizer_client_stub.call_count + end + end + end + + def test_recognize + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::RecognizeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + recognizer = "hello world" + config = {} + config_mask = {} + content = "hello world" + + recognize_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_count + end + end + end + + def test_batch_recognize + # 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. + recognizer = "hello world" + config = {} + config_mask = {} + files = [{}] + recognition_output_config = {} + processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED + + batch_recognize_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_batch_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_recognize_client_stub.call_count + end + end + end + + def test_get_config + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::Config.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_config_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_config(::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_config_client_stub.call_count + end + end + end + + def test_update_config + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::Config.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + config = {} + update_mask = {} + + update_config_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_config({ config: config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_config config: config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_config({ config: config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_config_client_stub.call_count + end + end + end + + def test_create_custom_class + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_class = {} + validate_only = true + custom_class_id = "hello world" + parent = "hello world" + + create_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_count + end + end + end + + def test_list_custom_classes + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_custom_classes_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_custom_classes_client_stub.call_count + end + end + end + + def test_get_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_custom_class({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_custom_class name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_custom_class({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_custom_class_client_stub.call_count + end + end + end + + def test_update_custom_class + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + validate_only = true + + update_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_custom_class_client_stub.call_count + end + end + end + + def test_delete_custom_class + # 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" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_custom_class_client_stub.call_count + end + end + end + + def test_undelete_custom_class + # 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" + validate_only = true + etag = "hello world" + + undelete_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_custom_class_client_stub.call_count + end + end + end + + def test_create_phrase_set + # 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. + phrase_set = {} + validate_only = true + phrase_set_id = "hello world" + parent = "hello world" + + create_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_count + end + end + end + + def test_list_phrase_sets + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_phrase_sets_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_phrase_sets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_phrase_sets_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_phrase_sets_client_stub.call_count + end + end + end + + def test_get_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_phrase_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_phrase_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_phrase_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_phrase_set_client_stub.call_count + end + end + end + + def test_update_phrase_set + # 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. + phrase_set = {} + update_mask = {} + validate_only = true + + update_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_phrase_set_client_stub.call_count + end + end + end + + def test_delete_phrase_set + # 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" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_phrase_set_client_stub.call_count + end + end + end + + def test_undelete_phrase_set + # 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" + validate_only = true + etag = "hello world" + + undelete_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_phrase_set_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::Speech::V2::Speech::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::Speech::V2::Speech::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb new file mode 100644 index 000000000000..9e7fc7fc7014 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb @@ -0,0 +1,1662 @@ +# 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/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/speech" + +class ::Google::Cloud::Speech::V2::Speech::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_recognizer + # 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. + recognizer = {} + validate_only = true + recognizer_id = "hello world" + parent = "hello world" + + create_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::CreateRecognizerRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["recognizer_id"] + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_recognizer_client_stub.call_rpc_count + end + end + + def test_list_recognizers + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_recognizers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_recognizers, name + assert_kind_of ::Google::Cloud::Speech::V2::ListRecognizersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_recognizers_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), 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_recognizers_client_stub.call_rpc_count + end + end + + def test_get_recognizer + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::Recognizer.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_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::GetRecognizerRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_recognizer({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_recognizer name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_recognizer({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.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_recognizer_client_stub.call_rpc_count + end + end + + def test_update_recognizer + # 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. + recognizer = {} + update_mask = {} + validate_only = true + + update_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_recognizer_client_stub.call_rpc_count + end + end + + def test_delete_recognizer + # 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" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), 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_recognizer_client_stub.call_rpc_count + end + end + + def test_undelete_recognizer + # 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" + validate_only = true + etag = "hello world" + + undelete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), 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, undelete_recognizer_client_stub.call_rpc_count + end + end + + def test_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::RecognizeResponse.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. + recognizer = "hello world" + config = {} + config_mask = {} + content = "hello world" + + recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :recognize, name + assert_kind_of ::Google::Cloud::Speech::V2::RecognizeRequest, request + assert_equal "hello world", request["recognizer"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] + assert_equal "hello world", request["content"] + assert_equal :content, request.audio_source + refute_nil options + end + + Gapic::ServiceStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_rpc_count + end + end + + def test_streaming_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::StreamingRecognizeResponse.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 bidi streaming method. + recognizer = "hello world" + streaming_config = {} + + streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_recognize, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_recognize_client_stub.call_rpc_count + streaming_recognize_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeRequest, r + assert_equal "hello world", r["recognizer"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::StreamingRecognitionConfig), r["streaming_config"] + assert_equal :streaming_config, r.streaming_request + end + end + end + end + + def test_batch_recognize + # 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. + recognizer = "hello world" + config = {} + config_mask = {} + files = [{}] + recognition_output_config = {} + processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED + + batch_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_recognize, name + assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeRequest, request + assert_equal "hello world", request["recognizer"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] + assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, request["files"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionOutputConfig), request["recognition_output_config"] + assert_equal :PROCESSING_STRATEGY_UNSPECIFIED, request["processing_strategy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), 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_recognize_client_stub.call_rpc_count + end + end + + def test_get_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::Config.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_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_config, name + assert_kind_of ::Google::Cloud::Speech::V2::GetConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_config(::Google::Cloud::Speech::V2::GetConfigRequest.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_config_client_stub.call_rpc_count + end + end + + def test_update_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::Config.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. + config = {} + update_mask = {} + + update_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_config, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdateConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Config), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_config({ config: config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_config config: config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_config({ config: config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, 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_config_client_stub.call_rpc_count + end + end + + def test_create_custom_class + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + custom_class = {} + validate_only = true + custom_class_id = "hello world" + parent = "hello world" + + create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::CreateCustomClassRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["custom_class_id"] + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_rpc_count + end + end + + def test_list_custom_classes + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_custom_classes, name + assert_kind_of ::Google::Cloud::Speech::V2::ListCustomClassesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), 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_custom_classes_client_stub.call_rpc_count + end + end + + def test_get_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::CustomClass.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_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::GetCustomClassRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_custom_class({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_custom_class name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_custom_class({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.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_custom_class_client_stub.call_rpc_count + end + end + + def test_update_custom_class + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + validate_only = true + + update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_custom_class_client_stub.call_rpc_count + end + end + + def test_delete_custom_class + # 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" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), 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_custom_class_client_stub.call_rpc_count + end + end + + def test_undelete_custom_class + # 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" + validate_only = true + etag = "hello world" + + undelete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), 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, undelete_custom_class_client_stub.call_rpc_count + end + end + + def test_create_phrase_set + # 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. + phrase_set = {} + validate_only = true + phrase_set_id = "hello world" + parent = "hello world" + + create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["phrase_set_id"] + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_rpc_count + end + end + + def test_list_phrase_sets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_phrase_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_phrase_sets, name + assert_kind_of ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_phrase_sets_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), 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_phrase_sets_client_stub.call_rpc_count + end + end + + def test_get_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::PhraseSet.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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::GetPhraseSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_phrase_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_phrase_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_phrase_set({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.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_phrase_set_client_stub.call_rpc_count + end + end + + def test_update_phrase_set + # 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. + phrase_set = {} + update_mask = {} + validate_only = true + + update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_phrase_set_client_stub.call_rpc_count + end + end + + def test_delete_phrase_set + # 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" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), 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_phrase_set_client_stub.call_rpc_count + end + end + + def test_undelete_phrase_set + # 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" + validate_only = true + etag = "hello world" + + undelete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), 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, undelete_phrase_set_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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Speech::V2::Speech::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/helper.rb b/owl-bot-staging/google-cloud-speech-v2/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/helper.rb @@ -0,0 +1,25 @@ +# 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 "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 5844627454d1385bb80478f93d68915ff61115f9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 18 Feb 2026 22:04:22 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google/cloud/speech/v2/cloud_speech_pb.rb | 3 +- .../google/cloud/speech/v2/cloud_speech.rb | 25 + .../google-cloud-speech-v2/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-speech-v2/.rubocop.yml | 33 - .../google-cloud-speech-v2/.toys.rb | 28 - .../google-cloud-speech-v2/.yardopts | 12 - .../google-cloud-speech-v2/AUTHENTICATION.md | 122 - .../google-cloud-speech-v2/CHANGELOG.md | 2 - .../google-cloud-speech-v2/Gemfile | 11 - .../google-cloud-speech-v2/LICENSE.md | 201 -- .../google-cloud-speech-v2/README.md | 154 - .../google-cloud-speech-v2/Rakefile | 169 - .../gapic_metadata.json | 133 - .../google-cloud-speech-v2.gemspec | 29 - .../lib/google-cloud-speech-v2.rb | 21 - .../lib/google/cloud/speech/v2.rb | 45 - .../cloud/speech/v2/bindings_override.rb | 75 - .../google/cloud/speech/v2/cloud_speech_pb.rb | 134 - .../speech/v2/cloud_speech_services_pb.rb | 98 - .../cloud/speech/v2/locations_metadata_pb.rb | 48 - .../lib/google/cloud/speech/v2/rest.rb | 38 - .../lib/google/cloud/speech/v2/speech.rb | 56 - .../google/cloud/speech/v2/speech/client.rb | 2922 ----------------- .../cloud/speech/v2/speech/credentials.rb | 51 - .../cloud/speech/v2/speech/operations.rb | 841 ----- .../google/cloud/speech/v2/speech/paths.rb | 168 - .../lib/google/cloud/speech/v2/speech/rest.rb | 54 - .../cloud/speech/v2/speech/rest/client.rb | 2647 --------------- .../cloud/speech/v2/speech/rest/operations.rb | 925 ------ .../speech/v2/speech/rest/service_stub.rb | 1435 -------- .../lib/google/cloud/speech/v2/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../google/cloud/speech/v2/cloud_speech.rb | 2086 ------------ .../cloud/speech/v2/locations_metadata.rb | 120 - .../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 | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../google-cloud-speech-v2/snippets/Gemfile | 32 - ...ippet_metadata_google.cloud.speech.v2.json | 935 ------ .../snippets/speech/batch_recognize.rb | 54 - .../snippets/speech/create_custom_class.rb | 54 - .../snippets/speech/create_phrase_set.rb | 54 - .../snippets/speech/create_recognizer.rb | 54 - .../snippets/speech/delete_custom_class.rb | 54 - .../snippets/speech/delete_phrase_set.rb | 54 - .../snippets/speech/delete_recognizer.rb | 54 - .../snippets/speech/get_config.rb | 47 - .../snippets/speech/get_custom_class.rb | 47 - .../snippets/speech/get_phrase_set.rb | 47 - .../snippets/speech/get_recognizer.rb | 47 - .../snippets/speech/list_custom_classes.rb | 51 - .../snippets/speech/list_phrase_sets.rb | 51 - .../snippets/speech/list_recognizers.rb | 51 - .../snippets/speech/recognize.rb | 47 - .../snippets/speech/streaming_recognize.rb | 56 - .../snippets/speech/undelete_custom_class.rb | 54 - .../snippets/speech/undelete_phrase_set.rb | 54 - .../snippets/speech/undelete_recognizer.rb | 54 - .../snippets/speech/update_config.rb | 47 - .../snippets/speech/update_custom_class.rb | 54 - .../snippets/speech/update_phrase_set.rb | 54 - .../snippets/speech/update_recognizer.rb | 54 - .../cloud/speech/v2/speech_operations_test.rb | 400 --- .../cloud/speech/v2/speech_paths_test.rb | 127 - .../cloud/speech/v2/speech_rest_test.rb | 1335 -------- .../google/cloud/speech/v2/speech_test.rb | 1662 ---------- .../google-cloud-speech-v2/test/helper.rb | 25 - 77 files changed, 27 insertions(+), 20256 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/helper.rb diff --git a/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb b/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb index a97d26bee348..74ff2fb094b4 100644 --- a/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb +++ b/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb @@ -16,7 +16,7 @@ require 'google/rpc/status_pb' -descriptor_data = "\n)google/cloud/speech/v2/cloud_speech.proto\x12\x16google.cloud.speech.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbe\x01\n\x17\x43reateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rrecognizer_id\x18\x03 \x01(\t\x12\x38\n\x06parent\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 speech.googleapis.com/Recognizer\"\xe7\x0c\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0e\n\x06method\x18\x04 \x01(\t\x12<\n\x0ckms_key_name\x18\x06 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12K\n\x14kms_key_version_name\x18\x07 \x01(\tB-\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12P\n\x17\x62\x61tch_recognize_request\x18\x08 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeRequestH\x00\x12T\n\x19\x63reate_recognizer_request\x18\t \x01(\x0b\x32/.google.cloud.speech.v2.CreateRecognizerRequestH\x00\x12T\n\x19update_recognizer_request\x18\n \x01(\x0b\x32/.google.cloud.speech.v2.UpdateRecognizerRequestH\x00\x12T\n\x19\x64\x65lete_recognizer_request\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.DeleteRecognizerRequestH\x00\x12X\n\x1bundelete_recognizer_request\x18\x0c \x01(\x0b\x32\x31.google.cloud.speech.v2.UndeleteRecognizerRequestH\x00\x12W\n\x1b\x63reate_custom_class_request\x18\r \x01(\x0b\x32\x30.google.cloud.speech.v2.CreateCustomClassRequestH\x00\x12W\n\x1bupdate_custom_class_request\x18\x0e \x01(\x0b\x32\x30.google.cloud.speech.v2.UpdateCustomClassRequestH\x00\x12W\n\x1b\x64\x65lete_custom_class_request\x18\x0f \x01(\x0b\x32\x30.google.cloud.speech.v2.DeleteCustomClassRequestH\x00\x12[\n\x1dundelete_custom_class_request\x18\x10 \x01(\x0b\x32\x32.google.cloud.speech.v2.UndeleteCustomClassRequestH\x00\x12S\n\x19\x63reate_phrase_set_request\x18\x11 \x01(\x0b\x32..google.cloud.speech.v2.CreatePhraseSetRequestH\x00\x12S\n\x19update_phrase_set_request\x18\x12 \x01(\x0b\x32..google.cloud.speech.v2.UpdatePhraseSetRequestH\x00\x12S\n\x19\x64\x65lete_phrase_set_request\x18\x13 \x01(\x0b\x32..google.cloud.speech.v2.DeletePhraseSetRequestH\x00\x12W\n\x1bundelete_phrase_set_request\x18\x14 \x01(\x0b\x32\x30.google.cloud.speech.v2.UndeletePhraseSetRequestH\x00\x12P\n\x15update_config_request\x18\x15 \x01(\x0b\x32+.google.cloud.speech.v2.UpdateConfigRequestB\x02\x18\x01H\x00\x12\x18\n\x10progress_percent\x18\x16 \x01(\x05\x12R\n\x18\x62\x61tch_recognize_metadata\x18\x17 \x01(\x0b\x32..google.cloud.speech.v2.BatchRecognizeMetadataH\x01\x42\t\n\x07requestB\n\n\x08metadata\"\x90\x01\n\x16ListRecognizersRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"k\n\x17ListRecognizersResponse\x12\x37\n\x0brecognizers\x18\x01 \x03(\x0b\x32\".google.cloud.speech.v2.Recognizer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\"\x9e\x01\n\x17UpdateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8d\x01\n\x17\x44\x65leteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"x\n\x19UndeleteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xc5\x07\n\nRecognizer\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x14\n\x05model\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x0elanguage_codes\x18\x11 \x03(\tB\x05\x18\x01\xe0\x41\x01\x12M\n\x1a\x64\x65\x66\x61ult_recognition_config\x18\x06 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12H\n\x0b\x61nnotations\x18\x07 \x03(\x0b\x32\x33.google.cloud.speech.v2.Recognizer.AnnotationsEntry\x12<\n\x05state\x18\x08 \x01(\x0e\x32(.google.cloud.speech.v2.Recognizer.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\x0f \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x10 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:j\xea\x41g\n speech.googleapis.com/Recognizer\x12@projects/{project}/locations/{location}/recognizers/{recognizer}R\x01\x01\"\x1a\n\x18\x41utoDetectDecodingConfig\"\xf0\x02\n\x16\x45xplicitDecodingConfig\x12S\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32<.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13\x61udio_channel_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xbe\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\t\n\x05MULAW\x10\x02\x12\x08\n\x04\x41LAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x08\n\x04\x46LAC\x10\x06\x12\x07\n\x03MP3\x10\x07\x12\x0c\n\x08OGG_OPUS\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x0b\n\x07MP4_AAC\x10\n\x12\x0b\n\x07M4A_AAC\x10\x0b\x12\x0b\n\x07MOV_AAC\x10\x0c\"Z\n\x18SpeakerDiarizationConfig\x12\x1e\n\x11min_speaker_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11max_speaker_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"0\n\x12\x43ustomPromptConfig\x12\x1a\n\rcustom_prompt\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xc7\x04\n\x13RecognitionFeatures\x12\x18\n\x10profanity_filter\x18\x01 \x01(\x08\x12 \n\x18\x65nable_word_time_offsets\x18\x02 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x04 \x01(\x08\x12!\n\x19\x65nable_spoken_punctuation\x18\x0e \x01(\x08\x12\x1c\n\x14\x65nable_spoken_emojis\x18\x0f \x01(\x08\x12X\n\x12multi_channel_mode\x18\x11 \x01(\x0e\x32<.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode\x12L\n\x12\x64iarization_config\x18\t \x01(\x0b\x32\x30.google.cloud.speech.v2.SpeakerDiarizationConfig\x12\x18\n\x10max_alternatives\x18\x10 \x01(\x05\x12M\n\x14\x63ustom_prompt_config\x18\x12 \x01(\x0b\x32*.google.cloud.speech.v2.CustomPromptConfigB\x03\xe0\x41\x01\"\\\n\x10MultiChannelMode\x12\"\n\x1eMULTI_CHANNEL_MODE_UNSPECIFIED\x10\x00\x12$\n SEPARATE_RECOGNITION_PER_CHANNEL\x10\x01\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v2.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\"1\n\x11TranslationConfig\x12\x1c\n\x0ftarget_language\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbf\x02\n\x10SpeechAdaptation\x12Q\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet\x12;\n\x0e\x63ustom_classes\x18\x02 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x1a\x9a\x01\n\x13\x41\x64\x61ptationPhraseSet\x12:\n\nphrase_set\x18\x01 \x01(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSetH\x00\x12>\n\x11inline_phrase_set\x18\x02 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetH\x00\x42\x07\n\x05value\">\n\x0e\x44\x65noiserConfig\x12\x15\n\rdenoise_audio\x18\x01 \x01(\x08\x12\x15\n\rsnr_threshold\x18\x02 \x01(\x02\"\xe4\x04\n\x11RecognitionConfig\x12P\n\x14\x61uto_decoding_config\x18\x07 \x01(\x0b\x32\x30.google.cloud.speech.v2.AutoDetectDecodingConfigH\x00\x12R\n\x18\x65xplicit_decoding_config\x18\x08 \x01(\x0b\x32..google.cloud.speech.v2.ExplicitDecodingConfigH\x00\x12\x12\n\x05model\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0elanguage_codes\x18\n \x03(\tB\x03\xe0\x41\x01\x12=\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32+.google.cloud.speech.v2.RecognitionFeatures\x12<\n\nadaptation\x18\x06 \x01(\x0b\x32(.google.cloud.speech.v2.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.TranscriptNormalizationB\x03\xe0\x41\x01\x12J\n\x12translation_config\x18\x0f \x01(\x0b\x32).google.cloud.speech.v2.TranslationConfigB\x03\xe0\x41\x01\x12\x44\n\x0f\x64\x65noiser_config\x18\x10 \x01(\x0b\x32&.google.cloud.speech.v2.DenoiserConfigB\x03\xe0\x41\x01\x42\x11\n\x0f\x64\x65\x63oding_config\"\xee\x01\n\x10RecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x11\n\x07\x63ontent\x18\x05 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x9d\x01\n\x1bRecognitionResponseMetadata\x12\x1c\n\nrequest_id\x18\t \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x38\n\x15total_billed_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1b\n\x06prompt\x18\n \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_prompt\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v2.WordInfo\"\xa3\x01\n\x08WordInfo\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x15\n\rspeaker_label\x18\x06 \x01(\t\"\xcc\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\x9c\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x03 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\xd1\x02\n\x1cStreamingRecognitionFeatures\x12$\n\x1c\x65nable_voice_activity_events\x18\x01 \x01(\x08\x12\x17\n\x0finterim_results\x18\x02 \x01(\x08\x12i\n\x16voice_activity_timeout\x18\x03 \x01(\x0b\x32I.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xdf\x01\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfigB\x03\xe0\x41\x02\x12/\n\x0b\x63onfig_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12P\n\x12streaming_features\x18\x02 \x01(\x0b\x32\x34.google.cloud.speech.v2.StreamingRecognitionFeatures\"\xcf\x01\n\x19StreamingRecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12N\n\x10streaming_config\x18\x06 \x01(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionConfigH\x00\x12\x0f\n\x05\x61udio\x18\x05 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x88\x04\n\x15\x42\x61tchRecognizeRequest\x12<\n\nrecognizer\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x05\x66iles\x18\x03 \x03(\x0b\x32\x32.google.cloud.speech.v2.BatchRecognizeFileMetadata\x12R\n\x19recognition_output_config\x18\x06 \x01(\x0b\x32/.google.cloud.speech.v2.RecognitionOutputConfig\x12]\n\x13processing_strategy\x18\x07 \x01(\x0e\x32@.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy\"O\n\x12ProcessingStrategy\x12#\n\x1fPROCESSING_STRATEGY_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44YNAMIC_BATCHING\x10\x01\"\x1e\n\x0fGcsOutputConfig\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x14\n\x12InlineOutputConfig\"\x1e\n\x1cNativeOutputFileFormatConfig\"\x1b\n\x19VttOutputFileFormatConfig\"\x1b\n\x19SrtOutputFileFormatConfig\"\xda\x01\n\x12OutputFormatConfig\x12\x44\n\x06native\x18\x01 \x01(\x0b\x32\x34.google.cloud.speech.v2.NativeOutputFileFormatConfig\x12>\n\x03vtt\x18\x02 \x01(\x0b\x32\x31.google.cloud.speech.v2.VttOutputFileFormatConfig\x12>\n\x03srt\x18\x03 \x01(\x0b\x32\x31.google.cloud.speech.v2.SrtOutputFileFormatConfig\"\x86\x02\n\x17RecognitionOutputConfig\x12\x44\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\'.google.cloud.speech.v2.GcsOutputConfigH\x00\x12L\n\x16inline_response_config\x18\x02 \x01(\x0b\x32*.google.cloud.speech.v2.InlineOutputConfigH\x00\x12M\n\x14output_format_config\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v2.OutputFormatConfigB\x03\xe0\x41\x01\x42\x08\n\x06output\"\x82\x02\n\x16\x42\x61tchRecognizeResponse\x12L\n\x07results\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeResponse.ResultsEntry\x12\x38\n\x15total_billed_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a`\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.speech.v2.BatchRecognizeFileResult:\x02\x38\x01\"\xa0\x01\n\x15\x42\x61tchRecognizeResults\x12@\n\x07results\x18\x01 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"Q\n\x12\x43loudStorageResult\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x16\n\x0evtt_format_uri\x18\x02 \x01(\t\x12\x16\n\x0esrt_format_uri\x18\x03 \x01(\t\"}\n\x0cInlineResult\x12\x41\n\ntranscript\x18\x01 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResults\x12\x14\n\x0cvtt_captions\x18\x02 \x01(\t\x12\x14\n\x0csrt_captions\x18\x03 \x01(\t\"\xf1\x02\n\x18\x42\x61tchRecognizeFileResult\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x08metadata\x18\x03 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\x12J\n\x14\x63loud_storage_result\x18\x05 \x01(\x0b\x32*.google.cloud.speech.v2.CloudStorageResultH\x00\x12=\n\rinline_result\x18\x06 \x01(\x0b\x32$.google.cloud.speech.v2.InlineResultH\x00\x12\x0f\n\x03uri\x18\x01 \x01(\tB\x02\x18\x01\x12\x45\n\ntranscript\x18\x04 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResultsB\x02\x18\x01\x42\x08\n\x06result\"o\n#BatchRecognizeTranscriptionMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x0b\n\x03uri\x18\x03 \x01(\t\"\xfe\x01\n\x16\x42\x61tchRecognizeMetadata\x12i\n\x16transcription_metadata\x18\x01 \x03(\x0b\x32I.google.cloud.speech.v2.BatchRecognizeMetadata.TranscriptionMetadataEntry\x1ay\n\x1aTranscriptionMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata:\x02\x38\x01\"\xa7\x01\n\x1a\x42\x61tchRecognizeFileMetadata\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x0e\n\x0c\x61udio_source\"\xf4\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xc7\x03\n\x1aStreamingRecognizeResponse\x12\x43\n\x07results\x18\x06 \x03(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x03 \x01(\x0e\x32\x42.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType\x12\x36\n\x13speech_event_offset\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\x08metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\x85\x01\n\x0fSpeechEventType\x12!\n\x1dSPEECH_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\"\xe8\x01\n\x06\x43onfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:Q\xea\x41N\n\x1cspeech.googleapis.com/Config\x12.projects/{project}/locations/{location}/config\"F\n\x10GetConfigRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cspeech.googleapis.com/Config\"{\n\x13UpdateConfigRequest\x12\x33\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1e.google.cloud.speech.v2.ConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xad\x07\n\x0b\x43ustomClass\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05items\x18\x05 \x03(\x0b\x32-.google.cloud.speech.v2.CustomClass.ClassItem\x12=\n\x05state\x18\x0f \x01(\x0e\x32).google.cloud.speech.v2.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x34.google.cloud.speech.v2.CustomClass.AnnotationsEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:o\xea\x41l\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}R\x01\x01\"\xae\x07\n\tPhraseSet\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x07phrases\x18\x03 \x03(\x0b\x32(.google.cloud.speech.v2.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12;\n\x05state\x18\x0f \x01(\x0e\x32\'.google.cloud.speech.v2.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x32.google.cloud.speech.v2.PhraseSet.AnnotationsEntry\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:h\xea\x41\x65\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}R\x01\x01\"\xc5\x01\n\x18\x43reateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\x0f\x63ustom_class_id\x18\x03 \x01(\t\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\"\x92\x01\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"\xa2\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8f\x01\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"z\n\x1aUndeleteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xbb\x01\n\x16\x43reatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rphrase_set_id\x18\x03 \x01(\t\x12\x37\n\x06parent\x18\x04 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\"\x8f\x01\n\x15ListPhraseSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"i\n\x16ListPhraseSetsResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v2.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\x9c\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8b\x01\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"v\n\x18UndeletePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t2\xbf%\n\x06Speech\x12\xec\x01\n\x10\x43reateRecognizer\x12/.google.cloud.speech.v2.CreateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x1fparent,recognizer,recognizer_id\x82\xd3\xe4\x93\x02=\"//v2/{parent=projects/*/locations/*}/recognizers:\nrecognizer\x12\xb4\x01\n\x0fListRecognizers\x12..google.cloud.speech.v2.ListRecognizersRequest\x1a/.google.cloud.speech.v2.ListRecognizersResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2/{parent=projects/*/locations/*}/recognizers\x12\xa1\x01\n\rGetRecognizer\x12,.google.cloud.speech.v2.GetRecognizerRequest\x1a\".google.cloud.speech.v2.Recognizer\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2/{name=projects/*/locations/*/recognizers/*}\x12\xee\x01\n\x10UpdateRecognizer\x12/.google.cloud.speech.v2.UpdateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x16recognizer,update_mask\x82\xd3\xe4\x93\x02H2:/v2/{recognizer.name=projects/*/locations/*/recognizers/*}:\nrecognizer\x12\xc4\x01\n\x10\x44\x65leteRecognizer\x12/.google.cloud.speech.v2.DeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"`\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2/{name=projects/*/locations/*/recognizers/*}\x12\xd4\x01\n\x12UndeleteRecognizer\x12\x31.google.cloud.speech.v2.UndeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v2/{name=projects/*/locations/*/recognizers/*}:undelete:\x01*\x12\xf9\x01\n\tRecognize\x12(.google.cloud.speech.v2.RecognizeRequest\x1a).google.cloud.speech.v2.RecognizeResponse\"\x96\x01\xda\x41%recognizer,config,config_mask,content\xda\x41!recognizer,config,config_mask,uri\x82\xd3\xe4\x93\x02\x44\"?/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v2.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v2.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x12\x84\x02\n\x0e\x42\x61tchRecognize\x12-.google.cloud.speech.v2.BatchRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41+\n\x16\x42\x61tchRecognizeResponse\x12\x11OperationMetadata\xda\x41#recognizer,config,config_mask,files\x82\xd3\xe4\x93\x02I\"D/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize:\x01*\x12\x8e\x01\n\tGetConfig\x12(.google.cloud.speech.v2.GetConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2/{name=projects/*/locations/*/config}\x12\xb1\x01\n\x0cUpdateConfig\x12+.google.cloud.speech.v2.UpdateConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"T\xda\x41\x12\x63onfig,update_mask\x82\xd3\xe4\x93\x02\x39\x32//v2/{config.name=projects/*/locations/*/config}:\x06\x63onfig\x12\xf7\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v2.CreateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x41\"1/v2/{parent=projects/*/locations/*}/customClasses:\x0c\x63ustom_class\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v2.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v2.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{parent=projects/*/locations/*}/customClasses\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v2.GetCustomClassRequest\x1a#.google.cloud.speech.v2.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{name=projects/*/locations/*/customClasses/*}\x12\xf9\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v2.UpdateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v2/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xc9\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v2.DeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v2/{name=projects/*/locations/*/customClasses/*}\x12\xd9\x01\n\x13UndeleteCustomClass\x12\x32.google.cloud.speech.v2.UndeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v2/{name=projects/*/locations/*/customClasses/*}:undelete:\x01*\x12\xe8\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v2.CreatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02<\"./v2/{parent=projects/*/locations/*}/phraseSets:\nphrase_set\x12\xb0\x01\n\x0eListPhraseSets\x12-.google.cloud.speech.v2.ListPhraseSetsRequest\x1a..google.cloud.speech.v2.ListPhraseSetsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v2/{parent=projects/*/locations/*}/phraseSets\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v2.GetPhraseSetRequest\x1a!.google.cloud.speech.v2.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xea\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v2.UpdatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xc0\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v2.DeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xd0\x01\n\x11UndeletePhraseSet\x12\x30.google.cloud.speech.v2.UndeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v2/{name=projects/*/locations/*/phraseSets/*}:undelete:\x01*\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x03\n\x1a\x63om.google.cloud.speech.v2B\x10\x43loudSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" +descriptor_data = "\n)google/cloud/speech/v2/cloud_speech.proto\x12\x16google.cloud.speech.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbe\x01\n\x17\x43reateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rrecognizer_id\x18\x03 \x01(\t\x12\x38\n\x06parent\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 speech.googleapis.com/Recognizer\"\xe7\x0c\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0e\n\x06method\x18\x04 \x01(\t\x12<\n\x0ckms_key_name\x18\x06 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12K\n\x14kms_key_version_name\x18\x07 \x01(\tB-\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12P\n\x17\x62\x61tch_recognize_request\x18\x08 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeRequestH\x00\x12T\n\x19\x63reate_recognizer_request\x18\t \x01(\x0b\x32/.google.cloud.speech.v2.CreateRecognizerRequestH\x00\x12T\n\x19update_recognizer_request\x18\n \x01(\x0b\x32/.google.cloud.speech.v2.UpdateRecognizerRequestH\x00\x12T\n\x19\x64\x65lete_recognizer_request\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.DeleteRecognizerRequestH\x00\x12X\n\x1bundelete_recognizer_request\x18\x0c \x01(\x0b\x32\x31.google.cloud.speech.v2.UndeleteRecognizerRequestH\x00\x12W\n\x1b\x63reate_custom_class_request\x18\r \x01(\x0b\x32\x30.google.cloud.speech.v2.CreateCustomClassRequestH\x00\x12W\n\x1bupdate_custom_class_request\x18\x0e \x01(\x0b\x32\x30.google.cloud.speech.v2.UpdateCustomClassRequestH\x00\x12W\n\x1b\x64\x65lete_custom_class_request\x18\x0f \x01(\x0b\x32\x30.google.cloud.speech.v2.DeleteCustomClassRequestH\x00\x12[\n\x1dundelete_custom_class_request\x18\x10 \x01(\x0b\x32\x32.google.cloud.speech.v2.UndeleteCustomClassRequestH\x00\x12S\n\x19\x63reate_phrase_set_request\x18\x11 \x01(\x0b\x32..google.cloud.speech.v2.CreatePhraseSetRequestH\x00\x12S\n\x19update_phrase_set_request\x18\x12 \x01(\x0b\x32..google.cloud.speech.v2.UpdatePhraseSetRequestH\x00\x12S\n\x19\x64\x65lete_phrase_set_request\x18\x13 \x01(\x0b\x32..google.cloud.speech.v2.DeletePhraseSetRequestH\x00\x12W\n\x1bundelete_phrase_set_request\x18\x14 \x01(\x0b\x32\x30.google.cloud.speech.v2.UndeletePhraseSetRequestH\x00\x12P\n\x15update_config_request\x18\x15 \x01(\x0b\x32+.google.cloud.speech.v2.UpdateConfigRequestB\x02\x18\x01H\x00\x12\x18\n\x10progress_percent\x18\x16 \x01(\x05\x12R\n\x18\x62\x61tch_recognize_metadata\x18\x17 \x01(\x0b\x32..google.cloud.speech.v2.BatchRecognizeMetadataH\x01\x42\t\n\x07requestB\n\n\x08metadata\"\x90\x01\n\x16ListRecognizersRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"k\n\x17ListRecognizersResponse\x12\x37\n\x0brecognizers\x18\x01 \x03(\x0b\x32\".google.cloud.speech.v2.Recognizer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\"\x9e\x01\n\x17UpdateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8d\x01\n\x17\x44\x65leteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"x\n\x19UndeleteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xc5\x07\n\nRecognizer\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x14\n\x05model\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x0elanguage_codes\x18\x11 \x03(\tB\x05\x18\x01\xe0\x41\x01\x12M\n\x1a\x64\x65\x66\x61ult_recognition_config\x18\x06 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12H\n\x0b\x61nnotations\x18\x07 \x03(\x0b\x32\x33.google.cloud.speech.v2.Recognizer.AnnotationsEntry\x12<\n\x05state\x18\x08 \x01(\x0e\x32(.google.cloud.speech.v2.Recognizer.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\x0f \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x10 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:j\xea\x41g\n speech.googleapis.com/Recognizer\x12@projects/{project}/locations/{location}/recognizers/{recognizer}R\x01\x01\"\x1a\n\x18\x41utoDetectDecodingConfig\"\xf0\x02\n\x16\x45xplicitDecodingConfig\x12S\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32<.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13\x61udio_channel_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xbe\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\t\n\x05MULAW\x10\x02\x12\x08\n\x04\x41LAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x08\n\x04\x46LAC\x10\x06\x12\x07\n\x03MP3\x10\x07\x12\x0c\n\x08OGG_OPUS\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x0b\n\x07MP4_AAC\x10\n\x12\x0b\n\x07M4A_AAC\x10\x0b\x12\x0b\n\x07MOV_AAC\x10\x0c\"Z\n\x18SpeakerDiarizationConfig\x12\x1e\n\x11min_speaker_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11max_speaker_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"0\n\x12\x43ustomPromptConfig\x12\x1a\n\rcustom_prompt\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xc7\x04\n\x13RecognitionFeatures\x12\x18\n\x10profanity_filter\x18\x01 \x01(\x08\x12 \n\x18\x65nable_word_time_offsets\x18\x02 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x04 \x01(\x08\x12!\n\x19\x65nable_spoken_punctuation\x18\x0e \x01(\x08\x12\x1c\n\x14\x65nable_spoken_emojis\x18\x0f \x01(\x08\x12X\n\x12multi_channel_mode\x18\x11 \x01(\x0e\x32<.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode\x12L\n\x12\x64iarization_config\x18\t \x01(\x0b\x32\x30.google.cloud.speech.v2.SpeakerDiarizationConfig\x12\x18\n\x10max_alternatives\x18\x10 \x01(\x05\x12M\n\x14\x63ustom_prompt_config\x18\x12 \x01(\x0b\x32*.google.cloud.speech.v2.CustomPromptConfigB\x03\xe0\x41\x01\"\\\n\x10MultiChannelMode\x12\"\n\x1eMULTI_CHANNEL_MODE_UNSPECIFIED\x10\x00\x12$\n SEPARATE_RECOGNITION_PER_CHANNEL\x10\x01\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v2.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\"1\n\x11TranslationConfig\x12\x1c\n\x0ftarget_language\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbf\x02\n\x10SpeechAdaptation\x12Q\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet\x12;\n\x0e\x63ustom_classes\x18\x02 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x1a\x9a\x01\n\x13\x41\x64\x61ptationPhraseSet\x12:\n\nphrase_set\x18\x01 \x01(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSetH\x00\x12>\n\x11inline_phrase_set\x18\x02 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetH\x00\x42\x07\n\x05value\">\n\x0e\x44\x65noiserConfig\x12\x15\n\rdenoise_audio\x18\x01 \x01(\x08\x12\x15\n\rsnr_threshold\x18\x02 \x01(\x02\"\xe4\x04\n\x11RecognitionConfig\x12P\n\x14\x61uto_decoding_config\x18\x07 \x01(\x0b\x32\x30.google.cloud.speech.v2.AutoDetectDecodingConfigH\x00\x12R\n\x18\x65xplicit_decoding_config\x18\x08 \x01(\x0b\x32..google.cloud.speech.v2.ExplicitDecodingConfigH\x00\x12\x12\n\x05model\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0elanguage_codes\x18\n \x03(\tB\x03\xe0\x41\x01\x12=\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32+.google.cloud.speech.v2.RecognitionFeatures\x12<\n\nadaptation\x18\x06 \x01(\x0b\x32(.google.cloud.speech.v2.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.TranscriptNormalizationB\x03\xe0\x41\x01\x12J\n\x12translation_config\x18\x0f \x01(\x0b\x32).google.cloud.speech.v2.TranslationConfigB\x03\xe0\x41\x01\x12\x44\n\x0f\x64\x65noiser_config\x18\x10 \x01(\x0b\x32&.google.cloud.speech.v2.DenoiserConfigB\x03\xe0\x41\x01\x42\x11\n\x0f\x64\x65\x63oding_config\"\xee\x01\n\x10RecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x11\n\x07\x63ontent\x18\x05 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x9d\x01\n\x1bRecognitionResponseMetadata\x12\x1c\n\nrequest_id\x18\t \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x38\n\x15total_billed_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1b\n\x06prompt\x18\n \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_prompt\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v2.WordInfo\"\xa3\x01\n\x08WordInfo\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x15\n\rspeaker_label\x18\x06 \x01(\t\"\xcc\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\x9c\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x03 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\xf9\x04\n\x1cStreamingRecognitionFeatures\x12$\n\x1c\x65nable_voice_activity_events\x18\x01 \x01(\x08\x12\x17\n\x0finterim_results\x18\x02 \x01(\x08\x12i\n\x16voice_activity_timeout\x18\x03 \x01(\x0b\x32I.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout\x12q\n\x17\x65ndpointing_sensitivity\x18\x08 \x01(\x0e\x32K.google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivityB\x03\xe0\x41\x01\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xb2\x01\n\x16\x45ndpointingSensitivity\x12\'\n#ENDPOINTING_SENSITIVITY_UNSPECIFIED\x10\x00\x12$\n ENDPOINTING_SENSITIVITY_STANDARD\x10\x01\x12&\n\"ENDPOINTING_SENSITIVITY_SUPERSHORT\x10\x02\x12!\n\x1d\x45NDPOINTING_SENSITIVITY_SHORT\x10\x03\"\xdf\x01\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfigB\x03\xe0\x41\x02\x12/\n\x0b\x63onfig_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12P\n\x12streaming_features\x18\x02 \x01(\x0b\x32\x34.google.cloud.speech.v2.StreamingRecognitionFeatures\"\xcf\x01\n\x19StreamingRecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12N\n\x10streaming_config\x18\x06 \x01(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionConfigH\x00\x12\x0f\n\x05\x61udio\x18\x05 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x88\x04\n\x15\x42\x61tchRecognizeRequest\x12<\n\nrecognizer\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x05\x66iles\x18\x03 \x03(\x0b\x32\x32.google.cloud.speech.v2.BatchRecognizeFileMetadata\x12R\n\x19recognition_output_config\x18\x06 \x01(\x0b\x32/.google.cloud.speech.v2.RecognitionOutputConfig\x12]\n\x13processing_strategy\x18\x07 \x01(\x0e\x32@.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy\"O\n\x12ProcessingStrategy\x12#\n\x1fPROCESSING_STRATEGY_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44YNAMIC_BATCHING\x10\x01\"\x1e\n\x0fGcsOutputConfig\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x14\n\x12InlineOutputConfig\"\x1e\n\x1cNativeOutputFileFormatConfig\"\x1b\n\x19VttOutputFileFormatConfig\"\x1b\n\x19SrtOutputFileFormatConfig\"\xda\x01\n\x12OutputFormatConfig\x12\x44\n\x06native\x18\x01 \x01(\x0b\x32\x34.google.cloud.speech.v2.NativeOutputFileFormatConfig\x12>\n\x03vtt\x18\x02 \x01(\x0b\x32\x31.google.cloud.speech.v2.VttOutputFileFormatConfig\x12>\n\x03srt\x18\x03 \x01(\x0b\x32\x31.google.cloud.speech.v2.SrtOutputFileFormatConfig\"\x86\x02\n\x17RecognitionOutputConfig\x12\x44\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\'.google.cloud.speech.v2.GcsOutputConfigH\x00\x12L\n\x16inline_response_config\x18\x02 \x01(\x0b\x32*.google.cloud.speech.v2.InlineOutputConfigH\x00\x12M\n\x14output_format_config\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v2.OutputFormatConfigB\x03\xe0\x41\x01\x42\x08\n\x06output\"\x82\x02\n\x16\x42\x61tchRecognizeResponse\x12L\n\x07results\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeResponse.ResultsEntry\x12\x38\n\x15total_billed_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a`\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.speech.v2.BatchRecognizeFileResult:\x02\x38\x01\"\xa0\x01\n\x15\x42\x61tchRecognizeResults\x12@\n\x07results\x18\x01 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"Q\n\x12\x43loudStorageResult\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x16\n\x0evtt_format_uri\x18\x02 \x01(\t\x12\x16\n\x0esrt_format_uri\x18\x03 \x01(\t\"}\n\x0cInlineResult\x12\x41\n\ntranscript\x18\x01 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResults\x12\x14\n\x0cvtt_captions\x18\x02 \x01(\t\x12\x14\n\x0csrt_captions\x18\x03 \x01(\t\"\xf1\x02\n\x18\x42\x61tchRecognizeFileResult\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x08metadata\x18\x03 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\x12J\n\x14\x63loud_storage_result\x18\x05 \x01(\x0b\x32*.google.cloud.speech.v2.CloudStorageResultH\x00\x12=\n\rinline_result\x18\x06 \x01(\x0b\x32$.google.cloud.speech.v2.InlineResultH\x00\x12\x0f\n\x03uri\x18\x01 \x01(\tB\x02\x18\x01\x12\x45\n\ntranscript\x18\x04 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResultsB\x02\x18\x01\x42\x08\n\x06result\"o\n#BatchRecognizeTranscriptionMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x0b\n\x03uri\x18\x03 \x01(\t\"\xfe\x01\n\x16\x42\x61tchRecognizeMetadata\x12i\n\x16transcription_metadata\x18\x01 \x03(\x0b\x32I.google.cloud.speech.v2.BatchRecognizeMetadata.TranscriptionMetadataEntry\x1ay\n\x1aTranscriptionMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata:\x02\x38\x01\"\xa7\x01\n\x1a\x42\x61tchRecognizeFileMetadata\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x0e\n\x0c\x61udio_source\"\xf4\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xc7\x03\n\x1aStreamingRecognizeResponse\x12\x43\n\x07results\x18\x06 \x03(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x03 \x01(\x0e\x32\x42.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType\x12\x36\n\x13speech_event_offset\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\x08metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\x85\x01\n\x0fSpeechEventType\x12!\n\x1dSPEECH_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\"\xe8\x01\n\x06\x43onfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:Q\xea\x41N\n\x1cspeech.googleapis.com/Config\x12.projects/{project}/locations/{location}/config\"F\n\x10GetConfigRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cspeech.googleapis.com/Config\"{\n\x13UpdateConfigRequest\x12\x33\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1e.google.cloud.speech.v2.ConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xad\x07\n\x0b\x43ustomClass\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05items\x18\x05 \x03(\x0b\x32-.google.cloud.speech.v2.CustomClass.ClassItem\x12=\n\x05state\x18\x0f \x01(\x0e\x32).google.cloud.speech.v2.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x34.google.cloud.speech.v2.CustomClass.AnnotationsEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:o\xea\x41l\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}R\x01\x01\"\xae\x07\n\tPhraseSet\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x07phrases\x18\x03 \x03(\x0b\x32(.google.cloud.speech.v2.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12;\n\x05state\x18\x0f \x01(\x0e\x32\'.google.cloud.speech.v2.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x32.google.cloud.speech.v2.PhraseSet.AnnotationsEntry\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:h\xea\x41\x65\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}R\x01\x01\"\xc5\x01\n\x18\x43reateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\x0f\x63ustom_class_id\x18\x03 \x01(\t\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\"\x92\x01\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"\xa2\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8f\x01\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"z\n\x1aUndeleteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xbb\x01\n\x16\x43reatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rphrase_set_id\x18\x03 \x01(\t\x12\x37\n\x06parent\x18\x04 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\"\x8f\x01\n\x15ListPhraseSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"i\n\x16ListPhraseSetsResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v2.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\x9c\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8b\x01\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"v\n\x18UndeletePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t2\xbf%\n\x06Speech\x12\xec\x01\n\x10\x43reateRecognizer\x12/.google.cloud.speech.v2.CreateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x1fparent,recognizer,recognizer_id\x82\xd3\xe4\x93\x02=\"//v2/{parent=projects/*/locations/*}/recognizers:\nrecognizer\x12\xb4\x01\n\x0fListRecognizers\x12..google.cloud.speech.v2.ListRecognizersRequest\x1a/.google.cloud.speech.v2.ListRecognizersResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2/{parent=projects/*/locations/*}/recognizers\x12\xa1\x01\n\rGetRecognizer\x12,.google.cloud.speech.v2.GetRecognizerRequest\x1a\".google.cloud.speech.v2.Recognizer\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2/{name=projects/*/locations/*/recognizers/*}\x12\xee\x01\n\x10UpdateRecognizer\x12/.google.cloud.speech.v2.UpdateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x16recognizer,update_mask\x82\xd3\xe4\x93\x02H2:/v2/{recognizer.name=projects/*/locations/*/recognizers/*}:\nrecognizer\x12\xc4\x01\n\x10\x44\x65leteRecognizer\x12/.google.cloud.speech.v2.DeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"`\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2/{name=projects/*/locations/*/recognizers/*}\x12\xd4\x01\n\x12UndeleteRecognizer\x12\x31.google.cloud.speech.v2.UndeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v2/{name=projects/*/locations/*/recognizers/*}:undelete:\x01*\x12\xf9\x01\n\tRecognize\x12(.google.cloud.speech.v2.RecognizeRequest\x1a).google.cloud.speech.v2.RecognizeResponse\"\x96\x01\xda\x41%recognizer,config,config_mask,content\xda\x41!recognizer,config,config_mask,uri\x82\xd3\xe4\x93\x02\x44\"?/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v2.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v2.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x12\x84\x02\n\x0e\x42\x61tchRecognize\x12-.google.cloud.speech.v2.BatchRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41+\n\x16\x42\x61tchRecognizeResponse\x12\x11OperationMetadata\xda\x41#recognizer,config,config_mask,files\x82\xd3\xe4\x93\x02I\"D/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize:\x01*\x12\x8e\x01\n\tGetConfig\x12(.google.cloud.speech.v2.GetConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2/{name=projects/*/locations/*/config}\x12\xb1\x01\n\x0cUpdateConfig\x12+.google.cloud.speech.v2.UpdateConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"T\xda\x41\x12\x63onfig,update_mask\x82\xd3\xe4\x93\x02\x39\x32//v2/{config.name=projects/*/locations/*/config}:\x06\x63onfig\x12\xf7\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v2.CreateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x41\"1/v2/{parent=projects/*/locations/*}/customClasses:\x0c\x63ustom_class\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v2.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v2.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{parent=projects/*/locations/*}/customClasses\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v2.GetCustomClassRequest\x1a#.google.cloud.speech.v2.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{name=projects/*/locations/*/customClasses/*}\x12\xf9\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v2.UpdateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v2/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xc9\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v2.DeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v2/{name=projects/*/locations/*/customClasses/*}\x12\xd9\x01\n\x13UndeleteCustomClass\x12\x32.google.cloud.speech.v2.UndeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v2/{name=projects/*/locations/*/customClasses/*}:undelete:\x01*\x12\xe8\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v2.CreatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02<\"./v2/{parent=projects/*/locations/*}/phraseSets:\nphrase_set\x12\xb0\x01\n\x0eListPhraseSets\x12-.google.cloud.speech.v2.ListPhraseSetsRequest\x1a..google.cloud.speech.v2.ListPhraseSetsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v2/{parent=projects/*/locations/*}/phraseSets\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v2.GetPhraseSetRequest\x1a!.google.cloud.speech.v2.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xea\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v2.UpdatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xc0\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v2.DeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xd0\x01\n\x11UndeletePhraseSet\x12\x30.google.cloud.speech.v2.UndeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v2/{name=projects/*/locations/*/phraseSets/*}:undelete:\x01*\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x03\n\x1a\x63om.google.cloud.speech.v2B\x10\x43loudSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -82,6 +82,7 @@ module V2 RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeResponse").msgclass StreamingRecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures").msgclass StreamingRecognitionFeatures::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout").msgclass + StreamingRecognitionFeatures::EndpointingSensitivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivity").enummodule StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass diff --git a/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb b/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb index 7736e377be2a..4c6d44754b04 100644 --- a/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb +++ b/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb @@ -938,6 +938,9 @@ class RecognizeResponse # If set, the server will automatically close the stream after the specified # duration has elapsed after the last VOICE_ACTIVITY speech event has been # sent. The field `voice_activity_events` must also be set to true. + # @!attribute [rw] endpointing_sensitivity + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::EndpointingSensitivity] + # Optional. Endpointing sensitivity for this stream. class StreamingRecognitionFeatures include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -957,6 +960,28 @@ class VoiceActivityTimeout include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Endpointing sensitivity is intended for applications that want to minimize + # result latency, possibly at the expense of quality. Some utterances may be + # broken up into multiple fragments. + module EndpointingSensitivity + # If no value is specified, the values for + # ENDPOINTING_SENSITIVITY_STANDARD will be used. + ENDPOINTING_SENSITIVITY_UNSPECIFIED = 0 + + # Standard sensitivity, no optimization for latency. + ENDPOINTING_SENSITIVITY_STANDARD = 1 + + # Super short sensitivity, optimized for super short utterances like single + # words ("Yes", "No", "Hello", etc.) or a single phrase, command or short + # query (e.g. "check balance", "five dollars", "call Mom"). + ENDPOINTING_SENSITIVITY_SUPERSHORT = 2 + + # Short sensitivity, optimized for short utterances like single sentences. + # (e.g. "Remind me to call the dentist tomorrow morning at nine", + # "Navigate to the nearest coffee shop that is currently open") + ENDPOINTING_SENSITIVITY_SHORT = 3 + end end # Provides configuration information for the StreamingRecognize request. diff --git a/owl-bot-staging/google-cloud-speech-v2/.gitignore b/owl-bot-staging/google-cloud-speech-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json deleted file mode 100644 index a731ceb554c7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "speech.googleapis.com", - "api_shortname": "speech", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest", - "distribution_name": "google-cloud-speech-v2", - "is_cloud": true, - "language": "ruby", - "name": "speech", - "name_pretty": "Cloud Speech-to-Text V2 API", - "product_documentation": "https://cloud.google.com/speech-to-text", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPEECH", - "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml deleted file mode 100644 index 11a141b34f5b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-speech-v2.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-speech-v2.rb" diff --git a/owl-bot-staging/google-cloud-speech-v2/.toys.rb b/owl-bot-staging/google-cloud-speech-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.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/owl-bot-staging/google-cloud-speech-v2/.yardopts b/owl-bot-staging/google-cloud-speech-v2/.yardopts deleted file mode 100644 index bbc8579c72a2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Speech-to-Text V2 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md deleted file mode 100644 index d5ea6bd0837e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-speech-v2 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-speech-v2 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/speech/v2" - -client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/speech/v2" - -::Google::Cloud::Speech::V2::Speech::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Speech::V2::Speech::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-speech-v2 -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/speech/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Speech::V2::Speech::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-speech-v2/Gemfile b/owl-bot-staging/google-cloud-speech-v2/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v2/LICENSE.md b/owl-bot-staging/google-cloud-speech-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-speech-v2/README.md b/owl-bot-staging/google-cloud-speech-v2/README.md deleted file mode 100644 index 357f59f2dd7b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Speech-to-Text V2 API - -Converts audio to text by applying powerful neural network models. - -Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. - -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 Speech-to-Text V2 API. Most users should consider using -the main client gem, -[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-speech-v2 -``` - -## 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/speech.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/speech/v2" - -client = ::Google::Cloud::Speech::V2::Speech::Client.new -request = ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new # (request fields as keyword arguments...) -response = client.create_recognizer request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/speech-to-text) -for general usage information. - -## 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/speech/v2" -require "logger" - -client = ::Google::Cloud::Speech::V2::Speech::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.0+. - -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-speech`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-speech-v2`. -_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-speech`. -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-speech-v2`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-speech-v2/Rakefile b/owl-bot-staging/google-cloud-speech-v2/Rakefile deleted file mode 100644 index d2dc0b8f0e77..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/Rakefile +++ /dev/null @@ -1,169 +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 "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-speech-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPEECH_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPEECH_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/speech/v2/speech/credentials" - ::Google::Cloud::Speech::V2::Speech::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPEECH_PROJECT"] = project - ENV["SPEECH_TEST_PROJECT"] = project - ENV["SPEECH_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-speech-v2 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-speech-v2 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-speech-v2 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-speech-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-speech-v2" - header "google-cloud-speech-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-speech-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-speech-v2 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-speech-v2 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-speech-v2 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json deleted file mode 100644 index d420dfa5479a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.speech.v2", - "libraryPackage": "::Google::Cloud::Speech::V2", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Speech::V2::Speech::Client", - "rpcs": { - "CreateRecognizer": { - "methods": [ - "create_recognizer" - ] - }, - "ListRecognizers": { - "methods": [ - "list_recognizers" - ] - }, - "GetRecognizer": { - "methods": [ - "get_recognizer" - ] - }, - "UpdateRecognizer": { - "methods": [ - "update_recognizer" - ] - }, - "DeleteRecognizer": { - "methods": [ - "delete_recognizer" - ] - }, - "UndeleteRecognizer": { - "methods": [ - "undelete_recognizer" - ] - }, - "Recognize": { - "methods": [ - "recognize" - ] - }, - "StreamingRecognize": { - "methods": [ - "streaming_recognize" - ] - }, - "BatchRecognize": { - "methods": [ - "batch_recognize" - ] - }, - "GetConfig": { - "methods": [ - "get_config" - ] - }, - "UpdateConfig": { - "methods": [ - "update_config" - ] - }, - "CreateCustomClass": { - "methods": [ - "create_custom_class" - ] - }, - "ListCustomClasses": { - "methods": [ - "list_custom_classes" - ] - }, - "GetCustomClass": { - "methods": [ - "get_custom_class" - ] - }, - "UpdateCustomClass": { - "methods": [ - "update_custom_class" - ] - }, - "DeleteCustomClass": { - "methods": [ - "delete_custom_class" - ] - }, - "UndeleteCustomClass": { - "methods": [ - "undelete_custom_class" - ] - }, - "CreatePhraseSet": { - "methods": [ - "create_phrase_set" - ] - }, - "ListPhraseSets": { - "methods": [ - "list_phrase_sets" - ] - }, - "GetPhraseSet": { - "methods": [ - "get_phrase_set" - ] - }, - "UpdatePhraseSet": { - "methods": [ - "update_phrase_set" - ] - }, - "DeletePhraseSet": { - "methods": [ - "delete_phrase_set" - ] - }, - "UndeletePhraseSet": { - "methods": [ - "undelete_phrase_set" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec b/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec deleted file mode 100644 index 352e0bb5d42e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/speech/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-speech-v2" - gem.version = Google::Cloud::Speech::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." - gem.summary = "Converts audio to text by applying powerful neural network models." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb deleted file mode 100644 index ca01b088ebe3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.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/speech/v2" diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb deleted file mode 100644 index e2a296043fce..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.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! - -require "google/cloud/speech/v2/speech" -require "google/cloud/speech/v2/version" - -module Google - module Cloud - module Speech - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/speech/v2" - # client = ::Google::Cloud::Speech::V2::Speech::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/speech/v2" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/speech/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb deleted file mode 100644 index a89a217f0dc0..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb +++ /dev/null @@ -1,75 +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" - -module Google - module Cloud - module Speech - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/speech/v2/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module V2 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Speech"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb deleted file mode 100644 index 74ff2fb094b4..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb +++ /dev/null @@ -1,134 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v2/cloud_speech.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n)google/cloud/speech/v2/cloud_speech.proto\x12\x16google.cloud.speech.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbe\x01\n\x17\x43reateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rrecognizer_id\x18\x03 \x01(\t\x12\x38\n\x06parent\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 speech.googleapis.com/Recognizer\"\xe7\x0c\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0e\n\x06method\x18\x04 \x01(\t\x12<\n\x0ckms_key_name\x18\x06 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12K\n\x14kms_key_version_name\x18\x07 \x01(\tB-\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12P\n\x17\x62\x61tch_recognize_request\x18\x08 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeRequestH\x00\x12T\n\x19\x63reate_recognizer_request\x18\t \x01(\x0b\x32/.google.cloud.speech.v2.CreateRecognizerRequestH\x00\x12T\n\x19update_recognizer_request\x18\n \x01(\x0b\x32/.google.cloud.speech.v2.UpdateRecognizerRequestH\x00\x12T\n\x19\x64\x65lete_recognizer_request\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.DeleteRecognizerRequestH\x00\x12X\n\x1bundelete_recognizer_request\x18\x0c \x01(\x0b\x32\x31.google.cloud.speech.v2.UndeleteRecognizerRequestH\x00\x12W\n\x1b\x63reate_custom_class_request\x18\r \x01(\x0b\x32\x30.google.cloud.speech.v2.CreateCustomClassRequestH\x00\x12W\n\x1bupdate_custom_class_request\x18\x0e \x01(\x0b\x32\x30.google.cloud.speech.v2.UpdateCustomClassRequestH\x00\x12W\n\x1b\x64\x65lete_custom_class_request\x18\x0f \x01(\x0b\x32\x30.google.cloud.speech.v2.DeleteCustomClassRequestH\x00\x12[\n\x1dundelete_custom_class_request\x18\x10 \x01(\x0b\x32\x32.google.cloud.speech.v2.UndeleteCustomClassRequestH\x00\x12S\n\x19\x63reate_phrase_set_request\x18\x11 \x01(\x0b\x32..google.cloud.speech.v2.CreatePhraseSetRequestH\x00\x12S\n\x19update_phrase_set_request\x18\x12 \x01(\x0b\x32..google.cloud.speech.v2.UpdatePhraseSetRequestH\x00\x12S\n\x19\x64\x65lete_phrase_set_request\x18\x13 \x01(\x0b\x32..google.cloud.speech.v2.DeletePhraseSetRequestH\x00\x12W\n\x1bundelete_phrase_set_request\x18\x14 \x01(\x0b\x32\x30.google.cloud.speech.v2.UndeletePhraseSetRequestH\x00\x12P\n\x15update_config_request\x18\x15 \x01(\x0b\x32+.google.cloud.speech.v2.UpdateConfigRequestB\x02\x18\x01H\x00\x12\x18\n\x10progress_percent\x18\x16 \x01(\x05\x12R\n\x18\x62\x61tch_recognize_metadata\x18\x17 \x01(\x0b\x32..google.cloud.speech.v2.BatchRecognizeMetadataH\x01\x42\t\n\x07requestB\n\n\x08metadata\"\x90\x01\n\x16ListRecognizersRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"k\n\x17ListRecognizersResponse\x12\x37\n\x0brecognizers\x18\x01 \x03(\x0b\x32\".google.cloud.speech.v2.Recognizer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\"\x9e\x01\n\x17UpdateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8d\x01\n\x17\x44\x65leteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"x\n\x19UndeleteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xc5\x07\n\nRecognizer\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x14\n\x05model\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x0elanguage_codes\x18\x11 \x03(\tB\x05\x18\x01\xe0\x41\x01\x12M\n\x1a\x64\x65\x66\x61ult_recognition_config\x18\x06 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12H\n\x0b\x61nnotations\x18\x07 \x03(\x0b\x32\x33.google.cloud.speech.v2.Recognizer.AnnotationsEntry\x12<\n\x05state\x18\x08 \x01(\x0e\x32(.google.cloud.speech.v2.Recognizer.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\x0f \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x10 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:j\xea\x41g\n speech.googleapis.com/Recognizer\x12@projects/{project}/locations/{location}/recognizers/{recognizer}R\x01\x01\"\x1a\n\x18\x41utoDetectDecodingConfig\"\xf0\x02\n\x16\x45xplicitDecodingConfig\x12S\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32<.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13\x61udio_channel_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xbe\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\t\n\x05MULAW\x10\x02\x12\x08\n\x04\x41LAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x08\n\x04\x46LAC\x10\x06\x12\x07\n\x03MP3\x10\x07\x12\x0c\n\x08OGG_OPUS\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x0b\n\x07MP4_AAC\x10\n\x12\x0b\n\x07M4A_AAC\x10\x0b\x12\x0b\n\x07MOV_AAC\x10\x0c\"Z\n\x18SpeakerDiarizationConfig\x12\x1e\n\x11min_speaker_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11max_speaker_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"0\n\x12\x43ustomPromptConfig\x12\x1a\n\rcustom_prompt\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xc7\x04\n\x13RecognitionFeatures\x12\x18\n\x10profanity_filter\x18\x01 \x01(\x08\x12 \n\x18\x65nable_word_time_offsets\x18\x02 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x04 \x01(\x08\x12!\n\x19\x65nable_spoken_punctuation\x18\x0e \x01(\x08\x12\x1c\n\x14\x65nable_spoken_emojis\x18\x0f \x01(\x08\x12X\n\x12multi_channel_mode\x18\x11 \x01(\x0e\x32<.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode\x12L\n\x12\x64iarization_config\x18\t \x01(\x0b\x32\x30.google.cloud.speech.v2.SpeakerDiarizationConfig\x12\x18\n\x10max_alternatives\x18\x10 \x01(\x05\x12M\n\x14\x63ustom_prompt_config\x18\x12 \x01(\x0b\x32*.google.cloud.speech.v2.CustomPromptConfigB\x03\xe0\x41\x01\"\\\n\x10MultiChannelMode\x12\"\n\x1eMULTI_CHANNEL_MODE_UNSPECIFIED\x10\x00\x12$\n SEPARATE_RECOGNITION_PER_CHANNEL\x10\x01\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v2.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\"1\n\x11TranslationConfig\x12\x1c\n\x0ftarget_language\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbf\x02\n\x10SpeechAdaptation\x12Q\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet\x12;\n\x0e\x63ustom_classes\x18\x02 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x1a\x9a\x01\n\x13\x41\x64\x61ptationPhraseSet\x12:\n\nphrase_set\x18\x01 \x01(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSetH\x00\x12>\n\x11inline_phrase_set\x18\x02 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetH\x00\x42\x07\n\x05value\">\n\x0e\x44\x65noiserConfig\x12\x15\n\rdenoise_audio\x18\x01 \x01(\x08\x12\x15\n\rsnr_threshold\x18\x02 \x01(\x02\"\xe4\x04\n\x11RecognitionConfig\x12P\n\x14\x61uto_decoding_config\x18\x07 \x01(\x0b\x32\x30.google.cloud.speech.v2.AutoDetectDecodingConfigH\x00\x12R\n\x18\x65xplicit_decoding_config\x18\x08 \x01(\x0b\x32..google.cloud.speech.v2.ExplicitDecodingConfigH\x00\x12\x12\n\x05model\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0elanguage_codes\x18\n \x03(\tB\x03\xe0\x41\x01\x12=\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32+.google.cloud.speech.v2.RecognitionFeatures\x12<\n\nadaptation\x18\x06 \x01(\x0b\x32(.google.cloud.speech.v2.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.TranscriptNormalizationB\x03\xe0\x41\x01\x12J\n\x12translation_config\x18\x0f \x01(\x0b\x32).google.cloud.speech.v2.TranslationConfigB\x03\xe0\x41\x01\x12\x44\n\x0f\x64\x65noiser_config\x18\x10 \x01(\x0b\x32&.google.cloud.speech.v2.DenoiserConfigB\x03\xe0\x41\x01\x42\x11\n\x0f\x64\x65\x63oding_config\"\xee\x01\n\x10RecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x11\n\x07\x63ontent\x18\x05 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x9d\x01\n\x1bRecognitionResponseMetadata\x12\x1c\n\nrequest_id\x18\t \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x38\n\x15total_billed_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1b\n\x06prompt\x18\n \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_prompt\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v2.WordInfo\"\xa3\x01\n\x08WordInfo\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x15\n\rspeaker_label\x18\x06 \x01(\t\"\xcc\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\x9c\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x03 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\xf9\x04\n\x1cStreamingRecognitionFeatures\x12$\n\x1c\x65nable_voice_activity_events\x18\x01 \x01(\x08\x12\x17\n\x0finterim_results\x18\x02 \x01(\x08\x12i\n\x16voice_activity_timeout\x18\x03 \x01(\x0b\x32I.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout\x12q\n\x17\x65ndpointing_sensitivity\x18\x08 \x01(\x0e\x32K.google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivityB\x03\xe0\x41\x01\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xb2\x01\n\x16\x45ndpointingSensitivity\x12\'\n#ENDPOINTING_SENSITIVITY_UNSPECIFIED\x10\x00\x12$\n ENDPOINTING_SENSITIVITY_STANDARD\x10\x01\x12&\n\"ENDPOINTING_SENSITIVITY_SUPERSHORT\x10\x02\x12!\n\x1d\x45NDPOINTING_SENSITIVITY_SHORT\x10\x03\"\xdf\x01\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfigB\x03\xe0\x41\x02\x12/\n\x0b\x63onfig_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12P\n\x12streaming_features\x18\x02 \x01(\x0b\x32\x34.google.cloud.speech.v2.StreamingRecognitionFeatures\"\xcf\x01\n\x19StreamingRecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12N\n\x10streaming_config\x18\x06 \x01(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionConfigH\x00\x12\x0f\n\x05\x61udio\x18\x05 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x88\x04\n\x15\x42\x61tchRecognizeRequest\x12<\n\nrecognizer\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x05\x66iles\x18\x03 \x03(\x0b\x32\x32.google.cloud.speech.v2.BatchRecognizeFileMetadata\x12R\n\x19recognition_output_config\x18\x06 \x01(\x0b\x32/.google.cloud.speech.v2.RecognitionOutputConfig\x12]\n\x13processing_strategy\x18\x07 \x01(\x0e\x32@.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy\"O\n\x12ProcessingStrategy\x12#\n\x1fPROCESSING_STRATEGY_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44YNAMIC_BATCHING\x10\x01\"\x1e\n\x0fGcsOutputConfig\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x14\n\x12InlineOutputConfig\"\x1e\n\x1cNativeOutputFileFormatConfig\"\x1b\n\x19VttOutputFileFormatConfig\"\x1b\n\x19SrtOutputFileFormatConfig\"\xda\x01\n\x12OutputFormatConfig\x12\x44\n\x06native\x18\x01 \x01(\x0b\x32\x34.google.cloud.speech.v2.NativeOutputFileFormatConfig\x12>\n\x03vtt\x18\x02 \x01(\x0b\x32\x31.google.cloud.speech.v2.VttOutputFileFormatConfig\x12>\n\x03srt\x18\x03 \x01(\x0b\x32\x31.google.cloud.speech.v2.SrtOutputFileFormatConfig\"\x86\x02\n\x17RecognitionOutputConfig\x12\x44\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\'.google.cloud.speech.v2.GcsOutputConfigH\x00\x12L\n\x16inline_response_config\x18\x02 \x01(\x0b\x32*.google.cloud.speech.v2.InlineOutputConfigH\x00\x12M\n\x14output_format_config\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v2.OutputFormatConfigB\x03\xe0\x41\x01\x42\x08\n\x06output\"\x82\x02\n\x16\x42\x61tchRecognizeResponse\x12L\n\x07results\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeResponse.ResultsEntry\x12\x38\n\x15total_billed_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a`\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.speech.v2.BatchRecognizeFileResult:\x02\x38\x01\"\xa0\x01\n\x15\x42\x61tchRecognizeResults\x12@\n\x07results\x18\x01 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"Q\n\x12\x43loudStorageResult\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x16\n\x0evtt_format_uri\x18\x02 \x01(\t\x12\x16\n\x0esrt_format_uri\x18\x03 \x01(\t\"}\n\x0cInlineResult\x12\x41\n\ntranscript\x18\x01 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResults\x12\x14\n\x0cvtt_captions\x18\x02 \x01(\t\x12\x14\n\x0csrt_captions\x18\x03 \x01(\t\"\xf1\x02\n\x18\x42\x61tchRecognizeFileResult\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x08metadata\x18\x03 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\x12J\n\x14\x63loud_storage_result\x18\x05 \x01(\x0b\x32*.google.cloud.speech.v2.CloudStorageResultH\x00\x12=\n\rinline_result\x18\x06 \x01(\x0b\x32$.google.cloud.speech.v2.InlineResultH\x00\x12\x0f\n\x03uri\x18\x01 \x01(\tB\x02\x18\x01\x12\x45\n\ntranscript\x18\x04 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResultsB\x02\x18\x01\x42\x08\n\x06result\"o\n#BatchRecognizeTranscriptionMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x0b\n\x03uri\x18\x03 \x01(\t\"\xfe\x01\n\x16\x42\x61tchRecognizeMetadata\x12i\n\x16transcription_metadata\x18\x01 \x03(\x0b\x32I.google.cloud.speech.v2.BatchRecognizeMetadata.TranscriptionMetadataEntry\x1ay\n\x1aTranscriptionMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata:\x02\x38\x01\"\xa7\x01\n\x1a\x42\x61tchRecognizeFileMetadata\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x0e\n\x0c\x61udio_source\"\xf4\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xc7\x03\n\x1aStreamingRecognizeResponse\x12\x43\n\x07results\x18\x06 \x03(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x03 \x01(\x0e\x32\x42.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType\x12\x36\n\x13speech_event_offset\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\x08metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\x85\x01\n\x0fSpeechEventType\x12!\n\x1dSPEECH_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\"\xe8\x01\n\x06\x43onfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:Q\xea\x41N\n\x1cspeech.googleapis.com/Config\x12.projects/{project}/locations/{location}/config\"F\n\x10GetConfigRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cspeech.googleapis.com/Config\"{\n\x13UpdateConfigRequest\x12\x33\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1e.google.cloud.speech.v2.ConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xad\x07\n\x0b\x43ustomClass\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05items\x18\x05 \x03(\x0b\x32-.google.cloud.speech.v2.CustomClass.ClassItem\x12=\n\x05state\x18\x0f \x01(\x0e\x32).google.cloud.speech.v2.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x34.google.cloud.speech.v2.CustomClass.AnnotationsEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:o\xea\x41l\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}R\x01\x01\"\xae\x07\n\tPhraseSet\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x07phrases\x18\x03 \x03(\x0b\x32(.google.cloud.speech.v2.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12;\n\x05state\x18\x0f \x01(\x0e\x32\'.google.cloud.speech.v2.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x32.google.cloud.speech.v2.PhraseSet.AnnotationsEntry\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:h\xea\x41\x65\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}R\x01\x01\"\xc5\x01\n\x18\x43reateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\x0f\x63ustom_class_id\x18\x03 \x01(\t\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\"\x92\x01\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"\xa2\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8f\x01\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"z\n\x1aUndeleteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xbb\x01\n\x16\x43reatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rphrase_set_id\x18\x03 \x01(\t\x12\x37\n\x06parent\x18\x04 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\"\x8f\x01\n\x15ListPhraseSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"i\n\x16ListPhraseSetsResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v2.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\x9c\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8b\x01\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"v\n\x18UndeletePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t2\xbf%\n\x06Speech\x12\xec\x01\n\x10\x43reateRecognizer\x12/.google.cloud.speech.v2.CreateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x1fparent,recognizer,recognizer_id\x82\xd3\xe4\x93\x02=\"//v2/{parent=projects/*/locations/*}/recognizers:\nrecognizer\x12\xb4\x01\n\x0fListRecognizers\x12..google.cloud.speech.v2.ListRecognizersRequest\x1a/.google.cloud.speech.v2.ListRecognizersResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2/{parent=projects/*/locations/*}/recognizers\x12\xa1\x01\n\rGetRecognizer\x12,.google.cloud.speech.v2.GetRecognizerRequest\x1a\".google.cloud.speech.v2.Recognizer\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2/{name=projects/*/locations/*/recognizers/*}\x12\xee\x01\n\x10UpdateRecognizer\x12/.google.cloud.speech.v2.UpdateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x16recognizer,update_mask\x82\xd3\xe4\x93\x02H2:/v2/{recognizer.name=projects/*/locations/*/recognizers/*}:\nrecognizer\x12\xc4\x01\n\x10\x44\x65leteRecognizer\x12/.google.cloud.speech.v2.DeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"`\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2/{name=projects/*/locations/*/recognizers/*}\x12\xd4\x01\n\x12UndeleteRecognizer\x12\x31.google.cloud.speech.v2.UndeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v2/{name=projects/*/locations/*/recognizers/*}:undelete:\x01*\x12\xf9\x01\n\tRecognize\x12(.google.cloud.speech.v2.RecognizeRequest\x1a).google.cloud.speech.v2.RecognizeResponse\"\x96\x01\xda\x41%recognizer,config,config_mask,content\xda\x41!recognizer,config,config_mask,uri\x82\xd3\xe4\x93\x02\x44\"?/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v2.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v2.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x12\x84\x02\n\x0e\x42\x61tchRecognize\x12-.google.cloud.speech.v2.BatchRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41+\n\x16\x42\x61tchRecognizeResponse\x12\x11OperationMetadata\xda\x41#recognizer,config,config_mask,files\x82\xd3\xe4\x93\x02I\"D/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize:\x01*\x12\x8e\x01\n\tGetConfig\x12(.google.cloud.speech.v2.GetConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2/{name=projects/*/locations/*/config}\x12\xb1\x01\n\x0cUpdateConfig\x12+.google.cloud.speech.v2.UpdateConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"T\xda\x41\x12\x63onfig,update_mask\x82\xd3\xe4\x93\x02\x39\x32//v2/{config.name=projects/*/locations/*/config}:\x06\x63onfig\x12\xf7\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v2.CreateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x41\"1/v2/{parent=projects/*/locations/*}/customClasses:\x0c\x63ustom_class\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v2.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v2.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{parent=projects/*/locations/*}/customClasses\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v2.GetCustomClassRequest\x1a#.google.cloud.speech.v2.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{name=projects/*/locations/*/customClasses/*}\x12\xf9\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v2.UpdateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v2/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xc9\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v2.DeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v2/{name=projects/*/locations/*/customClasses/*}\x12\xd9\x01\n\x13UndeleteCustomClass\x12\x32.google.cloud.speech.v2.UndeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v2/{name=projects/*/locations/*/customClasses/*}:undelete:\x01*\x12\xe8\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v2.CreatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02<\"./v2/{parent=projects/*/locations/*}/phraseSets:\nphrase_set\x12\xb0\x01\n\x0eListPhraseSets\x12-.google.cloud.speech.v2.ListPhraseSetsRequest\x1a..google.cloud.speech.v2.ListPhraseSetsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v2/{parent=projects/*/locations/*}/phraseSets\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v2.GetPhraseSetRequest\x1a!.google.cloud.speech.v2.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xea\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v2.UpdatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xc0\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v2.DeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xd0\x01\n\x11UndeletePhraseSet\x12\x30.google.cloud.speech.v2.UndeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v2/{name=projects/*/locations/*/phraseSets/*}:undelete:\x01*\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x03\n\x1a\x63om.google.cloud.speech.v2B\x10\x43loudSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Speech - module V2 - CreateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateRecognizerRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OperationMetadata").msgclass - ListRecognizersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersRequest").msgclass - ListRecognizersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersResponse").msgclass - GetRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetRecognizerRequest").msgclass - UpdateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateRecognizerRequest").msgclass - DeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteRecognizerRequest").msgclass - UndeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteRecognizerRequest").msgclass - Recognizer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer").msgclass - Recognizer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer.State").enummodule - AutoDetectDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AutoDetectDecodingConfig").msgclass - ExplicitDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig").msgclass - ExplicitDecodingConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding").enummodule - SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeakerDiarizationConfig").msgclass - CustomPromptConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomPromptConfig").msgclass - RecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures").msgclass - RecognitionFeatures::MultiChannelMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode").enummodule - TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization").msgclass - TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization.Entry").msgclass - TranslationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranslationConfig").msgclass - SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation").msgclass - SpeechAdaptation::AdaptationPhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet").msgclass - DenoiserConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DenoiserConfig").msgclass - RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionConfig").msgclass - RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeRequest").msgclass - RecognitionResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionResponseMetadata").msgclass - SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionAlternative").msgclass - WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.WordInfo").msgclass - SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionResult").msgclass - RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeResponse").msgclass - StreamingRecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures").msgclass - StreamingRecognitionFeatures::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout").msgclass - StreamingRecognitionFeatures::EndpointingSensitivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivity").enummodule - StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass - StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass - BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass - BatchRecognizeRequest::ProcessingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy").enummodule - GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GcsOutputConfig").msgclass - InlineOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineOutputConfig").msgclass - NativeOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.NativeOutputFileFormatConfig").msgclass - VttOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.VttOutputFileFormatConfig").msgclass - SrtOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SrtOutputFileFormatConfig").msgclass - OutputFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OutputFormatConfig").msgclass - RecognitionOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionOutputConfig").msgclass - BatchRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResponse").msgclass - BatchRecognizeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResults").msgclass - CloudStorageResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CloudStorageResult").msgclass - InlineResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineResult").msgclass - BatchRecognizeFileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileResult").msgclass - BatchRecognizeTranscriptionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata").msgclass - BatchRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeMetadata").msgclass - BatchRecognizeFileMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileMetadata").msgclass - StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionResult").msgclass - StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse").msgclass - StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType").enummodule - Config = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Config").msgclass - GetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetConfigRequest").msgclass - UpdateConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateConfigRequest").msgclass - CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass").msgclass - CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.ClassItem").msgclass - CustomClass::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.State").enummodule - PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet").msgclass - PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.Phrase").msgclass - PhraseSet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.State").enummodule - CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateCustomClassRequest").msgclass - ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesRequest").msgclass - ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesResponse").msgclass - GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetCustomClassRequest").msgclass - UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateCustomClassRequest").msgclass - DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteCustomClassRequest").msgclass - UndeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteCustomClassRequest").msgclass - CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreatePhraseSetRequest").msgclass - ListPhraseSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsRequest").msgclass - ListPhraseSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsResponse").msgclass - GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetPhraseSetRequest").msgclass - UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdatePhraseSetRequest").msgclass - DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeletePhraseSetRequest").msgclass - UndeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeletePhraseSetRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb deleted file mode 100644 index 5a22ae3fcf4a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb +++ /dev/null @@ -1,98 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/speech/v2/cloud_speech.proto for package 'google.cloud.speech.v2' -# Original file comments: -# 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 -# -# 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/speech/v2/cloud_speech_pb' - -module Google - module Cloud - module Speech - module V2 - module Speech - # Enables speech transcription and resource management. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.speech.v2.Speech' - - # Creates a [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :CreateRecognizer, ::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Google::Longrunning::Operation - # Lists Recognizers. - rpc :ListRecognizers, ::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Google::Cloud::Speech::V2::ListRecognizersResponse - # Returns the requested - # [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't - # exist. - rpc :GetRecognizer, ::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Google::Cloud::Speech::V2::Recognizer - # Updates the [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :UpdateRecognizer, ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Google::Longrunning::Operation - # Deletes the [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :DeleteRecognizer, ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Google::Longrunning::Operation - # Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :UndeleteRecognizer, ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Google::Longrunning::Operation - # Performs synchronous Speech recognition: receive results after all audio - # has been sent and processed. - rpc :Recognize, ::Google::Cloud::Speech::V2::RecognizeRequest, ::Google::Cloud::Speech::V2::RecognizeResponse - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V2::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V2::StreamingRecognizeResponse) - # Performs batch asynchronous speech recognition: send a request with N - # audio files and receive a long running operation that can be polled to see - # when the transcriptions are finished. - rpc :BatchRecognize, ::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Google::Longrunning::Operation - # Returns the requested [Config][google.cloud.speech.v2.Config]. - rpc :GetConfig, ::Google::Cloud::Speech::V2::GetConfigRequest, ::Google::Cloud::Speech::V2::Config - # Updates the [Config][google.cloud.speech.v2.Config]. - rpc :UpdateConfig, ::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Google::Cloud::Speech::V2::Config - # Creates a [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :CreateCustomClass, ::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Google::Longrunning::Operation - # Lists CustomClasses. - rpc :ListCustomClasses, ::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Google::Cloud::Speech::V2::ListCustomClassesResponse - # Returns the requested - # [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :GetCustomClass, ::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Google::Cloud::Speech::V2::CustomClass - # Updates the [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :UpdateCustomClass, ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Google::Longrunning::Operation - # Deletes the [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :DeleteCustomClass, ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Google::Longrunning::Operation - # Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :UndeleteCustomClass, ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Google::Longrunning::Operation - # Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :CreatePhraseSet, ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Google::Longrunning::Operation - # Lists PhraseSets. - rpc :ListPhraseSets, ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Google::Cloud::Speech::V2::ListPhraseSetsResponse - # Returns the requested - # [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :GetPhraseSet, ::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Google::Cloud::Speech::V2::PhraseSet - # Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Google::Longrunning::Operation - # Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :DeletePhraseSet, ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Google::Longrunning::Operation - # Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :UndeletePhraseSet, ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb deleted file mode 100644 index 364f8dbcd6b5..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v2/locations_metadata.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/speech/v2/locations_metadata.proto\x12\x16google.cloud.speech.v2\"6\n\x0cModelFeature\x12\x0f\n\x07\x66\x65\x61ture\x18\x01 \x01(\t\x12\x15\n\rrelease_state\x18\x02 \x01(\t\"L\n\rModelFeatures\x12;\n\rmodel_feature\x18\x01 \x03(\x0b\x32$.google.cloud.speech.v2.ModelFeature\"\xbe\x01\n\rModelMetadata\x12P\n\x0emodel_features\x18\x01 \x03(\x0b\x32\x38.google.cloud.speech.v2.ModelMetadata.ModelFeaturesEntry\x1a[\n\x12ModelFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelFeatures:\x02\x38\x01\"\xae\x01\n\x10LanguageMetadata\x12\x44\n\x06models\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.LanguageMetadata.ModelsEntry\x1aT\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelMetadata:\x02\x38\x01\"\xc8\x01\n\x0e\x41\x63\x63\x65ssMetadata\x12N\n\x0f\x63onstraint_type\x18\x01 \x01(\x0e\x32\x35.google.cloud.speech.v2.AccessMetadata.ConstraintType\"f\n\x0e\x43onstraintType\x12\x1f\n\x1b\x43ONSTRAINT_TYPE_UNSPECIFIED\x10\x00\x12\x33\n/RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT\x10\x01\"\x91\x01\n\x11LocationsMetadata\x12;\n\tlanguages\x18\x01 \x01(\x0b\x32(.google.cloud.speech.v2.LanguageMetadata\x12?\n\x0f\x61\x63\x63\x65ss_metadata\x18\x02 \x01(\x0b\x32&.google.cloud.speech.v2.AccessMetadataBj\n\x1a\x63om.google.cloud.speech.v2B\x16LocationsMetadataProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Speech - module V2 - ModelFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeature").msgclass - ModelFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeatures").msgclass - ModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelMetadata").msgclass - LanguageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LanguageMetadata").msgclass - AccessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata").msgclass - AccessMetadata::ConstraintType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata.ConstraintType").enummodule - LocationsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LocationsMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb deleted file mode 100644 index 9f0d92b6e97b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/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/speech/v2/speech/rest" -require "google/cloud/speech/v2/bindings_override" -require "google/cloud/speech/v2/version" - -module Google - module Cloud - module Speech - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/speech/v2/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb deleted file mode 100644 index 5a66d0bd8b48..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.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/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/speech/v2/version" - -require "google/cloud/speech/v2/speech/credentials" -require "google/cloud/speech/v2/speech/paths" -require "google/cloud/speech/v2/speech/operations" -require "google/cloud/speech/v2/speech/client" -require "google/cloud/speech/v2/speech/rest" - -module Google - module Cloud - module Speech - module V2 - ## - # Enables speech transcription and resource management. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/speech/v2/speech" - # client = ::Google::Cloud::Speech::V2::Speech::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/speech/v2/speech/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module Speech - end - end - end - end -end - -helper_path = ::File.join __dir__, "speech", "helpers.rb" -require "google/cloud/speech/v2/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb deleted file mode 100644 index eddbc08258d0..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb +++ /dev/null @@ -1,2922 +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/speech/v2/cloud_speech_pb" -require "google/cloud/location" - -module Google - module Cloud - module Speech - module V2 - module Speech - ## - # Client for the Speech service. - # - # Enables speech transcription and resource management. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V2::Speech::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V2::Speech::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", "Speech", "V2"] - 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.timeout = 5000.0 - default_config.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 Speech 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::Speech::V2::Speech::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 - @speech_stub.universe_domain - end - - ## - # Create a new Speech client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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/speech/v2/cloud_speech_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 - - @speech_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Speech::V2::Speech::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 - ) - - @speech_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 - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @speech_stub.endpoint - config.universe_domain = @speech_stub.universe_domain - config.logger = @speech_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Speech::V2::Speech::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @speech_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload create_recognizer(request, options = nil) - # Pass arguments to `create_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) - # Pass arguments to `create_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the Recognizer, but do not - # actually create it. - # @param recognizer_id [::String] - # The ID to use for the Recognizer, which will become the final component of - # the Recognizer's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this Recognizer will be created. - # The expected format is `projects/{project}/locations/{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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new - # - # # Call the create_recognizer method. - # result = client.create_recognizer 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :create_recognizer, 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 - - ## - # Lists Recognizers. - # - # @overload list_recognizers(request, options = nil) - # Pass arguments to `list_recognizers` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_recognizers` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of Recognizers to list. The expected - # format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of Recognizers to return. The service may return fewer - # than this value. If unspecified, at most 5 Recognizers will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new - # - # # Call the list_recognizers method. - # result = client.list_recognizers 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::Speech::V2::Recognizer. - # p item - # end - # - def list_recognizers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest - - # Converts hash 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_recognizers.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::Speech::V2::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_recognizers.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_recognizers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :list_recognizers, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @speech_stub, :list_recognizers, 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 - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't - # exist. - # - # @overload get_recognizer(request, options = nil) - # Pass arguments to `get_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(name: nil) - # Pass arguments to `get_recognizer` via keyword arguments. Note that at - # least one keyword argument is 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 name of the Recognizer to retrieve. The expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::Recognizer] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::Recognizer] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new - # - # # Call the get_recognizer method. - # result = client.get_recognizer request - # - # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. - # p result - # - def get_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_recognizer, 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload update_recognizer(request, options = nil) - # Pass arguments to `update_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to update. - # - # The Recognizer's `name` field is used to identify the Recognizer to update. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire Recognizer resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated Recognizer, but do not - # actually update it. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new - # - # # Call the update_recognizer method. - # result = client.update_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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.recognizer&.name - header_params["recognizer.name"] = request.recognizer.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_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_recognizer, 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload delete_recognizer(request, options = nil) - # Pass arguments to `delete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_recognizer` via keyword arguments. Note that at - # least one keyword argument is 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 name of the Recognizer to delete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted Recognizer, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the Recognizer is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new - # - # # Call the delete_recognizer method. - # result = client.delete_recognizer 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :delete_recognizer, 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 - - ## - # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload undelete_recognizer(request, options = nil) - # Pass arguments to `undelete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at - # least one keyword argument is 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 name of the Recognizer to undelete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted Recognizer, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new - # - # # Call the undelete_recognizer method. - # result = client.undelete_recognizer 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 undelete_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest - - # Converts hash 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.undelete_recognizer.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::Speech::V2::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.undelete_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :undelete_recognizer, 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 - - ## - # Performs synchronous Speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field - # can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the - # values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param content [::String] - # The audio data bytes encoded as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As - # with all bytes fields, proto buffers use a pure binary representation, - # whereas JSON representations use base64. - # - # Note: The following parameters are mutually exclusive: `content`, `uri`. 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 uri [::String] - # URI that points to a file that contains audio data bytes as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file - # must not be compressed (for example, gzip). Currently, only Google Cloud - # Storage URIs are supported, which must be specified in the following - # format: `gs://bucket_name/object_name` (other URI formats return - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more - # information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following parameters are mutually exclusive: `uri`, `content`. 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::RecognizeResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest - - # Converts hash 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.recognize.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::Speech::V2::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.recognizer - header_params["recognizer"] = request.recognizer - 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.recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :recognize, 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 - - ## - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Speech::V2::StreamingRecognizeRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_recognize method to start streaming. - # output = client.streaming_recognize input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_recognize request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V2::StreamingRecognizeRequest - end - - # Converts hash 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.streaming_recognize.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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.streaming_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :streaming_recognize, 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 - - ## - # Performs batch asynchronous speech recognition: send a request with N - # audio files and receive a long running operation that can be polled to see - # when the transcriptions are finished. - # - # @overload batch_recognize(request, options = nil) - # Pass arguments to `batch_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) - # Pass arguments to `batch_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override - # the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all given fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] - # Audio files with file metadata for ASR. - # The maximum number of files allowed to be specified is 15. - # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] - # Configuration options for where to output the transcripts of each file. - # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] - # Processing strategy to use for this request. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new - # - # # Call the batch_recognize method. - # result = client.batch_recognize 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_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest - - # Converts hash 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_recognize.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::Speech::V2::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.recognizer - header_params["recognizer"] = request.recognizer - 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_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :batch_recognize, 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 - - ## - # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload get_config(request, options = nil) - # Pass arguments to `get_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_config(name: nil) - # Pass arguments to `get_config` via keyword arguments. Note that at - # least one keyword argument is 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 name of the config to retrieve. There is exactly one config - # resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetConfigRequest.new - # - # # Call the get_config method. - # result = client.get_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def get_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest - - # Converts hash 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_config.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::Speech::V2::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_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_config, 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload update_config(request, options = nil) - # Pass arguments to `update_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_config(config: nil, update_mask: nil) - # Pass arguments to `update_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V2::Config, ::Hash] - # Required. The config to update. - # - # The config's `name` field is used to identify the config to be updated. - # The expected format is `projects/{project}/locations/{location}/config`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new - # - # # Call the update_config method. - # result = client.update_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def update_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest - - # Converts hash 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_config.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::Speech::V2::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.config&.name - header_params["config.name"] = request.config.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_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_config, 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 {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the CustomClass, but do not - # actually create it. - # @param custom_class_id [::String] - # The ID to use for the CustomClass, which will become the final component of - # the CustomClass's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this CustomClass will be created. - # The expected format is `projects/{project}/locations/{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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :create_custom_class, 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 - - ## - # Lists CustomClasses. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of CustomClass resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Number of results per requests. A valid page_size ranges from 0 to 100 - # inclusive. If the page_size is zero or unspecified, a page size of 5 will - # be chosen. If the page size exceeds 100, it will be coerced down to 100. - # Note that a call might return fewer results than the requested page size. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must - # match the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes 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::Speech::V2::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest - - # Converts hash 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_custom_classes.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::Speech::V2::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_custom_classes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @speech_stub, :list_custom_classes, 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 - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is 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 name of the CustomClass to retrieve. The expected format is - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_custom_class, 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to update. - # - # The CustomClass's `name` field is used to identify the CustomClass to - # update. Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If empty, all fields are considered for - # update. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated CustomClass, but do - # not actually update it. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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.custom_class&.name - header_params["custom_class.name"] = request.custom_class.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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_custom_class, 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is 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 name of the CustomClass to delete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted CustomClass, but do - # not actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the CustomClass is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :delete_custom_class, 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 - - ## - # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload undelete_custom_class(request, options = nil) - # Pass arguments to `undelete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at - # least one keyword argument is 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 name of the CustomClass to undelete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted CustomClass, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new - # - # # Call the undelete_custom_class method. - # result = client.undelete_custom_class 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 undelete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest - - # Converts hash 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.undelete_custom_class.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::Speech::V2::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.undelete_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :undelete_custom_class, 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 - - ## - # Creates a {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the PhraseSet, but do not - # actually create it. - # @param phrase_set_id [::String] - # The ID to use for the PhraseSet, which will become the final component of - # the PhraseSet's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this PhraseSet will be created. - # The expected format is `projects/{project}/locations/{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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :create_phrase_set, 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 - - ## - # Lists PhraseSets. - # - # @overload list_phrase_sets(request, options = nil) - # Pass arguments to `list_phrase_sets` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of PhraseSet resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of PhraseSets to return. The service may return fewer - # than this value. If unspecified, at most 5 PhraseSets will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new - # - # # Call the list_phrase_sets method. - # result = client.list_phrase_sets 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::Speech::V2::PhraseSet. - # p item - # end - # - def list_phrase_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest - - # Converts hash 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_phrase_sets.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::Speech::V2::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_phrase_sets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_phrase_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :list_phrase_sets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @speech_stub, :list_phrase_sets, 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 - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is 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 name of the PhraseSet to retrieve. The expected format is - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_phrase_set, 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to update. - # - # The PhraseSet's `name` field is used to identify the PhraseSet to update. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire PhraseSet resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated PhraseSet, but do not - # actually update it. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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.phrase_set&.name - header_params["phrase_set.name"] = request.phrase_set.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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_phrase_set, 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is 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 name of the PhraseSet to delete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted PhraseSet, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the PhraseSet is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :delete_phrase_set, 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 - - ## - # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload undelete_phrase_set(request, options = nil) - # Pass arguments to `undelete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is 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 name of the PhraseSet to undelete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted PhraseSet, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new - # - # # Call the undelete_phrase_set method. - # result = client.undelete_phrase_set 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 undelete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest - - # Converts hash 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.undelete_phrase_set.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::Speech::V2::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.undelete_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :undelete_phrase_set, 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 Speech API. - # - # This class represents the configuration for Speech, - # 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::Speech::V2::Speech::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_recognizer to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V2::Speech::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.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::Speech::V2::Speech::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. - # * `: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 = "speech.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 Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :create_recognizer - ## - # RPC-specific configuration for `list_recognizers` - # @return [::Gapic::Config::Method] - # - attr_reader :list_recognizers - ## - # RPC-specific configuration for `get_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recognizer - ## - # RPC-specific configuration for `update_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :update_recognizer - ## - # RPC-specific configuration for `delete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_recognizer - ## - # RPC-specific configuration for `undelete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_recognizer - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `streaming_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_recognize - ## - # RPC-specific configuration for `batch_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_recognize - ## - # RPC-specific configuration for `get_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_config - ## - # RPC-specific configuration for `update_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_config - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - ## - # RPC-specific configuration for `undelete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_custom_class - ## - # RPC-specific configuration for `create_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `list_phrase_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_sets - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `undelete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_phrase_set - - # @private - def initialize parent_rpcs = nil - create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer - @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config - list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers - @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config - get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer - @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config - update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer - @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config - delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer - @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config - undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer - @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize - @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config - batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize - @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config - get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config - @get_config = ::Gapic::Config::Method.new get_config_config - update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config - @update_config = ::Gapic::Config::Method.new update_config_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class - @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets - @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set - @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb deleted file mode 100644 index 815acecc565d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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 Speech - module V2 - module Speech - # Credentials for the Speech API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SPEECH_CREDENTIALS", - "SPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPEECH_CREDENTIALS_JSON", - "SPEECH_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb deleted file mode 100644 index 7972b3add947..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb +++ /dev/null @@ -1,841 +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 Speech - module V2 - module Speech - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V2::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::Speech::V2::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::Speech::V2::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::Speech::V2::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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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. - # * `: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 = "speech.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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb deleted file mode 100644 index b1310528c078..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb +++ /dev/null @@ -1,168 +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 Speech - module V2 - module Speech - # Path helper methods for the Speech API. - module Paths - ## - # Create a fully-qualified Config resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/config` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def config_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/config" - end - - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified CryptoKeyVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified CustomClass resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @param project [String] - # @param location [String] - # @param custom_class [String] - # - # @return [::String] - def custom_class_path project:, location:, custom_class: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" - 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - ## - # Create a fully-qualified Recognizer resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/recognizers/{recognizer}` - # - # @param project [String] - # @param location [String] - # @param recognizer [String] - # - # @return [::String] - def recognizer_path project:, location:, recognizer: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/recognizers/#{recognizer}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb deleted file mode 100644 index c28a87547a1b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/speech/v2/version" -require "google/cloud/speech/v2/bindings_override" - -require "google/cloud/speech/v2/speech/credentials" -require "google/cloud/speech/v2/speech/paths" -require "google/cloud/speech/v2/speech/rest/operations" -require "google/cloud/speech/v2/speech/rest/client" - -module Google - module Cloud - module Speech - module V2 - ## - # Enables speech transcription and resource management. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/speech/v2/speech/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module Speech - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/speech/v2/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb deleted file mode 100644 index 5baef8881324..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb +++ /dev/null @@ -1,2647 +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/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/speech/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Speech - module V2 - module Speech - module Rest - ## - # REST client for the Speech service. - # - # Enables speech transcription and resource management. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V2::Speech::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V2::Speech::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", "Speech", "V2"] - 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.timeout = 5000.0 - default_config.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 Speech 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::Speech::V2::Speech::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 - @speech_stub.universe_domain - end - - ## - # Create a new Speech REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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::Speech::V2::Speech::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 - - @speech_stub = ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @speech_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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @speech_stub.endpoint - config.universe_domain = @speech_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @speech_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Speech::V2::Speech::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @speech_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload create_recognizer(request, options = nil) - # Pass arguments to `create_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) - # Pass arguments to `create_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the Recognizer, but do not - # actually create it. - # @param recognizer_id [::String] - # The ID to use for the Recognizer, which will become the final component of - # the Recognizer's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this Recognizer will be created. - # The expected format is `projects/{project}/locations/{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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new - # - # # Call the create_recognizer method. - # result = client.create_recognizer 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.create_recognizer 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 - - ## - # Lists Recognizers. - # - # @overload list_recognizers(request, options = nil) - # Pass arguments to `list_recognizers` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_recognizers` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of Recognizers to list. The expected - # format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of Recognizers to return. The service may return fewer - # than this value. If unspecified, at most 5 Recognizers will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new - # - # # Call the list_recognizers method. - # result = client.list_recognizers 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::Speech::V2::Recognizer. - # p item - # end - # - def list_recognizers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest - - # Converts hash 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_recognizers.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::Speech::V2::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_recognizers.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_recognizers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.list_recognizers request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_recognizers, "recognizers", 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 - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't - # exist. - # - # @overload get_recognizer(request, options = nil) - # Pass arguments to `get_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(name: nil) - # Pass arguments to `get_recognizer` via keyword arguments. Note that at - # least one keyword argument is 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 name of the Recognizer to retrieve. The expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Recognizer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Recognizer] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new - # - # # Call the get_recognizer method. - # result = client.get_recognizer request - # - # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. - # p result - # - def get_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_recognizer 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload update_recognizer(request, options = nil) - # Pass arguments to `update_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to update. - # - # The Recognizer's `name` field is used to identify the Recognizer to update. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire Recognizer resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated Recognizer, but do not - # actually update it. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new - # - # # Call the update_recognizer method. - # result = client.update_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_recognizer 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload delete_recognizer(request, options = nil) - # Pass arguments to `delete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_recognizer` via keyword arguments. Note that at - # least one keyword argument is 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 name of the Recognizer to delete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted Recognizer, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the Recognizer is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new - # - # # Call the delete_recognizer method. - # result = client.delete_recognizer 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest - - # Converts hash 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_recognizer.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::Speech::V2::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_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.delete_recognizer 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 - - ## - # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload undelete_recognizer(request, options = nil) - # Pass arguments to `undelete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at - # least one keyword argument is 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 name of the Recognizer to undelete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted Recognizer, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new - # - # # Call the undelete_recognizer method. - # result = client.undelete_recognizer 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 undelete_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest - - # Converts hash 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.undelete_recognizer.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::Speech::V2::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.undelete_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.undelete_recognizer 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 - - ## - # Performs synchronous Speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field - # can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the - # values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param content [::String] - # The audio data bytes encoded as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As - # with all bytes fields, proto buffers use a pure binary representation, - # whereas JSON representations use base64. - # - # Note: The following parameters are mutually exclusive: `content`, `uri`. 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 uri [::String] - # URI that points to a file that contains audio data bytes as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file - # must not be compressed (for example, gzip). Currently, only Google Cloud - # Storage URIs are supported, which must be specified in the following - # format: `gs://bucket_name/object_name` (other URI formats return - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more - # information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following parameters are mutually exclusive: `uri`, `content`. 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest - - # Converts hash 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.recognize.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::Speech::V2::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.recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.recognize 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 - - ## - # Performs batch asynchronous speech recognition: send a request with N - # audio files and receive a long running operation that can be polled to see - # when the transcriptions are finished. - # - # @overload batch_recognize(request, options = nil) - # Pass arguments to `batch_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) - # Pass arguments to `batch_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override - # the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all given fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] - # Audio files with file metadata for ASR. - # The maximum number of files allowed to be specified is 15. - # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] - # Configuration options for where to output the transcripts of each file. - # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] - # Processing strategy to use for this request. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new - # - # # Call the batch_recognize method. - # result = client.batch_recognize 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_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest - - # Converts hash 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_recognize.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::Speech::V2::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_recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.batch_recognize 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 - - ## - # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload get_config(request, options = nil) - # Pass arguments to `get_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_config(name: nil) - # Pass arguments to `get_config` via keyword arguments. Note that at - # least one keyword argument is 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 name of the config to retrieve. There is exactly one config - # resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetConfigRequest.new - # - # # Call the get_config method. - # result = client.get_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def get_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest - - # Converts hash 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_config.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::Speech::V2::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_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_config 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload update_config(request, options = nil) - # Pass arguments to `update_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_config(config: nil, update_mask: nil) - # Pass arguments to `update_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V2::Config, ::Hash] - # Required. The config to update. - # - # The config's `name` field is used to identify the config to be updated. - # The expected format is `projects/{project}/locations/{location}/config`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new - # - # # Call the update_config method. - # result = client.update_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def update_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest - - # Converts hash 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_config.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::Speech::V2::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_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_config 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 {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the CustomClass, but do not - # actually create it. - # @param custom_class_id [::String] - # The ID to use for the CustomClass, which will become the final component of - # the CustomClass's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this CustomClass will be created. - # The expected format is `projects/{project}/locations/{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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.create_custom_class 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 - - ## - # Lists CustomClasses. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of CustomClass resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Number of results per requests. A valid page_size ranges from 0 to 100 - # inclusive. If the page_size is zero or unspecified, a page size of 5 will - # be chosen. If the page size exceeds 100, it will be coerced down to 100. - # Note that a call might return fewer results than the requested page size. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} must - # match the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes 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::Speech::V2::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest - - # Converts hash 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_custom_classes.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::Speech::V2::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_custom_classes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.list_custom_classes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_custom_classes, "custom_classes", 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 - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is 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 name of the CustomClass to retrieve. The expected format is - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_custom_class 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to update. - # - # The CustomClass's `name` field is used to identify the CustomClass to - # update. Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If empty, all fields are considered for - # update. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated CustomClass, but do - # not actually update it. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_custom_class 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is 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 name of the CustomClass to delete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted CustomClass, but do - # not actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the CustomClass is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest - - # Converts hash 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_custom_class.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::Speech::V2::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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.delete_custom_class 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 - - ## - # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload undelete_custom_class(request, options = nil) - # Pass arguments to `undelete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at - # least one keyword argument is 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 name of the CustomClass to undelete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted CustomClass, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new - # - # # Call the undelete_custom_class method. - # result = client.undelete_custom_class 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 undelete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest - - # Converts hash 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.undelete_custom_class.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::Speech::V2::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.undelete_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.undelete_custom_class 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 - - ## - # Creates a {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the PhraseSet, but do not - # actually create it. - # @param phrase_set_id [::String] - # The ID to use for the PhraseSet, which will become the final component of - # the PhraseSet's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this PhraseSet will be created. - # The expected format is `projects/{project}/locations/{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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.create_phrase_set 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 - - ## - # Lists PhraseSets. - # - # @overload list_phrase_sets(request, options = nil) - # Pass arguments to `list_phrase_sets` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of PhraseSet resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of PhraseSets to return. The service may return fewer - # than this value. If unspecified, at most 5 PhraseSets will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new - # - # # Call the list_phrase_sets method. - # result = client.list_phrase_sets 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::Speech::V2::PhraseSet. - # p item - # end - # - def list_phrase_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest - - # Converts hash 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_phrase_sets.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::Speech::V2::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_phrase_sets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_phrase_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.list_phrase_sets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_phrase_sets, "phrase_sets", 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 - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is 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 name of the PhraseSet to retrieve. The expected format is - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_phrase_set 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 - - ## - # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to update. - # - # The PhraseSet's `name` field is used to identify the PhraseSet to update. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire PhraseSet resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated PhraseSet, but do not - # actually update it. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_phrase_set 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is 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 name of the PhraseSet to delete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted PhraseSet, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the PhraseSet is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest - - # Converts hash 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_phrase_set.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::Speech::V2::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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.delete_phrase_set 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 - - ## - # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload undelete_phrase_set(request, options = nil) - # Pass arguments to `undelete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is 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 name of the PhraseSet to undelete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted PhraseSet, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @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/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new - # - # # Call the undelete_phrase_set method. - # result = client.undelete_phrase_set 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 undelete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest - - # Converts hash 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.undelete_phrase_set.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::Speech::V2::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.undelete_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.undelete_phrase_set 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 Speech REST API. - # - # This class represents the configuration for Speech 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::Speech::V2::Speech::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_recognizer to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V2::Speech::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.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. - # * `: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 = "speech.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - 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 Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :create_recognizer - ## - # RPC-specific configuration for `list_recognizers` - # @return [::Gapic::Config::Method] - # - attr_reader :list_recognizers - ## - # RPC-specific configuration for `get_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recognizer - ## - # RPC-specific configuration for `update_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :update_recognizer - ## - # RPC-specific configuration for `delete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_recognizer - ## - # RPC-specific configuration for `undelete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_recognizer - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `batch_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_recognize - ## - # RPC-specific configuration for `get_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_config - ## - # RPC-specific configuration for `update_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_config - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - ## - # RPC-specific configuration for `undelete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_custom_class - ## - # RPC-specific configuration for `create_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `list_phrase_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_sets - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `undelete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_phrase_set - - # @private - def initialize parent_rpcs = nil - create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer - @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config - list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers - @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config - get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer - @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config - update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer - @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config - delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer - @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config - undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer - @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize - @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config - get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config - @get_config = ::Gapic::Config::Method.new get_config_config - update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config - @update_config = ::Gapic::Config::Method.new update_config_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class - @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets - @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set - @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb deleted file mode 100644 index f2d7c9d11500..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb +++ /dev/null @@ -1,925 +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 Speech - module V2 - module Speech - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V2::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::Speech::V2::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::Speech::V2::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::Speech::V2::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 - - ## - # 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. - # * `: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 = "speech.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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - 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 - - ## - # @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: "/v2/{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: "/v2/{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: "/v2/{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: "/v2/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb deleted file mode 100644 index 643afd7c54c8..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb +++ /dev/null @@ -1,1435 +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/speech/v2/cloud_speech_pb" - -module Google - module Cloud - module Speech - module V2 - module Speech - module Rest - ## - # REST service stub for the Speech 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_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] - # 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_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_recognizer_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_recognizer", - 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 list_recognizers REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] - # 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::Speech::V2::ListRecognizersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::ListRecognizersResponse] - # A result object deserialized from the server's reply - def list_recognizers request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_recognizers_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_recognizers", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.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_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] - # 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::Speech::V2::Recognizer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Recognizer] - # A result object deserialized from the server's reply - def get_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_recognizer_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_recognizer", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::Recognizer.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_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_recognizer_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_recognizer", - 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_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] - # 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_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_recognizer_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_recognizer", - 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 undelete_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] - # 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 undelete_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_recognizer_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: "undelete_recognizer", - 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 recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] - # 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::Speech::V2::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::RecognizeResponse] - # A result object deserialized from the server's reply - def recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_recognize_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: "recognize", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::RecognizeResponse.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_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] - # 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_recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_recognize_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_recognize", - 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_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] - # 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::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # A result object deserialized from the server's reply - def get_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_config_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_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::Config.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_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] - # 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::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # A result object deserialized from the server's reply - def update_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_config_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_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::Config.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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] - # 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_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_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_custom_class", - 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 list_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] - # 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::Speech::V2::ListCustomClassesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::ListCustomClassesResponse] - # A result object deserialized from the server's reply - def list_custom_classes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_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_custom_classes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] - # 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::Speech::V2::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::CustomClass] - # A result object deserialized from the server's reply - def get_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_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_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::CustomClass.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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_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_custom_class", - 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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] - # 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_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_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_custom_class", - 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 undelete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] - # 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 undelete_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_custom_class_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: "undelete_custom_class", - 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 create_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] - # 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_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_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_phrase_set", - 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 list_phrase_sets REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] - # 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::Speech::V2::ListPhraseSetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::ListPhraseSetsResponse] - # A result object deserialized from the server's reply - def list_phrase_sets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_sets_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_phrase_sets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] - # 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::Speech::V2::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # A result object deserialized from the server's reply - def get_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_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_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::PhraseSet.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_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_phrase_set", - 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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] - # 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_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_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_phrase_set", - 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 undelete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] - # 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 undelete_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_phrase_set_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: "undelete_phrase_set", - 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 create_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] - # 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_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/recognizers", - body: "recognizer", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_recognizers REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] - # 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_recognizers_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/recognizers", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] - # 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_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] - # 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_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{recognizer.name}", - body: "recognizer", - matches: [ - ["recognizer.name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] - # 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_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{recognizer}:recognize", - body: "*", - matches: [ - ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] - # 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_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{recognizer}:batchRecognize", - body: "*", - matches: [ - ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] - # 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_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] - # 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_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{config.name}", - body: "config", - matches: [ - ["config.name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/customClasses", - body: "custom_class", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] - # 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_custom_classes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/customClasses", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{custom_class.name}", - body: "custom_class", - matches: [ - ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/phraseSets", - body: "phrase_set", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_phrase_sets REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] - # 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_phrase_sets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/phraseSets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{phrase_set.name}", - body: "phrase_set", - matches: [ - ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb deleted file mode 100644 index b3aeb607f80f..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.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! - - -module Google - module Cloud - module Speech - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md deleted file mode 100644 index 97cb89a70a74..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Speech-to-Text V2 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +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. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!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. - # - # 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 - 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. - # @!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 - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +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 - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb deleted file mode 100644 index 727666e1d47d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb +++ /dev/null @@ -1,2086 +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 Speech - module V2 - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#create_recognizer CreateRecognizer} method. - # @!attribute [rw] recognizer - # @return [::Google::Cloud::Speech::V2::Recognizer] - # Required. The Recognizer to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the Recognizer, but do not - # actually create it. - # @!attribute [rw] recognizer_id - # @return [::String] - # The ID to use for the Recognizer, which will become the final component of - # the Recognizer's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location where this Recognizer will be created. - # The expected format is `projects/{project}/locations/{location}`. - class CreateRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of a long-running operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was created. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was last updated. - # @!attribute [rw] resource - # @return [::String] - # The resource path for the target of the operation. - # @!attribute [rw] method - # @return [::String] - # The method that triggered the operation. - # @!attribute [rw] kms_key_name - # @return [::String] - # The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the content of the Operation is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which content of the Operation is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - # @!attribute [rw] batch_recognize_request - # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest] - # The BatchRecognizeRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_recognizer_request - # @return [::Google::Cloud::Speech::V2::CreateRecognizerRequest] - # The CreateRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `create_recognizer_request`, `batch_recognize_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_recognizer_request - # @return [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] - # The UpdateRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_recognizer_request - # @return [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] - # The DeleteRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `delete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] undelete_recognizer_request - # @return [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] - # The UndeleteRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `undelete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_custom_class_request - # @return [::Google::Cloud::Speech::V2::CreateCustomClassRequest] - # The CreateCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `create_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_custom_class_request - # @return [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] - # The UpdateCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_custom_class_request - # @return [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] - # The DeleteCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `delete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] undelete_custom_class_request - # @return [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] - # The UndeleteCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `undelete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_phrase_set_request - # @return [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] - # The CreatePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `create_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_phrase_set_request - # @return [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] - # The UpdatePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_phrase_set_request - # @return [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] - # The DeletePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `delete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] undelete_phrase_set_request - # @return [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] - # The UndeletePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `undelete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_config_request - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Speech::V2::UpdateConfigRequest] - # The UpdateConfigRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_config_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] progress_percent - # @return [::Integer] - # The percent progress of the Operation. Values can range from 0-100. If the - # value is 100, then the operation is finished. - # @!attribute [rw] batch_recognize_metadata - # @return [::Google::Cloud::Speech::V2::BatchRecognizeMetadata] - # Metadata specific to the BatchRecognize method. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location of Recognizers to list. The expected - # format is `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of Recognizers to return. The service may return fewer - # than this value. If unspecified, at most 5 Recognizers will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match - # the call that provided the page token. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether, or not, to show resources that have been deleted. - class ListRecognizersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. - # @!attribute [rw] recognizers - # @return [::Array<::Google::Cloud::Speech::V2::Recognizer>] - # The list of requested Recognizers. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::Speech::V2::ListRecognizersRequest#page_token page_token} to - # retrieve the next page. If this field is omitted, there are no subsequent - # pages. This token expires after 72 hours. - class ListRecognizersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_recognizer GetRecognizer} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Recognizer to retrieve. The expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. - class GetRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_recognizer UpdateRecognizer} method. - # @!attribute [rw] recognizer - # @return [::Google::Cloud::Speech::V2::Recognizer] - # Required. The Recognizer to update. - # - # The Recognizer's `name` field is used to identify the Recognizer to update. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire Recognizer resource. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the updated Recognizer, but do not - # actually update it. - class UpdateRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer DeleteRecognizer} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Recognizer to delete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the deleted Recognizer, but do not - # actually delete it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the Recognizer is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class DeleteRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer UndeleteRecognizer} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Recognizer to undelete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the undeleted Recognizer, but do - # not actually undelete it. - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class UndeleteRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Recognizer message. Stores recognition configuration and metadata. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the Recognizer. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the Recognizer. - # @!attribute [rw] display_name - # @return [::String] - # User-settable, human-readable name for the Recognizer. Must be 63 - # characters or less. - # @!attribute [rw] model - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. This field is now deprecated. Prefer the - # {::Google::Cloud::Speech::V2::RecognitionConfig#model `model`} field in the - # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. - # - # Which model to use for recognition requests. Select the model best suited - # to your domain to get best results. - # - # Guidance for choosing which model to use can be found in the [Transcription - # Models - # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) - # and the models supported in each region can be found in the [Table Of - # Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # @!attribute [rw] language_codes - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # Optional. This field is now deprecated. Prefer the - # {::Google::Cloud::Speech::V2::RecognitionConfig#language_codes `language_codes`} - # field in the - # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. - # - # The language of the supplied audio as a - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # - # Supported languages for each model are listed in the [Table of Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # - # If additional languages are provided, recognition result will contain - # recognition in the most likely language detected. The recognition result - # will include the language tag of the language detected in the audio. - # When you create or update a Recognizer, these values are - # stored in normalized BCP-47 form. For example, "en-us" is stored as - # "en-US". - # @!attribute [rw] default_recognition_config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Default configuration to use for requests with this Recognizer. - # This can be overwritten by inline configuration in the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config RecognizeRequest.config} - # field. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V2::Recognizer::State] - # Output only. The Recognizer lifecycle state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this Recognizer was modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this Recognizer was requested for deletion. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this Recognizer will be purged. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this Recognizer is in the process of being - # updated. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the Recognizer is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which the Recognizer is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - class Recognizer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of states that define the lifecycle of a Recognizer. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # The Recognizer is active and ready for use. - ACTIVE = 2 - - # This Recognizer has been deleted. - DELETED = 4 - end - end - - # Automatically detected decoding parameters. - # Supported for the following encodings: - # - # * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container. - # - # * WAV_MULAW: 8-bit companded mulaw samples in a WAV container. - # - # * WAV_ALAW: 8-bit companded alaw samples in a WAV container. - # - # * RFC4867_5_AMR: AMR frames with an rfc4867.5 header. - # - # * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header. - # - # * FLAC: FLAC frames in the "native FLAC" container format. - # - # * MP3: MPEG audio frames with optional (ignored) ID3 metadata. - # - # * OGG_OPUS: Opus audio frames in an Ogg container. - # - # * WEBM_OPUS: Opus audio frames in a WebM container. - # - # * MP4_AAC: AAC audio frames in an MP4 container. - # - # * M4A_AAC: AAC audio frames in an M4A container. - # - # * MOV_AAC: AAC audio frames in an MOV container. - class AutoDetectDecodingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Explicitly specified decoding parameters. - # @!attribute [rw] encoding - # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig::AudioEncoding] - # Required. Encoding of the audio data sent for recognition. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Optional. Sample rate in Hertz of the audio data sent for recognition. - # Valid values are: 8000-48000, and 16000 is optimal. For best results, set - # the sampling rate of the audio source to 16000 Hz. If that's not possible, - # use the native sample rate of the audio source (instead of resampling). - # Note that this field is marked as OPTIONAL for backward compatibility - # reasons. It is (and has always been) effectively REQUIRED. - # @!attribute [rw] audio_channel_count - # @return [::Integer] - # Optional. Number of channels present in the audio data sent for - # recognition. Note that this field is marked as OPTIONAL for backward - # compatibility reasons. It is (and has always been) effectively REQUIRED. - # - # The maximum allowed value is 8. - class ExplicitDecodingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Supported audio data encodings. - module AudioEncoding - # Default value. This value is unused. - AUDIO_ENCODING_UNSPECIFIED = 0 - - # Headerless 16-bit signed little-endian PCM samples. - LINEAR16 = 1 - - # Headerless 8-bit companded mulaw samples. - MULAW = 2 - - # Headerless 8-bit companded alaw samples. - ALAW = 3 - - # AMR frames with an rfc4867.5 header. - AMR = 4 - - # AMR-WB frames with an rfc4867.5 header. - AMR_WB = 5 - - # FLAC frames in the "native FLAC" container format. - FLAC = 6 - - # MPEG audio frames with optional (ignored) ID3 metadata. - MP3 = 7 - - # Opus audio frames in an Ogg container. - OGG_OPUS = 8 - - # Opus audio frames in a WebM container. - WEBM_OPUS = 9 - - # AAC audio frames in an MP4 container. - MP4_AAC = 10 - - # AAC audio frames in an M4A container. - M4A_AAC = 11 - - # AAC audio frames in an MOV container. - MOV_AAC = 12 - end - end - - # Configuration to enable speaker diarization. - # @!attribute [rw] min_speaker_count - # @return [::Integer] - # Optional. The system automatically determines the number of speakers. This - # value is not currently used. - # @!attribute [rw] max_speaker_count - # @return [::Integer] - # Optional. The system automatically determines the number of speakers. This - # value is not currently used. - class SpeakerDiarizationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration to enable custom prompt in chirp3. - # @!attribute [rw] custom_prompt - # @return [::String] - # Optional. The custom instructions to override the existing instructions for - # chirp3. - class CustomPromptConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Available recognition features. - # @!attribute [rw] profanity_filter - # @return [::Boolean] - # If set to `true`, the server will attempt to filter out profanities, - # replacing all but the initial character in each filtered word with - # asterisks, for instance, "f***". If set to `false` or omitted, profanities - # won't be filtered out. - # @!attribute [rw] enable_word_time_offsets - # @return [::Boolean] - # If `true`, the top result includes a list of words and the start and end - # time offsets (timestamps) for those words. If `false`, no word-level time - # offset information is returned. The default is `false`. - # @!attribute [rw] enable_word_confidence - # @return [::Boolean] - # If `true`, the top result includes a list of words and the confidence for - # those words. If `false`, no word-level confidence information is returned. - # The default is `false`. - # @!attribute [rw] enable_automatic_punctuation - # @return [::Boolean] - # If `true`, adds punctuation to recognition result hypotheses. This feature - # is only available in select languages. The default `false` value does not - # add punctuation to result hypotheses. - # @!attribute [rw] enable_spoken_punctuation - # @return [::Boolean] - # The spoken punctuation behavior for the call. If `true`, replaces spoken - # punctuation with the corresponding symbols in the request. For example, - # "how are you question mark" becomes "how are you?". See - # https://cloud.google.com/speech-to-text/docs/spoken-punctuation for - # support. If `false`, spoken punctuation is not replaced. - # @!attribute [rw] enable_spoken_emojis - # @return [::Boolean] - # The spoken emoji behavior for the call. If `true`, adds spoken emoji - # formatting for the request. This will replace spoken emojis with the - # corresponding Unicode symbols in the final transcript. If `false`, spoken - # emojis are not replaced. - # @!attribute [rw] multi_channel_mode - # @return [::Google::Cloud::Speech::V2::RecognitionFeatures::MultiChannelMode] - # Mode for recognizing multi-channel audio. - # @!attribute [rw] diarization_config - # @return [::Google::Cloud::Speech::V2::SpeakerDiarizationConfig] - # Configuration to enable speaker diarization. To enable diarization, set - # this field to an empty SpeakerDiarizationConfig message. - # @!attribute [rw] max_alternatives - # @return [::Integer] - # Maximum number of recognition hypotheses to be returned. - # The server may return fewer than `max_alternatives`. - # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - # one. If omitted, will return a maximum of one. - # @!attribute [rw] custom_prompt_config - # @return [::Google::Cloud::Speech::V2::CustomPromptConfig] - # Optional. Configuration to enable custom prompt for chirp3. - class RecognitionFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options for how to recognize multi-channel audio. - module MultiChannelMode - # Default value for the multi-channel mode. If the audio contains - # multiple channels, only the first channel will be transcribed; other - # channels will be ignored. - MULTI_CHANNEL_MODE_UNSPECIFIED = 0 - - # If selected, each channel in the provided audio is transcribed - # independently. This cannot be selected if the selected - # {::Google::Cloud::Speech::V2::Recognizer#model model} is `latest_short`. - SEPARATE_RECOGNITION_PER_CHANNEL = 1 - end - end - - # Transcription normalization configuration. Use transcription normalization - # to automatically replace parts of the transcript with phrases of your - # choosing. For StreamingRecognize, this normalization only applies to stable - # partial transcripts (stability > 0.8) and final transcripts. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::Speech::V2::TranscriptNormalization::Entry>] - # A list of replacement entries. We will perform replacement with one entry - # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" - # => "mountain dog"] will never be applied because we will always process the - # first entry before it. At most 100 entries. - class TranscriptNormalization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single replacement configuration. - # @!attribute [rw] search - # @return [::String] - # What to replace. Max length is 100 characters. - # @!attribute [rw] replace - # @return [::String] - # What to replace with. Max length is 100 characters. - # @!attribute [rw] case_sensitive - # @return [::Boolean] - # Whether the search is case sensitive. - class Entry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Translation configuration. Use to translate the given audio into text for the - # desired language. - # @!attribute [rw] target_language - # @return [::String] - # Required. The language code to translate to. - class TranslationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides "hints" to the speech recognizer to favor specific words and phrases - # in the results. PhraseSets can be specified as an inline resource, or a - # reference to an existing PhraseSet resource. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V2::SpeechAdaptation::AdaptationPhraseSet>] - # A list of inline or referenced PhraseSets. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] - # A list of inline CustomClasses. Existing CustomClass resources can be - # referenced directly in a PhraseSet. - class SpeechAdaptation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A biasing PhraseSet, which can be either a string referencing the name of - # an existing PhraseSets resource, or an inline definition of a PhraseSet. - # @!attribute [rw] phrase_set - # @return [::String] - # The name of an existing PhraseSet resource. The user must have read - # access to the resource and it must not be deleted. - # - # Note: The following fields are mutually exclusive: `phrase_set`, `inline_phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_phrase_set - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # An inline defined PhraseSet. - # - # Note: The following fields are mutually exclusive: `inline_phrase_set`, `phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AdaptationPhraseSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Denoiser config. May not be supported for all models and may - # have no effect. - # @!attribute [rw] denoise_audio - # @return [::Boolean] - # Denoise audio before sending to the transcription model. - # @!attribute [rw] snr_threshold - # @return [::Float] - # Signal-to-Noise Ratio (SNR) threshold for the denoiser. Here SNR means the - # loudness of the speech signal. Audio with an SNR below this threshold, - # meaning the speech is too quiet, will be prevented from being sent to the - # transcription model. - # - # If snr_threshold=0, no filtering will be applied. - class DenoiserConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides information to the Recognizer that specifies how to process the - # recognition request. - # @!attribute [rw] auto_decoding_config - # @return [::Google::Cloud::Speech::V2::AutoDetectDecodingConfig] - # Automatically detect decoding parameters. - # Preferred for supported formats. - # - # Note: The following fields are mutually exclusive: `auto_decoding_config`, `explicit_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] explicit_decoding_config - # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig] - # Explicitly specified decoding parameters. - # Required if using headerless PCM audio (linear16, mulaw, alaw). - # - # Note: The following fields are mutually exclusive: `explicit_decoding_config`, `auto_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] model - # @return [::String] - # Optional. Which model to use for recognition requests. Select the model - # best suited to your domain to get best results. - # - # Guidance for choosing which model to use can be found in the [Transcription - # Models - # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) - # and the models supported in each region can be found in the [Table Of - # Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # Optional. The language of the supplied audio as a - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # Language tags are normalized to BCP-47 before they are used eg "en-us" - # becomes "en-US". - # - # Supported languages for each model are listed in the [Table of Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # - # If additional languages are provided, recognition result will contain - # recognition in the most likely language detected. The recognition result - # will include the language tag of the language detected in the audio. - # @!attribute [rw] features - # @return [::Google::Cloud::Speech::V2::RecognitionFeatures] - # Speech recognition features to enable. - # @!attribute [rw] adaptation - # @return [::Google::Cloud::Speech::V2::SpeechAdaptation] - # Speech adaptation context that weights recognizer predictions for specific - # words and phrases. - # @!attribute [rw] transcript_normalization - # @return [::Google::Cloud::Speech::V2::TranscriptNormalization] - # Optional. Use transcription normalization to automatically replace parts of - # the transcript with phrases of your choosing. For StreamingRecognize, this - # normalization only applies to stable partial transcripts (stability > 0.8) - # and final transcripts. - # @!attribute [rw] translation_config - # @return [::Google::Cloud::Speech::V2::TranslationConfig] - # Optional. Optional configuration used to automatically run translation on - # the given audio to the desired language for supported models. - # @!attribute [rw] denoiser_config - # @return [::Google::Cloud::Speech::V2::DenoiserConfig] - # Optional. Optional denoiser config. May not be supported for all models - # and may have no effect. - class RecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. Either - # `content` or `uri` must be supplied. Supplying both or neither returns - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content - # limits](https://cloud.google.com/speech-to-text/quotas#content). - # @!attribute [rw] recognizer - # @return [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field - # can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the - # values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @!attribute [rw] content - # @return [::String] - # The audio data bytes encoded as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As - # with all bytes fields, proto buffers use a pure binary representation, - # whereas JSON representations use base64. - # - # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @return [::String] - # URI that points to a file that contains audio data bytes as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file - # must not be compressed (for example, gzip). Currently, only Google Cloud - # Storage URIs are supported, which must be specified in the following - # format: `gs://bucket_name/object_name` (other URI formats return - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more - # information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class RecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about the recognition request and response. - # @!attribute [rw] request_id - # @return [::String] - # Global request identifier auto-generated by the API. - # @!attribute [rw] total_billed_duration - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - # @!attribute [r] prompt - # @return [::String] - # Optional. Output only. Provides the prompt used for the recognition - # request. - class RecognitionResponseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Alternative hypotheses (a.k.a. n-best list). - # @!attribute [rw] transcript - # @return [::String] - # Transcript text representing the words that the user spoke. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is - # set to `true`. This field is not guaranteed to be accurate and users should - # not rely on it to be always provided. The default of 0.0 is a sentinel - # value indicating `confidence` was not set. - # @!attribute [rw] words - # @return [::Array<::Google::Cloud::Speech::V2::WordInfo>] - # A list of word-specific information for each recognized word. - # When the - # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} - # is set, you will see all the words from the beginning of the audio. - class SpeechRecognitionAlternative - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Word-specific information for recognized words. - # @!attribute [rw] start_offset - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the start of the spoken word. - # This field is only set if - # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} - # is `true` and only in the top hypothesis. This is an experimental feature - # and the accuracy of the time offset can vary. - # @!attribute [rw] end_offset - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the end of the spoken word. - # This field is only set if - # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} - # is `true` and only in the top hypothesis. This is an experimental feature - # and the accuracy of the time offset can vary. - # @!attribute [rw] word - # @return [::String] - # The word corresponding to this set of information. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is - # set to `true`. This field is not guaranteed to be accurate and users should - # not rely on it to be always provided. The default of 0.0 is a sentinel - # value indicating `confidence` was not set. - # @!attribute [rw] speaker_label - # @return [::String] - # A distinct label is assigned for every speaker within the audio. This field - # specifies which one of those speakers was detected to have spoken this - # word. `speaker_label` is set if - # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} - # is given and only in the top alternative. - class WordInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A speech recognition result corresponding to a portion of the audio. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses. These alternatives are - # ordered in terms of accuracy, with the top (first) alternative being the - # most probable, as ranked by the recognizer. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For `audio_channel_count` = `N`, its output values can range from `1` to - # `N`. - # @!attribute [rw] result_end_offset - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the beginning of the - # audio. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class SpeechRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to sequential - # portions of audio. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # Metadata about the recognition. - class RecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Available recognition features specific to streaming recognition requests. - # @!attribute [rw] enable_voice_activity_events - # @return [::Boolean] - # If `true`, responses with voice activity speech events will be returned as - # they are detected. - # @!attribute [rw] interim_results - # @return [::Boolean] - # Whether or not to stream interim results to the client. If set to true, - # interim results will be streamed to the client. Otherwise, only the final - # response will be streamed back. - # @!attribute [rw] voice_activity_timeout - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::VoiceActivityTimeout] - # If set, the server will automatically close the stream after the specified - # duration has elapsed after the last VOICE_ACTIVITY speech event has been - # sent. The field `voice_activity_events` must also be set to true. - # @!attribute [rw] endpointing_sensitivity - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::EndpointingSensitivity] - # Optional. Endpointing sensitivity for this stream. - class StreamingRecognitionFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Events that a timeout can be set on for voice activity. - # @!attribute [rw] speech_start_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream if no speech begins. If this is set and - # no speech is detected in this duration at the start of the stream, the - # server will close the stream. - # @!attribute [rw] speech_end_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream after speech ends. If this is set and no - # speech is detected in this duration after speech was detected, the server - # will close the stream. - class VoiceActivityTimeout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Endpointing sensitivity is intended for applications that want to minimize - # result latency, possibly at the expense of quality. Some utterances may be - # broken up into multiple fragments. - module EndpointingSensitivity - # If no value is specified, the values for - # ENDPOINTING_SENSITIVITY_STANDARD will be used. - ENDPOINTING_SENSITIVITY_UNSPECIFIED = 0 - - # Standard sensitivity, no optimization for latency. - ENDPOINTING_SENSITIVITY_STANDARD = 1 - - # Super short sensitivity, optimized for super short utterances like single - # words ("Yes", "No", "Hello", etc.) or a single phrase, command or short - # query (e.g. "check balance", "five dollars", "call Mom"). - ENDPOINTING_SENSITIVITY_SUPERSHORT = 2 - - # Short sensitivity, optimized for short utterances like single sentences. - # (e.g. "Remind me to call the dentist tomorrow morning at nine", - # "Navigate to the nearest coffee shop that is currently open") - ENDPOINTING_SENSITIVITY_SHORT = 3 - end - end - - # Provides configuration information for the StreamingRecognize request. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Required. Features and audio metadata to use for the Automatic Speech - # Recognition. This field in combination with the - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} that - # override the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} override - # the values in the Recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # Recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} - # completely overrides and replaces the config in the recognizer for this - # recognition request. - # @!attribute [rw] streaming_features - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures] - # Speech recognition features to enable specific to streaming audio - # recognition requests. - class StreamingRecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize StreamingRecognize} - # method. Multiple - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest StreamingRecognizeRequest} - # messages are sent in one call. - # - # If the {::Google::Cloud::Speech::V2::Recognizer Recognizer} referenced by - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} - # contains a fully specified request configuration then the stream may only - # contain messages with only - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. - # - # Otherwise the first message must contain a - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} and - # a - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#streaming_config streaming_config} - # message that together fully specify the request configuration and must not - # contain {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio}. All - # subsequent messages must only have - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. - # @!attribute [rw] recognizer - # @return [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionConfig] - # StreamingRecognitionConfig to be used in this recognition attempt. - # If provided, it will override the default RecognitionConfig stored in the - # Recognizer. - # - # Note: The following fields are mutually exclusive: `streaming_config`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] audio - # @return [::String] - # Inline audio bytes to be Recognized. - # Maximum size for this field is 15 KB per request. - # - # Note: The following fields are mutually exclusive: `audio`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class StreamingRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} - # method. - # @!attribute [rw] recognizer - # @return [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override - # the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all given fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata>] - # Audio files with file metadata for ASR. - # The maximum number of files allowed to be specified is 15. - # @!attribute [rw] recognition_output_config - # @return [::Google::Cloud::Speech::V2::RecognitionOutputConfig] - # Configuration options for where to output the transcripts of each file. - # @!attribute [rw] processing_strategy - # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] - # Processing strategy to use for this request. - class BatchRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible processing strategies for batch requests. - module ProcessingStrategy - # Default value for the processing strategy. The request is processed as - # soon as its received. - PROCESSING_STRATEGY_UNSPECIFIED = 0 - - # If selected, processes the request during lower utilization periods for a - # price discount. The request is fulfilled within 24 hours. - DYNAMIC_BATCHING = 1 - end - end - - # Output configurations for Cloud Storage. - # @!attribute [rw] uri - # @return [::String] - # The Cloud Storage URI prefix with which recognition results will be - # written. - class GcsOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations for inline response. - class InlineOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations for serialized `BatchRecognizeResults` protos. - class NativeOutputFileFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations for [WebVTT](https://www.w3.org/TR/webvtt1/) formatted - # subtitle file. - class VttOutputFileFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations [SubRip - # Text](https://www.matroska.org/technical/subtitles.html#srt-subtitles) - # formatted subtitle file. - class SrtOutputFileFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for the format of the results stored to `output`. - # @!attribute [rw] native - # @return [::Google::Cloud::Speech::V2::NativeOutputFileFormatConfig] - # Configuration for the native output format. If this field is set or if no - # other output format field is set, then transcripts will be written to the - # sink in the native format. - # @!attribute [rw] vtt - # @return [::Google::Cloud::Speech::V2::VttOutputFileFormatConfig] - # Configuration for the VTT output format. If this field is set, then - # transcripts will be written to the sink in the VTT format. - # @!attribute [rw] srt - # @return [::Google::Cloud::Speech::V2::SrtOutputFileFormatConfig] - # Configuration for the SRT output format. If this field is set, then - # transcripts will be written to the sink in the SRT format. - class OutputFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration options for the output(s) of recognition. - # @!attribute [rw] gcs_output_config - # @return [::Google::Cloud::Speech::V2::GcsOutputConfig] - # If this message is populated, recognition results are written to the - # provided Google Cloud Storage URI. - # - # Note: The following fields are mutually exclusive: `gcs_output_config`, `inline_response_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_response_config - # @return [::Google::Cloud::Speech::V2::InlineOutputConfig] - # If this message is populated, recognition results are provided in the - # {::Google::Cloud::Speech::V2::BatchRecognizeResponse BatchRecognizeResponse} - # message of the Operation when completed. This is only supported when - # calling {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} - # with just one audio file. - # - # Note: The following fields are mutually exclusive: `inline_response_config`, `gcs_output_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] output_format_config - # @return [::Google::Cloud::Speech::V2::OutputFormatConfig] - # Optional. Configuration for the format of the results stored to `output`. - # If unspecified transcripts will be written in the `NATIVE` format only. - class RecognitionOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} that is - # packaged into a longrunning {::Google::Longrunning::Operation Operation}. - # @!attribute [rw] results - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeFileResult}] - # Map from filename to the final result for that file. - # @!attribute [rw] total_billed_duration - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - class BatchRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::BatchRecognizeFileResult] - class ResultsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Output type for Cloud Storage of BatchRecognize transcripts. Though this - # proto isn't returned in this API anywhere, the Cloud Storage transcripts will - # be this proto serialized and should be parsed as such. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to sequential - # portions of audio. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # Metadata about the recognition. - class BatchRecognizeResults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Final results written to Cloud Storage. - # @!attribute [rw] uri - # @return [::String] - # The Cloud Storage URI to which recognition results were written. - # @!attribute [rw] vtt_format_uri - # @return [::String] - # The Cloud Storage URI to which recognition results were written as VTT - # formatted captions. This is populated only when `VTT` output is requested. - # @!attribute [rw] srt_format_uri - # @return [::String] - # The Cloud Storage URI to which recognition results were written as SRT - # formatted captions. This is populated only when `SRT` output is requested. - class CloudStorageResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Final results returned inline in the recognition response. - # @!attribute [rw] transcript - # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] - # The transcript for the audio file. - # @!attribute [rw] vtt_captions - # @return [::String] - # The transcript for the audio file as VTT formatted captions. This is - # populated only when `VTT` output is requested. - # @!attribute [rw] srt_captions - # @return [::String] - # The transcript for the audio file as SRT formatted captions. This is - # populated only when `SRT` output is requested. - class InlineResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Final results for a single file. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Error if one was encountered. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # @!attribute [rw] cloud_storage_result - # @return [::Google::Cloud::Speech::V2::CloudStorageResult] - # Recognition results written to Cloud Storage. This is - # populated only when - # {::Google::Cloud::Speech::V2::GcsOutputConfig GcsOutputConfig} is set in - # the - # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. - # - # Note: The following fields are mutually exclusive: `cloud_storage_result`, `inline_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_result - # @return [::Google::Cloud::Speech::V2::InlineResult] - # Recognition results. This is populated only when - # {::Google::Cloud::Speech::V2::InlineOutputConfig InlineOutputConfig} is set in - # the - # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. - # - # Note: The following fields are mutually exclusive: `inline_result`, `cloud_storage_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Deprecated. Use `cloud_storage_result.native_format_uri` instead. - # @!attribute [rw] transcript - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] - # Deprecated. Use `inline_result.transcript` instead. - class BatchRecognizeFileResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about transcription for a single file (for example, progress - # percent). - # @!attribute [rw] progress_percent - # @return [::Integer] - # How much of the file has been transcribed so far. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Error if one was encountered. - # @!attribute [rw] uri - # @return [::String] - # The Cloud Storage URI to which recognition results will be written. - class BatchRecognizeTranscriptionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Operation metadata for - # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}. - # @!attribute [rw] transcription_metadata - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata}] - # Map from provided filename to the transcription metadata for that file. - class BatchRecognizeMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata] - class TranscriptionMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata about a single file in a batch for BatchRecognize. - # @!attribute [rw] uri - # @return [::String] - # Cloud Storage URI for the audio file. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource as well as the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} at the - # request level. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} that - # override the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} override - # the values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} - # completely overrides and replaces the config in the recognizer for this - # recognition request. - class BatchRecognizeFileMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A streaming speech recognition result corresponding to a portion of the audio - # that is currently being processed. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses. These alternatives are - # ordered in terms of accuracy, with the top (first) alternative being the - # most probable, as ranked by the recognizer. - # @!attribute [rw] is_final - # @return [::Boolean] - # If `false`, this - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult} - # represents an interim result that may change. If `true`, this is the final - # time the speech service will return this particular - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult}, - # the recognizer will not return any further hypotheses for this portion of - # the transcript and corresponding audio. - # @!attribute [rw] stability - # @return [::Float] - # An estimate of the likelihood that the recognizer will not change its guess - # about this interim result. Values range from 0.0 (completely unstable) - # to 1.0 (completely stable). This field is only provided for interim results - # ({::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false`). - # The default of 0.0 is a sentinel value indicating `stability` was not set. - # @!attribute [rw] result_end_offset - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the beginning of the - # audio. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For - # `audio_channel_count` = `N`, its output values can range from `1` to `N`. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class StreamingRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StreamingRecognizeResponse` is the only message returned to the client by - # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` - # messages are streamed back to the client. If there is no recognizable - # audio then no messages are streamed back to the client. - # - # Here are some examples of `StreamingRecognizeResponse`s that might - # be returned while processing audio: - # - # 1. results { alternatives { transcript: "tube" } stability: 0.01 } - # - # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } - # - # 3. results { alternatives { transcript: "to be" } stability: 0.9 } - # results { alternatives { transcript: " or not to be" } stability: 0.01 } - # - # 4. results { alternatives { transcript: "to be or not to be" - # confidence: 0.92 } - # alternatives { transcript: "to bee or not to bee" } - # is_final: true } - # - # 5. results { alternatives { transcript: " that's" } stability: 0.01 } - # - # 6. results { alternatives { transcript: " that is" } stability: 0.9 } - # results { alternatives { transcript: " the question" } stability: 0.01 } - # - # 7. results { alternatives { transcript: " that is the question" - # confidence: 0.98 } - # alternatives { transcript: " that was the question" } - # is_final: true } - # - # Notes: - # - # - Only two of the above responses #4 and #7 contain final results; they are - # indicated by `is_final: true`. Concatenating these together generates the - # full transcript: "to be or not to be that is the question". - # - # - The others contain interim `results`. #3 and #6 contain two interim - # `results`: the first portion has a high stability and is less likely to - # change; the second portion has a low stability and is very likely to - # change. A UI designer might choose to show only high stability `results`. - # - # - The specific `stability` and `confidence` values shown above are only for - # illustrative purposes. Actual values may vary. - # - # - In each response, only one of these fields will be set: - # `error`, - # `speech_event_type`, or - # one or more (repeated) `results`. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V2::StreamingRecognitionResult>] - # This repeated list contains zero or more results that - # correspond to consecutive portions of the audio currently being processed. - # It contains zero or one - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`true` - # result (the newly settled portion), followed by zero or more - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false` - # results (the interim results). - # @!attribute [rw] speech_event_type - # @return [::Google::Cloud::Speech::V2::StreamingRecognizeResponse::SpeechEventType] - # Indicates the type of speech event. - # @!attribute [rw] speech_event_offset - # @return [::Google::Protobuf::Duration] - # Time offset between the beginning of the audio and event emission. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # Metadata about the recognition. - class StreamingRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of speech event. - module SpeechEventType - # No speech event specified. - SPEECH_EVENT_TYPE_UNSPECIFIED = 0 - - # This event indicates that the server has detected the end of the user's - # speech utterance and expects no additional speech. Therefore, the server - # will not process additional audio and will close the gRPC bidirectional - # stream. This event is only sent if there was a force cutoff due to - # silence being detected early. This event is only available through the - # `latest_short` {::Google::Cloud::Speech::V2::Recognizer#model model}. - END_OF_SINGLE_UTTERANCE = 1 - - # This event indicates that the server has detected the beginning of human - # voice activity in the stream. This event can be returned multiple times - # if speech starts and stops repeatedly throughout the stream. This event - # is only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_BEGIN = 2 - - # This event indicates that the server has detected the end of human voice - # activity in the stream. This event can be returned multiple times if - # speech starts and stops repeatedly throughout the stream. This event is - # only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_END = 3 - end - end - - # Message representing the config for the Speech-to-Text API. This includes an - # optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys) - # with which incoming data will be encrypted. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The name of the config resource. There is exactly - # one config resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - # @!attribute [rw] kms_key_name - # @return [::String] - # Optional. An optional [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if - # present, will be used to encrypt Speech-to-Text resources at-rest. Updating - # this key will not encrypt existing resources using this key; only new - # resources will be encrypted using this key. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this resource was modified. - class Config - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_config GetConfig} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the config to retrieve. There is exactly one config - # resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - class GetConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_config UpdateConfig} method. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::Config] - # Required. The config to update. - # - # The config's `name` field is used to identify the config to be updated. - # The expected format is `projects/{project}/locations/{location}/config`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CustomClass for biasing in speech recognition. Used to define a set of words - # or phrases that represents a common concept or theme likely to appear in your - # audio, for example a list of passenger ship names. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the CustomClass. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the CustomClass. - # @!attribute [rw] display_name - # @return [::String] - # Optional. User-settable, human-readable name for the CustomClass. Must be - # 63 characters or less. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::Speech::V2::CustomClass::ClassItem>] - # A collection of class items. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V2::CustomClass::State] - # Output only. The CustomClass lifecycle state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this resource was modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource was requested for deletion. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource will be purged. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this CustomClass is in the process of being - # updated. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the CustomClass is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which the CustomClass is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - class CustomClass - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An item of the class. - # @!attribute [rw] value - # @return [::String] - # The class item's value. - class ClassItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of states that define the lifecycle of a CustomClass. - module State - # Unspecified state. This is only used/useful for distinguishing - # unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 2 - - # This CustomClass has been deleted. - DELETED = 4 - end - end - - # PhraseSet for biasing in speech recognition. A PhraseSet is used to provide - # "hints" to the speech recognizer to favor specific words and phrases in the - # results. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the PhraseSet. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the PhraseSet. - # @!attribute [rw] phrases - # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet::Phrase>] - # A list of word and phrases. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Positive value will increase the probability that a specific - # phrase will be recognized over other similar sounding phrases. The higher - # the boost, the higher the chance of false positive recognition as well. - # Valid `boost` values are between 0 (exclusive) and 20. We recommend using a - # binary search approach to finding the optimal value for your use case as - # well as adding phrases both with and without boost to your requests. - # @!attribute [rw] display_name - # @return [::String] - # User-settable, human-readable name for the PhraseSet. Must be 63 - # characters or less. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V2::PhraseSet::State] - # Output only. The PhraseSet lifecycle state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this resource was modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource was requested for deletion. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource will be purged. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this PhraseSet is in the process of being - # updated. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the PhraseSet is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which the PhraseSet is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - class PhraseSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A Phrase contains words and phrase "hints" so that the speech recognition - # is more likely to recognize them. This can be used to improve the accuracy - # for specific words and phrases, for example, if specific commands are - # typically spoken by the user. This can also be used to add additional words - # to the vocabulary of the recognizer. - # - # List items can also include CustomClass references containing groups of - # words that represent common concepts that occur in natural language. - # @!attribute [rw] value - # @return [::String] - # The phrase itself. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Overrides the boost set at the phrase set level. - # Positive value will increase the probability that a specific phrase will - # be recognized over other similar sounding phrases. The higher the boost, - # the higher the chance of false positive recognition as well. Negative - # boost values would correspond to anti-biasing. Anti-biasing is not - # enabled, so negative boost values will return an error. Boost values must - # be between 0 and 20. Any values outside that range will return an error. - # We recommend using a binary search approach to finding the optimal value - # for your use case as well as adding phrases both with and without boost - # to your requests. - class Phrase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of states that define the lifecycle of a PhraseSet. - module State - # Unspecified state. This is only used/useful for distinguishing - # unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 2 - - # This PhraseSet has been deleted. - DELETED = 4 - end - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#create_custom_class CreateCustomClass} method. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V2::CustomClass] - # Required. The CustomClass to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the CustomClass, but do not - # actually create it. - # @!attribute [rw] custom_class_id - # @return [::String] - # The ID to use for the CustomClass, which will become the final component of - # the CustomClass's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location where this CustomClass will be created. - # The expected format is `projects/{project}/locations/{location}`. - class CreateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location of CustomClass resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of results per requests. A valid page_size ranges from 0 to 100 - # inclusive. If the page_size is zero or unspecified, a page size of 5 will - # be chosen. If the page size exceeds 100, it will be coerced down to 100. - # Note that a call might return fewer results than the requested page size. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must - # match the call that provided the page token. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether, or not, to show resources that have been deleted. - class ListCustomClassesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] - # The list of requested CustomClasses. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::Speech::V2::ListCustomClassesRequest#page_token page_token} to - # retrieve the next page. If this field is omitted, there are no subsequent - # pages. This token expires after 72 hours. - class ListCustomClassesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_custom_class GetCustomClass} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CustomClass to retrieve. The expected format is - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - class GetCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_custom_class UpdateCustomClass} method. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V2::CustomClass] - # Required. The CustomClass to update. - # - # The CustomClass's `name` field is used to identify the CustomClass to - # update. Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. If empty, all fields are considered for - # update. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the updated CustomClass, but do - # not actually update it. - class UpdateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class DeleteCustomClass} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CustomClass to delete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the deleted CustomClass, but do - # not actually delete it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the CustomClass is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class DeleteCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class UndeleteCustomClass} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CustomClass to undelete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the undeleted CustomClass, but do - # not actually undelete it. - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class UndeleteCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set CreatePhraseSet} method. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # Required. The PhraseSet to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the PhraseSet, but do not - # actually create it. - # @!attribute [rw] phrase_set_id - # @return [::String] - # The ID to use for the PhraseSet, which will become the final component of - # the PhraseSet's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location where this PhraseSet will be created. - # The expected format is `projects/{project}/locations/{location}`. - class CreatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location of PhraseSet resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of PhraseSets to return. The service may return fewer - # than this value. If unspecified, at most 5 PhraseSets will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match - # the call that provided the page token. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether, or not, to show resources that have been deleted. - class ListPhraseSetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet>] - # The list of requested PhraseSets. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest#page_token page_token} to - # retrieve the next page. If this field is omitted, there are no subsequent - # pages. This token expires after 72 hours. - class ListPhraseSetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set GetPhraseSet} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the PhraseSet to retrieve. The expected format is - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - class GetPhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set UpdatePhraseSet} method. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # Required. The PhraseSet to update. - # - # The PhraseSet's `name` field is used to identify the PhraseSet to update. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire PhraseSet resource. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the updated PhraseSet, but do not - # actually update it. - class UpdatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set DeletePhraseSet} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the PhraseSet to delete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the deleted PhraseSet, but do not - # actually delete it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the PhraseSet is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class DeletePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set UndeletePhraseSet} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the PhraseSet to undelete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the undeleted PhraseSet, but do - # not actually undelete it. - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class UndeletePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb deleted file mode 100644 index 84cc8a10dfcd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb +++ /dev/null @@ -1,120 +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 Speech - module V2 - # Represents a singular feature of a model. If the feature is `recognizer`, - # the release_state of the feature represents the release_state of the model - # @!attribute [rw] feature - # @return [::String] - # The name of the feature (Note: the feature can be `recognizer`) - # @!attribute [rw] release_state - # @return [::String] - # The release state of the feature - class ModelFeature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the collection of features belonging to a model - # @!attribute [rw] model_feature - # @return [::Array<::Google::Cloud::Speech::V2::ModelFeature>] - # Repeated field that contains all features of the model - class ModelFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metadata about the models in a given region for a specific locale. - # Currently this is just the features of the model - # @!attribute [rw] model_features - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelFeatures}] - # Map of the model name -> features of that model - class ModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::ModelFeatures] - class ModelFeaturesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The metadata about locales available in a given region. Currently this is - # just the models that are available for each locale - # @!attribute [rw] models - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelMetadata}] - # Map of locale (language code) -> models - class LanguageMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::ModelMetadata] - class ModelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The access metadata for a particular region. This can be applied if the org - # policy for the given project disallows a particular region. - # @!attribute [rw] constraint_type - # @return [::Google::Cloud::Speech::V2::AccessMetadata::ConstraintType] - # Describes the different types of constraints that are applied. - class AccessMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the different types of constraints that can be applied on a - # region. - module ConstraintType - # Unspecified constraint applied. - CONSTRAINT_TYPE_UNSPECIFIED = 0 - - # The project's org policy disallows the given region. - RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1 - end - end - - # Main metadata for the Locations API for STT V2. Currently this is just the - # metadata about locales, models, and features - # @!attribute [rw] languages - # @return [::Google::Cloud::Speech::V2::LanguageMetadata] - # Information about available locales, models, and features represented in - # the hierarchical structure of locales -> models -> features - # @!attribute [rw] access_metadata - # @return [::Google::Cloud::Speech::V2::AccessMetadata] - # Information about access metadata for the region and given project. - class LocationsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +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 from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile deleted file mode 100644 index 9099ccea67fd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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-speech-v2", path: "../" -else - gem "google-cloud-speech-v2" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json b/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json deleted file mode 100644 index 5c30e3c81908..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json +++ /dev/null @@ -1,935 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-speech-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.speech.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "speech_v2_generated_Speech_CreateRecognizer_sync", - "title": "Snippet for the create_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_recognizer.", - "file": "speech/create_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::CreateRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "CreateRecognizer", - "full_name": "google.cloud.speech.v2.Speech.CreateRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_ListRecognizers_sync", - "title": "Snippet for the list_recognizers call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_recognizers.", - "file": "speech/list_recognizers.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_recognizers", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_recognizers", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::ListRecognizersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::ListRecognizersResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "ListRecognizers", - "full_name": "google.cloud.speech.v2.Speech.ListRecognizers", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetRecognizer_sync", - "title": "Snippet for the get_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_recognizer.", - "file": "speech/get_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::Recognizer", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetRecognizer", - "full_name": "google.cloud.speech.v2.Speech.GetRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdateRecognizer_sync", - "title": "Snippet for the update_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_recognizer.", - "file": "speech/update_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdateRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdateRecognizer", - "full_name": "google.cloud.speech.v2.Speech.UpdateRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_DeleteRecognizer_sync", - "title": "Snippet for the delete_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_recognizer.", - "file": "speech/delete_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::DeleteRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "DeleteRecognizer", - "full_name": "google.cloud.speech.v2.Speech.DeleteRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UndeleteRecognizer_sync", - "title": "Snippet for the undelete_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer.", - "file": "speech/undelete_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UndeleteRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UndeleteRecognizer", - "full_name": "google.cloud.speech.v2.Speech.UndeleteRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_Recognize_sync", - "title": "Snippet for the recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#recognize.", - "file": "speech/recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "recognize", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::RecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::RecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "Recognize", - "full_name": "google.cloud.speech.v2.Speech.Recognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_StreamingRecognize_sync", - "title": "Snippet for the streaming_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#streaming_recognize.", - "file": "speech/streaming_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_recognize", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::StreamingRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::StreamingRecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "StreamingRecognize", - "full_name": "google.cloud.speech.v2.Speech.StreamingRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_BatchRecognize_sync", - "title": "Snippet for the batch_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#batch_recognize.", - "file": "speech/batch_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_recognize", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#batch_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::BatchRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "BatchRecognize", - "full_name": "google.cloud.speech.v2.Speech.BatchRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetConfig_sync", - "title": "Snippet for the get_config call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_config.", - "file": "speech/get_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_config", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::Config", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetConfig", - "full_name": "google.cloud.speech.v2.Speech.GetConfig", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdateConfig_sync", - "title": "Snippet for the update_config call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_config.", - "file": "speech/update_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_config", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdateConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::Config", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdateConfig", - "full_name": "google.cloud.speech.v2.Speech.UpdateConfig", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_CreateCustomClass_sync", - "title": "Snippet for the create_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_custom_class.", - "file": "speech/create_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::CreateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "CreateCustomClass", - "full_name": "google.cloud.speech.v2.Speech.CreateCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_ListCustomClasses_sync", - "title": "Snippet for the list_custom_classes call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_custom_classes.", - "file": "speech/list_custom_classes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_custom_classes", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::ListCustomClassesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::ListCustomClassesResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "ListCustomClasses", - "full_name": "google.cloud.speech.v2.Speech.ListCustomClasses", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetCustomClass_sync", - "title": "Snippet for the get_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_custom_class.", - "file": "speech/get_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::CustomClass", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetCustomClass", - "full_name": "google.cloud.speech.v2.Speech.GetCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdateCustomClass_sync", - "title": "Snippet for the update_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_custom_class.", - "file": "speech/update_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdateCustomClass", - "full_name": "google.cloud.speech.v2.Speech.UpdateCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_DeleteCustomClass_sync", - "title": "Snippet for the delete_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_custom_class.", - "file": "speech/delete_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::DeleteCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "DeleteCustomClass", - "full_name": "google.cloud.speech.v2.Speech.DeleteCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UndeleteCustomClass_sync", - "title": "Snippet for the undelete_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class.", - "file": "speech/undelete_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UndeleteCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UndeleteCustomClass", - "full_name": "google.cloud.speech.v2.Speech.UndeleteCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_CreatePhraseSet_sync", - "title": "Snippet for the create_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_phrase_set.", - "file": "speech/create_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::CreatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "CreatePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.CreatePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_ListPhraseSets_sync", - "title": "Snippet for the list_phrase_sets call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets.", - "file": "speech/list_phrase_sets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_phrase_sets", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::ListPhraseSetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::ListPhraseSetsResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "ListPhraseSets", - "full_name": "google.cloud.speech.v2.Speech.ListPhraseSets", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetPhraseSet_sync", - "title": "Snippet for the get_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_phrase_set.", - "file": "speech/get_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetPhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::PhraseSet", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetPhraseSet", - "full_name": "google.cloud.speech.v2.Speech.GetPhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdatePhraseSet_sync", - "title": "Snippet for the update_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_phrase_set.", - "file": "speech/update_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdatePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.UpdatePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_DeletePhraseSet_sync", - "title": "Snippet for the delete_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set.", - "file": "speech/delete_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::DeletePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "DeletePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.DeletePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UndeletePhraseSet_sync", - "title": "Snippet for the undelete_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set.", - "file": "speech/undelete_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UndeletePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UndeletePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.UndeletePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb deleted file mode 100644 index 4f957e4b6175..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.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 speech_v2_generated_Speech_BatchRecognize_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the batch_recognize call in the Speech 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::Speech::V2::Speech::Client#batch_recognize. -# -def batch_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new - - # Call the batch_recognize method. - result = client.batch_recognize 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 speech_v2_generated_Speech_BatchRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb deleted file mode 100644 index b68ec04f2ee7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.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 speech_v2_generated_Speech_CreateCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the create_custom_class call in the Speech 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::Speech::V2::Speech::Client#create_custom_class. -# -def create_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new - - # Call the create_custom_class method. - result = client.create_custom_class 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 speech_v2_generated_Speech_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb deleted file mode 100644 index eba29d95b333..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.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 speech_v2_generated_Speech_CreatePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the create_phrase_set call in the Speech 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::Speech::V2::Speech::Client#create_phrase_set. -# -def create_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new - - # Call the create_phrase_set method. - result = client.create_phrase_set 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 speech_v2_generated_Speech_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb deleted file mode 100644 index 75242ecadf32..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.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 speech_v2_generated_Speech_CreateRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the create_recognizer call in the Speech 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::Speech::V2::Speech::Client#create_recognizer. -# -def create_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new - - # Call the create_recognizer method. - result = client.create_recognizer 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 speech_v2_generated_Speech_CreateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb deleted file mode 100644 index e8ddd07289dd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.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 speech_v2_generated_Speech_DeleteCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the delete_custom_class call in the Speech 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::Speech::V2::Speech::Client#delete_custom_class. -# -def delete_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new - - # Call the delete_custom_class method. - result = client.delete_custom_class 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 speech_v2_generated_Speech_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb deleted file mode 100644 index ed0f5b5e30c4..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.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 speech_v2_generated_Speech_DeletePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the delete_phrase_set call in the Speech 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::Speech::V2::Speech::Client#delete_phrase_set. -# -def delete_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new - - # Call the delete_phrase_set method. - result = client.delete_phrase_set 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 speech_v2_generated_Speech_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb deleted file mode 100644 index 0884f27f9d8e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.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 speech_v2_generated_Speech_DeleteRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the delete_recognizer call in the Speech 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::Speech::V2::Speech::Client#delete_recognizer. -# -def delete_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new - - # Call the delete_recognizer method. - result = client.delete_recognizer 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 speech_v2_generated_Speech_DeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb deleted file mode 100644 index 3fc3f9e7fcd5..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.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 speech_v2_generated_Speech_GetConfig_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_config call in the Speech 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::Speech::V2::Speech::Client#get_config. -# -def get_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetConfigRequest.new - - # Call the get_config method. - result = client.get_config request - - # The returned object is of type Google::Cloud::Speech::V2::Config. - p result -end -# [END speech_v2_generated_Speech_GetConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb deleted file mode 100644 index 784ffc18c23d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.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 speech_v2_generated_Speech_GetCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_custom_class call in the Speech 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::Speech::V2::Speech::Client#get_custom_class. -# -def get_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetCustomClassRequest.new - - # Call the get_custom_class method. - result = client.get_custom_class request - - # The returned object is of type Google::Cloud::Speech::V2::CustomClass. - p result -end -# [END speech_v2_generated_Speech_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb deleted file mode 100644 index 9708b47cf3e3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.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 speech_v2_generated_Speech_GetPhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_phrase_set call in the Speech 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::Speech::V2::Speech::Client#get_phrase_set. -# -def get_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new - - # Call the get_phrase_set method. - result = client.get_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. - p result -end -# [END speech_v2_generated_Speech_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb deleted file mode 100644 index 3aaa1b269594..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.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 speech_v2_generated_Speech_GetRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_recognizer call in the Speech 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::Speech::V2::Speech::Client#get_recognizer. -# -def get_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetRecognizerRequest.new - - # Call the get_recognizer method. - result = client.get_recognizer request - - # The returned object is of type Google::Cloud::Speech::V2::Recognizer. - p result -end -# [END speech_v2_generated_Speech_GetRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb deleted file mode 100644 index a9e5534d5b7b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.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 speech_v2_generated_Speech_ListCustomClasses_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the list_custom_classes call in the Speech 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::Speech::V2::Speech::Client#list_custom_classes. -# -def list_custom_classes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new - - # Call the list_custom_classes method. - result = client.list_custom_classes 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::Speech::V2::CustomClass. - p item - end -end -# [END speech_v2_generated_Speech_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb deleted file mode 100644 index 438c90e974fe..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.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 speech_v2_generated_Speech_ListPhraseSets_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the list_phrase_sets call in the Speech 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::Speech::V2::Speech::Client#list_phrase_sets. -# -def list_phrase_sets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new - - # Call the list_phrase_sets method. - result = client.list_phrase_sets 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::Speech::V2::PhraseSet. - p item - end -end -# [END speech_v2_generated_Speech_ListPhraseSets_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb deleted file mode 100644 index 5ca1e1af20ed..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.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 speech_v2_generated_Speech_ListRecognizers_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the list_recognizers call in the Speech 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::Speech::V2::Speech::Client#list_recognizers. -# -def list_recognizers - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::ListRecognizersRequest.new - - # Call the list_recognizers method. - result = client.list_recognizers 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::Speech::V2::Recognizer. - p item - end -end -# [END speech_v2_generated_Speech_ListRecognizers_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb deleted file mode 100644 index 194e4add7771..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.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 speech_v2_generated_Speech_Recognize_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the recognize call in the Speech 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::Speech::V2::Speech::Client#recognize. -# -def recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::RecognizeRequest.new - - # Call the recognize method. - result = client.recognize request - - # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. - p result -end -# [END speech_v2_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb deleted file mode 100644 index a09a15c0f87a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.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! - -# [START speech_v2_generated_Speech_StreamingRecognize_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the streaming_recognize call in the Speech 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::Speech::V2::Speech::Client#streaming_recognize. -# -def streaming_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_recognize method to start streaming. - output = client.streaming_recognize input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse - output.each do |current_response| - p current_response - end -end -# [END speech_v2_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb deleted file mode 100644 index c674fe781687..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.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 speech_v2_generated_Speech_UndeleteCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the undelete_custom_class call in the Speech 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::Speech::V2::Speech::Client#undelete_custom_class. -# -def undelete_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new - - # Call the undelete_custom_class method. - result = client.undelete_custom_class 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 speech_v2_generated_Speech_UndeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb deleted file mode 100644 index 13f47439e6f1..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.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 speech_v2_generated_Speech_UndeletePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the undelete_phrase_set call in the Speech 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::Speech::V2::Speech::Client#undelete_phrase_set. -# -def undelete_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new - - # Call the undelete_phrase_set method. - result = client.undelete_phrase_set 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 speech_v2_generated_Speech_UndeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb deleted file mode 100644 index 9e9efaa6f2f3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.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 speech_v2_generated_Speech_UndeleteRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the undelete_recognizer call in the Speech 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::Speech::V2::Speech::Client#undelete_recognizer. -# -def undelete_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new - - # Call the undelete_recognizer method. - result = client.undelete_recognizer 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 speech_v2_generated_Speech_UndeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb deleted file mode 100644 index f0e6f043b9b2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.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 speech_v2_generated_Speech_UpdateConfig_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_config call in the Speech 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::Speech::V2::Speech::Client#update_config. -# -def update_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdateConfigRequest.new - - # Call the update_config method. - result = client.update_config request - - # The returned object is of type Google::Cloud::Speech::V2::Config. - p result -end -# [END speech_v2_generated_Speech_UpdateConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb deleted file mode 100644 index 41f39d156939..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.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 speech_v2_generated_Speech_UpdateCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_custom_class call in the Speech 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::Speech::V2::Speech::Client#update_custom_class. -# -def update_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new - - # Call the update_custom_class method. - result = client.update_custom_class 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 speech_v2_generated_Speech_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb deleted file mode 100644 index c35958f5d92a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.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 speech_v2_generated_Speech_UpdatePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_phrase_set call in the Speech 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::Speech::V2::Speech::Client#update_phrase_set. -# -def update_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new - - # Call the update_phrase_set method. - result = client.update_phrase_set 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 speech_v2_generated_Speech_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb deleted file mode 100644 index 6eba5f9d7d62..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.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 speech_v2_generated_Speech_UpdateRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_recognizer call in the Speech 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::Speech::V2::Speech::Client#update_recognizer. -# -def update_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new - - # Call the update_recognizer method. - result = client.update_recognizer 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 speech_v2_generated_Speech_UpdateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb deleted file mode 100644 index f6538455ac47..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_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/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/cloud_speech_services_pb" -require "google/cloud/speech/v2/speech" - -class ::Google::Cloud::Speech::V2::Speech::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 - client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, 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 - client.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 - client.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 - client.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 - client.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 - client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb deleted file mode 100644 index d704a59e482c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb +++ /dev/null @@ -1,127 +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/speech/v2/speech" - -class ::Google::Cloud::Speech::V2::Speech::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_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/config", path - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_crypto_key_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_custom_class_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" - assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V2::Speech::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_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - end - end - - def test_recognizer_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.recognizer_path project: "value0", location: "value1", recognizer: "value2" - assert_equal "projects/value0/locations/value1/recognizers/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb deleted file mode 100644 index 30ed3613ce74..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb +++ /dev/null @@ -1,1335 +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/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/speech/rest" - - -class ::Google::Cloud::Speech::V2::Speech::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_recognizer - # 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. - recognizer = {} - validate_only = true - recognizer_id = "hello world" - parent = "hello world" - - create_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_recognizer_client_stub.call_count - end - end - end - - def test_list_recognizers - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_recognizers_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_recognizers_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_recognizers_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_recognizers_client_stub.call_count - end - end - end - - def test_get_recognizer - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::Recognizer.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_recognizer({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_recognizer name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_recognizer({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_recognizer_client_stub.call_count - end - end - end - - def test_update_recognizer - # 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. - recognizer = {} - update_mask = {} - validate_only = true - - update_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_recognizer_client_stub.call_count - end - end - end - - def test_delete_recognizer - # 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" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_recognizer_client_stub.call_count - end - end - end - - def test_undelete_recognizer - # 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" - validate_only = true - etag = "hello world" - - undelete_recognizer_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_recognizer_client_stub.call_count - end - end - end - - def test_recognize - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::RecognizeResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - recognizer = "hello world" - config = {} - config_mask = {} - content = "hello world" - - recognize_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_count - end - end - end - - def test_batch_recognize - # 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. - recognizer = "hello world" - config = {} - config_mask = {} - files = [{}] - recognition_output_config = {} - processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED - - batch_recognize_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_batch_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_recognize_client_stub.call_count - end - end - end - - def test_get_config - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::Config.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_config_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_config(::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_config_client_stub.call_count - end - end - end - - def test_update_config - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::Config.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - config = {} - update_mask = {} - - update_config_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_config({ config: config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_config config: config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_config({ config: config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_config_client_stub.call_count - end - end - end - - def test_create_custom_class - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_class = {} - validate_only = true - custom_class_id = "hello world" - parent = "hello world" - - create_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_count - end - end - end - - def test_list_custom_classes - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_custom_classes_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_custom_classes_client_stub.call_count - end - end - end - - def test_get_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_custom_class({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_custom_class name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_custom_class({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_custom_class_client_stub.call_count - end - end - end - - def test_update_custom_class - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - validate_only = true - - update_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_custom_class_client_stub.call_count - end - end - end - - def test_delete_custom_class - # 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" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_custom_class_client_stub.call_count - end - end - end - - def test_undelete_custom_class - # 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" - validate_only = true - etag = "hello world" - - undelete_custom_class_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_custom_class_client_stub.call_count - end - end - end - - def test_create_phrase_set - # 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. - phrase_set = {} - validate_only = true - phrase_set_id = "hello world" - parent = "hello world" - - create_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_count - end - end - end - - def test_list_phrase_sets - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_phrase_sets_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_phrase_sets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_phrase_sets_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_phrase_sets_client_stub.call_count - end - end - end - - def test_get_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_phrase_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_phrase_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_phrase_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_phrase_set_client_stub.call_count - end - end - end - - def test_update_phrase_set - # 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. - phrase_set = {} - update_mask = {} - validate_only = true - - update_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_phrase_set_client_stub.call_count - end - end - end - - def test_delete_phrase_set - # 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" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_phrase_set_client_stub.call_count - end - end - end - - def test_undelete_phrase_set - # 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" - validate_only = true - etag = "hello world" - - undelete_phrase_set_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_phrase_set_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::Speech::V2::Speech::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::Speech::V2::Speech::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb deleted file mode 100644 index 9e7fc7fc7014..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb +++ /dev/null @@ -1,1662 +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/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/speech" - -class ::Google::Cloud::Speech::V2::Speech::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_recognizer - # 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. - recognizer = {} - validate_only = true - recognizer_id = "hello world" - parent = "hello world" - - create_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::CreateRecognizerRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["recognizer_id"] - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_recognizer_client_stub.call_rpc_count - end - end - - def test_list_recognizers - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_recognizers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_recognizers, name - assert_kind_of ::Google::Cloud::Speech::V2::ListRecognizersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_recognizers_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), 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_recognizers_client_stub.call_rpc_count - end - end - - def test_get_recognizer - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::Recognizer.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_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::GetRecognizerRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_recognizer({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_recognizer name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_recognizer({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.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_recognizer_client_stub.call_rpc_count - end - end - - def test_update_recognizer - # 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. - recognizer = {} - update_mask = {} - validate_only = true - - update_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_recognizer_client_stub.call_rpc_count - end - end - - def test_delete_recognizer - # 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" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), 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_recognizer_client_stub.call_rpc_count - end - end - - def test_undelete_recognizer - # 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" - validate_only = true - etag = "hello world" - - undelete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), 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, undelete_recognizer_client_stub.call_rpc_count - end - end - - def test_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::RecognizeResponse.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. - recognizer = "hello world" - config = {} - config_mask = {} - content = "hello world" - - recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :recognize, name - assert_kind_of ::Google::Cloud::Speech::V2::RecognizeRequest, request - assert_equal "hello world", request["recognizer"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] - assert_equal "hello world", request["content"] - assert_equal :content, request.audio_source - refute_nil options - end - - Gapic::ServiceStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_rpc_count - end - end - - def test_streaming_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::StreamingRecognizeResponse.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 bidi streaming method. - recognizer = "hello world" - streaming_config = {} - - streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_recognize, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, streaming_recognize_client_stub.call_rpc_count - streaming_recognize_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeRequest, r - assert_equal "hello world", r["recognizer"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::StreamingRecognitionConfig), r["streaming_config"] - assert_equal :streaming_config, r.streaming_request - end - end - end - end - - def test_batch_recognize - # 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. - recognizer = "hello world" - config = {} - config_mask = {} - files = [{}] - recognition_output_config = {} - processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED - - batch_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_recognize, name - assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeRequest, request - assert_equal "hello world", request["recognizer"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] - assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, request["files"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionOutputConfig), request["recognition_output_config"] - assert_equal :PROCESSING_STRATEGY_UNSPECIFIED, request["processing_strategy"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), 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_recognize_client_stub.call_rpc_count - end - end - - def test_get_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::Config.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_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_config, name - assert_kind_of ::Google::Cloud::Speech::V2::GetConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_config(::Google::Cloud::Speech::V2::GetConfigRequest.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_config_client_stub.call_rpc_count - end - end - - def test_update_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::Config.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. - config = {} - update_mask = {} - - update_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_config, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdateConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Config), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_config({ config: config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_config config: config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_config({ config: config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, 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_config_client_stub.call_rpc_count - end - end - - def test_create_custom_class - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - custom_class = {} - validate_only = true - custom_class_id = "hello world" - parent = "hello world" - - create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::CreateCustomClassRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["custom_class_id"] - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_rpc_count - end - end - - def test_list_custom_classes - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_custom_classes, name - assert_kind_of ::Google::Cloud::Speech::V2::ListCustomClassesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), 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_custom_classes_client_stub.call_rpc_count - end - end - - def test_get_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::CustomClass.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_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::GetCustomClassRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_custom_class({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_custom_class name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_custom_class({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.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_custom_class_client_stub.call_rpc_count - end - end - - def test_update_custom_class - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - validate_only = true - - update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_custom_class_client_stub.call_rpc_count - end - end - - def test_delete_custom_class - # 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" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), 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_custom_class_client_stub.call_rpc_count - end - end - - def test_undelete_custom_class - # 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" - validate_only = true - etag = "hello world" - - undelete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), 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, undelete_custom_class_client_stub.call_rpc_count - end - end - - def test_create_phrase_set - # 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. - phrase_set = {} - validate_only = true - phrase_set_id = "hello world" - parent = "hello world" - - create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["phrase_set_id"] - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_rpc_count - end - end - - def test_list_phrase_sets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_phrase_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_phrase_sets, name - assert_kind_of ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_phrase_sets_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), 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_phrase_sets_client_stub.call_rpc_count - end - end - - def test_get_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::PhraseSet.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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::GetPhraseSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_phrase_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_phrase_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_phrase_set({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.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_phrase_set_client_stub.call_rpc_count - end - end - - def test_update_phrase_set - # 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. - phrase_set = {} - update_mask = {} - validate_only = true - - update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_phrase_set_client_stub.call_rpc_count - end - end - - def test_delete_phrase_set - # 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" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), 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_phrase_set_client_stub.call_rpc_count - end - end - - def test_undelete_phrase_set - # 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" - validate_only = true - etag = "hello world" - - undelete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), 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, undelete_phrase_set_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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Speech::V2::Speech::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/helper.rb b/owl-bot-staging/google-cloud-speech-v2/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/helper.rb +++ /dev/null @@ -1,25 +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 "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"