google-cloud-speech-v2 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6dc0573ff1452b8d1557121bdb1480f17f7dc2f930940d28b1861cbfb13b50d
4
- data.tar.gz: 60ac9504005da3d94d0a56a006aa91edbc20a7fa5c2215c3acdcf152bb80ec2f
3
+ metadata.gz: 968563d525eccf954b107c73edfb327cc252d97912a5ca5ee688aa308ccafc04
4
+ data.tar.gz: cbba46b095a9649b5ebcefad32cf7fda937c76f1119e3792ff5e3ef41b49931a
5
5
  SHA512:
6
- metadata.gz: e682b0ec9905e8eb8550ed5b23c4b921f4db09308df56a7f17e40024c45a837c751598283b5cb994a2dab47406f1bacab12edc0d79a824d1628cc16aa6824c44
7
- data.tar.gz: '01997b59151cdc1d2ef28f4ba418c1ffc3a3994d154a08cc391d06d5ec0fd994683e68e1bd41f308a7d7daf7c8826ca408848e3dd24d0e7c8e9034ba58d2f229'
6
+ metadata.gz: 2cd7b6ecdce54170bdc1b7f35f0b0aee18e88a2cf6dc3dc8710bff3239b234a6154071c78a3fd49d8225a3dcfdca5d87aadf3d1c34ed722b1600e565f185f27a
7
+ data.tar.gz: 7e82039c8de923e79efe5e4e3ab8dba62c50db60e0a84b8cc194272b873ccbc0508a419ab6300b9dde3c483e0f17f8e500d64df510e8b4a8b7d6187ac6f5a4c8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Speech-to-Text V2 API
2
2
 
3
- API Client library for the Cloud Speech-to-Text V2 API
3
+ Converts audio to text by applying powerful neural network models.
4
4
 
5
5
  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.
6
6
 
@@ -46,8 +46,8 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Speech
24
+ ##
25
+ # @example Loading just the REST part of this package, including all its services, and instantiating a REST client
26
+ #
27
+ # require "google/cloud/speech/v2/rest"
28
+ # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new
29
+ #
30
+ module V2
31
+ ##
32
+ # @private
33
+ # Initialize the mixin bindings configuration
34
+ #
35
+ def self.configure
36
+ @configure ||= begin
37
+ namespace = ["Google", "Cloud", "Speech"]
38
+ parent_config = while namespace.any?
39
+ parent_name = namespace.join "::"
40
+ parent_const = const_get parent_name
41
+ break parent_const.configure if parent_const.respond_to? :configure
42
+ namespace.pop
43
+ end
44
+
45
+ default_config = Configuration.new parent_config
46
+ default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
47
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
48
+ uri_method: :get,
49
+ uri_template: "/v2/{name}",
50
+ matches: [
51
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
52
+ ],
53
+ body: nil
54
+ )
55
+ ]
56
+ default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
57
+
58
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
59
+ uri_method: :get,
60
+ uri_template: "/v2/{name}/locations",
61
+ matches: [
62
+ ["name", %r{^projects/[^/]+/?$}, false]
63
+ ],
64
+ body: nil
65
+ )
66
+ ]
67
+ default_config
68
+ end
69
+ yield @configure if block_given?
70
+ @configure
71
+ end
72
+
73
+ ##
74
+ # @private
75
+ # Configuration class for the google.cloud.speech.v2 package.
76
+ #
77
+ # This class contains common configuration for all services
78
+ # of the google.cloud.speech.v2 package.
79
+ #
80
+ # This configuration is for internal use of the client library classes,
81
+ # and it is not intended that the end-users will read or change it.
82
+ #
83
+ class Configuration
84
+ extend ::Gapic::Config
85
+
86
+ # @private
87
+ # Overrides for http bindings for the RPC of the mixins for this package.
88
+ # Services in this package should use these when creating clients for the mixin services.
89
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
90
+ config_attr :bindings_override, {}, ::Hash, nil
91
+
92
+ # @private
93
+ def initialize parent_config = nil
94
+ @parent_config = parent_config unless parent_config.nil?
95
+
96
+ yield self if block_given?
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -211,13 +211,32 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
211
211
  optional :config, :message, 4, "google.cloud.speech.v2.RecognitionConfig"
212
212
  optional :config_mask, :message, 5, "google.protobuf.FieldMask"
213
213
  repeated :files, :message, 3, "google.cloud.speech.v2.BatchRecognizeFileMetadata"
214
+ optional :recognition_output_config, :message, 6, "google.cloud.speech.v2.RecognitionOutputConfig"
215
+ end
216
+ add_message "google.cloud.speech.v2.GcsOutputConfig" do
217
+ optional :uri, :string, 1
218
+ end
219
+ add_message "google.cloud.speech.v2.InlineOutputConfig" do
220
+ end
221
+ add_message "google.cloud.speech.v2.RecognitionOutputConfig" do
222
+ oneof :output do
223
+ optional :gcs_output_config, :message, 1, "google.cloud.speech.v2.GcsOutputConfig"
224
+ optional :inline_response_config, :message, 2, "google.cloud.speech.v2.InlineOutputConfig"
225
+ end
214
226
  end
215
227
  add_message "google.cloud.speech.v2.BatchRecognizeResponse" do
216
228
  map :results, :string, :message, 1, "google.cloud.speech.v2.BatchRecognizeFileResult"
229
+ optional :total_billed_duration, :message, 2, "google.protobuf.Duration"
230
+ end
231
+ add_message "google.cloud.speech.v2.BatchRecognizeResults" do
232
+ repeated :results, :message, 1, "google.cloud.speech.v2.SpeechRecognitionResult"
233
+ optional :metadata, :message, 2, "google.cloud.speech.v2.RecognitionResponseMetadata"
217
234
  end
218
235
  add_message "google.cloud.speech.v2.BatchRecognizeFileResult" do
219
236
  optional :uri, :string, 1
220
237
  optional :error, :message, 2, "google.rpc.Status"
238
+ optional :metadata, :message, 3, "google.cloud.speech.v2.RecognitionResponseMetadata"
239
+ optional :transcript, :message, 4, "google.cloud.speech.v2.BatchRecognizeResults"
221
240
  end
222
241
  add_message "google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata" do
223
242
  optional :progress_percent, :int32, 1
@@ -423,7 +442,11 @@ module Google
423
442
  StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass
424
443
  StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass
425
444
  BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass
445
+ GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GcsOutputConfig").msgclass
446
+ InlineOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineOutputConfig").msgclass
447
+ RecognitionOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionOutputConfig").msgclass
426
448
  BatchRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResponse").msgclass
449
+ BatchRecognizeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResults").msgclass
427
450
  BatchRecognizeFileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileResult").msgclass
428
451
  BatchRecognizeTranscriptionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata").msgclass
429
452
  BatchRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeMetadata").msgclass
@@ -39,7 +39,7 @@ module Google
39
39
  rpc :ListRecognizers, ::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Google::Cloud::Speech::V2::ListRecognizersResponse
40
40
  # Returns the requested
41
41
  # [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
42
- # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't
42
+ # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
43
43
  # exist.
44
44
  rpc :GetRecognizer, ::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Google::Cloud::Speech::V2::Recognizer
45
45
  # Updates the [Recognizer][google.cloud.speech.v2.Recognizer].
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/speech/v2/speech/rest"
20
+ require "google/cloud/speech/v2/bindings_override"
21
+ require "google/cloud/speech/v2/version"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Speech
26
+ ##
27
+ # To load just the REST part of this package, including all its services, and instantiate a REST client:
28
+ #
29
+ # @example
30
+ #
31
+ # require "google/cloud/speech/v2/rest"
32
+ # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new
33
+ #
34
+ module V2
35
+ end
36
+ end
37
+ end
38
+ end
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/speech/v2/cloud_speech_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -144,6 +145,12 @@ module Google
144
145
  config.endpoint = @config.endpoint
145
146
  end
146
147
 
148
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
149
+ config.credentials = credentials
150
+ config.quota_project = @quota_project_id
151
+ config.endpoint = @config.endpoint
152
+ end
153
+
147
154
  @speech_stub = ::Gapic::ServiceStub.new(
148
155
  ::Google::Cloud::Speech::V2::Speech::Stub,
149
156
  credentials: credentials,
@@ -160,6 +167,13 @@ module Google
160
167
  #
161
168
  attr_reader :operations_client
162
169
 
170
+ ##
171
+ # Get the associated client for mix-in of the Locations.
172
+ #
173
+ # @return [Google::Cloud::Location::Locations::Client]
174
+ #
175
+ attr_reader :location_client
176
+
163
177
  # Service calls
164
178
 
165
179
  ##
@@ -215,14 +229,14 @@ module Google
215
229
  # # Call the create_recognizer method.
216
230
  # result = client.create_recognizer request
217
231
  #
218
- # # The returned object is of type Gapic::Operation. You can use this
219
- # # object to check the status of an operation, cancel it, or wait
220
- # # for results. Here is how to block until completion:
232
+ # # The returned object is of type Gapic::Operation. You can use it to
233
+ # # check the status of an operation, cancel it, or wait for results.
234
+ # # Here is how to wait for a response.
221
235
  # result.wait_until_done! timeout: 60
222
236
  # if result.response?
223
237
  # p result.response
224
238
  # else
225
- # puts "Error!"
239
+ # puts "No response received."
226
240
  # end
227
241
  #
228
242
  def create_recognizer request, options = nil
@@ -323,13 +337,11 @@ module Google
323
337
  # # Call the list_recognizers method.
324
338
  # result = client.list_recognizers request
325
339
  #
326
- # # The returned object is of type Gapic::PagedEnumerable. You can
327
- # # iterate over all elements by calling #each, and the enumerable
328
- # # will lazily make API calls to fetch subsequent pages. Other
329
- # # methods are also available for managing paging directly.
330
- # result.each do |response|
340
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
341
+ # # over elements, and API calls will be issued to fetch pages as needed.
342
+ # result.each do |item|
331
343
  # # Each element is of type ::Google::Cloud::Speech::V2::Recognizer.
332
- # p response
344
+ # p item
333
345
  # end
334
346
  #
335
347
  def list_recognizers request, options = nil
@@ -377,7 +389,7 @@ module Google
377
389
  ##
378
390
  # Returns the requested
379
391
  # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with
380
- # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't
392
+ # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
381
393
  # exist.
382
394
  #
383
395
  # @overload get_recognizer(request, options = nil)
@@ -513,14 +525,14 @@ module Google
513
525
  # # Call the update_recognizer method.
514
526
  # result = client.update_recognizer request
515
527
  #
516
- # # The returned object is of type Gapic::Operation. You can use this
517
- # # object to check the status of an operation, cancel it, or wait
518
- # # for results. Here is how to block until completion:
528
+ # # The returned object is of type Gapic::Operation. You can use it to
529
+ # # check the status of an operation, cancel it, or wait for results.
530
+ # # Here is how to wait for a response.
519
531
  # result.wait_until_done! timeout: 60
520
532
  # if result.response?
521
533
  # p result.response
522
534
  # else
523
- # puts "Error!"
535
+ # puts "No response received."
524
536
  # end
525
537
  #
526
538
  def update_recognizer request, options = nil
@@ -617,14 +629,14 @@ module Google
617
629
  # # Call the delete_recognizer method.
618
630
  # result = client.delete_recognizer request
619
631
  #
620
- # # The returned object is of type Gapic::Operation. You can use this
621
- # # object to check the status of an operation, cancel it, or wait
622
- # # for results. Here is how to block until completion:
632
+ # # The returned object is of type Gapic::Operation. You can use it to
633
+ # # check the status of an operation, cancel it, or wait for results.
634
+ # # Here is how to wait for a response.
623
635
  # result.wait_until_done! timeout: 60
624
636
  # if result.response?
625
637
  # p result.response
626
638
  # else
627
- # puts "Error!"
639
+ # puts "No response received."
628
640
  # end
629
641
  #
630
642
  def delete_recognizer request, options = nil
@@ -718,14 +730,14 @@ module Google
718
730
  # # Call the undelete_recognizer method.
719
731
  # result = client.undelete_recognizer request
720
732
  #
721
- # # The returned object is of type Gapic::Operation. You can use this
722
- # # object to check the status of an operation, cancel it, or wait
723
- # # for results. Here is how to block until completion:
733
+ # # The returned object is of type Gapic::Operation. You can use it to
734
+ # # check the status of an operation, cancel it, or wait for results.
735
+ # # Here is how to wait for a response.
724
736
  # result.wait_until_done! timeout: 60
725
737
  # if result.response?
726
738
  # p result.response
727
739
  # else
728
- # puts "Error!"
740
+ # puts "No response received."
729
741
  # end
730
742
  #
731
743
  def undelete_recognizer request, options = nil
@@ -916,22 +928,22 @@ module Google
916
928
  # # Create a client object. The client can be reused for multiple calls.
917
929
  # client = Google::Cloud::Speech::V2::Speech::Client.new
918
930
  #
919
- # # Create an input stream
931
+ # # Create an input stream.
920
932
  # input = Gapic::StreamInput.new
921
933
  #
922
934
  # # Call the streaming_recognize method to start streaming.
923
935
  # output = client.streaming_recognize input
924
936
  #
925
- # # Send requests on the stream. For each request, pass in keyword
926
- # # arguments to set fields. Be sure to close the stream when done.
937
+ # # Send requests on the stream. For each request object, set fields by
938
+ # # passing keyword arguments. Be sure to close the stream when done.
927
939
  # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new
928
940
  # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new
929
941
  # input.close
930
942
  #
931
- # # Handle streamed responses. These may be interleaved with inputs.
932
- # # Each response is of type ::Google::Cloud::Speech::V2::StreamingRecognizeResponse.
933
- # output.each do |response|
934
- # p response
943
+ # # The returned object is a streamed enumerable yielding elements of type
944
+ # # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse
945
+ # output.each do |current_response|
946
+ # p current_response
935
947
  # end
936
948
  #
937
949
  def streaming_recognize request, options = nil
@@ -987,7 +999,7 @@ module Google
987
999
  # @param options [::Gapic::CallOptions, ::Hash]
988
1000
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
989
1001
  #
990
- # @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil)
1002
+ # @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil)
991
1003
  # Pass arguments to `batch_recognize` via keyword arguments. Note that at
992
1004
  # least one keyword argument is required. To specify no parameters, or to keep all
993
1005
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1017,6 +1029,9 @@ module Google
1017
1029
  # request.
1018
1030
  # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>]
1019
1031
  # Audio files with file metadata for ASR.
1032
+ # The maximum number of files allowed to be specified is 5.
1033
+ # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash]
1034
+ # Configuration options for where to output the transcripts of each file.
1020
1035
  #
1021
1036
  # @yield [response, operation] Access the result along with the RPC operation
1022
1037
  # @yieldparam response [::Gapic::Operation]
@@ -1038,14 +1053,14 @@ module Google
1038
1053
  # # Call the batch_recognize method.
1039
1054
  # result = client.batch_recognize request
1040
1055
  #
1041
- # # The returned object is of type Gapic::Operation. You can use this
1042
- # # object to check the status of an operation, cancel it, or wait
1043
- # # for results. Here is how to block until completion:
1056
+ # # The returned object is of type Gapic::Operation. You can use it to
1057
+ # # check the status of an operation, cancel it, or wait for results.
1058
+ # # Here is how to wait for a response.
1044
1059
  # result.wait_until_done! timeout: 60
1045
1060
  # if result.response?
1046
1061
  # p result.response
1047
1062
  # else
1048
- # puts "Error!"
1063
+ # puts "No response received."
1049
1064
  # end
1050
1065
  #
1051
1066
  def batch_recognize request, options = nil
@@ -1320,14 +1335,14 @@ module Google
1320
1335
  # # Call the create_custom_class method.
1321
1336
  # result = client.create_custom_class request
1322
1337
  #
1323
- # # The returned object is of type Gapic::Operation. You can use this
1324
- # # object to check the status of an operation, cancel it, or wait
1325
- # # for results. Here is how to block until completion:
1338
+ # # The returned object is of type Gapic::Operation. You can use it to
1339
+ # # check the status of an operation, cancel it, or wait for results.
1340
+ # # Here is how to wait for a response.
1326
1341
  # result.wait_until_done! timeout: 60
1327
1342
  # if result.response?
1328
1343
  # p result.response
1329
1344
  # else
1330
- # puts "Error!"
1345
+ # puts "No response received."
1331
1346
  # end
1332
1347
  #
1333
1348
  def create_custom_class request, options = nil
@@ -1429,13 +1444,11 @@ module Google
1429
1444
  # # Call the list_custom_classes method.
1430
1445
  # result = client.list_custom_classes request
1431
1446
  #
1432
- # # The returned object is of type Gapic::PagedEnumerable. You can
1433
- # # iterate over all elements by calling #each, and the enumerable
1434
- # # will lazily make API calls to fetch subsequent pages. Other
1435
- # # methods are also available for managing paging directly.
1436
- # result.each do |response|
1447
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1448
+ # # over elements, and API calls will be issued to fetch pages as needed.
1449
+ # result.each do |item|
1437
1450
  # # Each element is of type ::Google::Cloud::Speech::V2::CustomClass.
1438
- # p response
1451
+ # p item
1439
1452
  # end
1440
1453
  #
1441
1454
  def list_custom_classes request, options = nil
@@ -1618,14 +1631,14 @@ module Google
1618
1631
  # # Call the update_custom_class method.
1619
1632
  # result = client.update_custom_class request
1620
1633
  #
1621
- # # The returned object is of type Gapic::Operation. You can use this
1622
- # # object to check the status of an operation, cancel it, or wait
1623
- # # for results. Here is how to block until completion:
1634
+ # # The returned object is of type Gapic::Operation. You can use it to
1635
+ # # check the status of an operation, cancel it, or wait for results.
1636
+ # # Here is how to wait for a response.
1624
1637
  # result.wait_until_done! timeout: 60
1625
1638
  # if result.response?
1626
1639
  # p result.response
1627
1640
  # else
1628
- # puts "Error!"
1641
+ # puts "No response received."
1629
1642
  # end
1630
1643
  #
1631
1644
  def update_custom_class request, options = nil
@@ -1723,14 +1736,14 @@ module Google
1723
1736
  # # Call the delete_custom_class method.
1724
1737
  # result = client.delete_custom_class request
1725
1738
  #
1726
- # # The returned object is of type Gapic::Operation. You can use this
1727
- # # object to check the status of an operation, cancel it, or wait
1728
- # # for results. Here is how to block until completion:
1739
+ # # The returned object is of type Gapic::Operation. You can use it to
1740
+ # # check the status of an operation, cancel it, or wait for results.
1741
+ # # Here is how to wait for a response.
1729
1742
  # result.wait_until_done! timeout: 60
1730
1743
  # if result.response?
1731
1744
  # p result.response
1732
1745
  # else
1733
- # puts "Error!"
1746
+ # puts "No response received."
1734
1747
  # end
1735
1748
  #
1736
1749
  def delete_custom_class request, options = nil
@@ -1825,14 +1838,14 @@ module Google
1825
1838
  # # Call the undelete_custom_class method.
1826
1839
  # result = client.undelete_custom_class request
1827
1840
  #
1828
- # # The returned object is of type Gapic::Operation. You can use this
1829
- # # object to check the status of an operation, cancel it, or wait
1830
- # # for results. Here is how to block until completion:
1841
+ # # The returned object is of type Gapic::Operation. You can use it to
1842
+ # # check the status of an operation, cancel it, or wait for results.
1843
+ # # Here is how to wait for a response.
1831
1844
  # result.wait_until_done! timeout: 60
1832
1845
  # if result.response?
1833
1846
  # p result.response
1834
1847
  # else
1835
- # puts "Error!"
1848
+ # puts "No response received."
1836
1849
  # end
1837
1850
  #
1838
1851
  def undelete_custom_class request, options = nil
@@ -1930,14 +1943,14 @@ module Google
1930
1943
  # # Call the create_phrase_set method.
1931
1944
  # result = client.create_phrase_set request
1932
1945
  #
1933
- # # The returned object is of type Gapic::Operation. You can use this
1934
- # # object to check the status of an operation, cancel it, or wait
1935
- # # for results. Here is how to block until completion:
1946
+ # # The returned object is of type Gapic::Operation. You can use it to
1947
+ # # check the status of an operation, cancel it, or wait for results.
1948
+ # # Here is how to wait for a response.
1936
1949
  # result.wait_until_done! timeout: 60
1937
1950
  # if result.response?
1938
1951
  # p result.response
1939
1952
  # else
1940
- # puts "Error!"
1953
+ # puts "No response received."
1941
1954
  # end
1942
1955
  #
1943
1956
  def create_phrase_set request, options = nil
@@ -2038,13 +2051,11 @@ module Google
2038
2051
  # # Call the list_phrase_sets method.
2039
2052
  # result = client.list_phrase_sets request
2040
2053
  #
2041
- # # The returned object is of type Gapic::PagedEnumerable. You can
2042
- # # iterate over all elements by calling #each, and the enumerable
2043
- # # will lazily make API calls to fetch subsequent pages. Other
2044
- # # methods are also available for managing paging directly.
2045
- # result.each do |response|
2054
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2055
+ # # over elements, and API calls will be issued to fetch pages as needed.
2056
+ # result.each do |item|
2046
2057
  # # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet.
2047
- # p response
2058
+ # p item
2048
2059
  # end
2049
2060
  #
2050
2061
  def list_phrase_sets request, options = nil
@@ -2226,14 +2237,14 @@ module Google
2226
2237
  # # Call the update_phrase_set method.
2227
2238
  # result = client.update_phrase_set request
2228
2239
  #
2229
- # # The returned object is of type Gapic::Operation. You can use this
2230
- # # object to check the status of an operation, cancel it, or wait
2231
- # # for results. Here is how to block until completion:
2240
+ # # The returned object is of type Gapic::Operation. You can use it to
2241
+ # # check the status of an operation, cancel it, or wait for results.
2242
+ # # Here is how to wait for a response.
2232
2243
  # result.wait_until_done! timeout: 60
2233
2244
  # if result.response?
2234
2245
  # p result.response
2235
2246
  # else
2236
- # puts "Error!"
2247
+ # puts "No response received."
2237
2248
  # end
2238
2249
  #
2239
2250
  def update_phrase_set request, options = nil
@@ -2330,14 +2341,14 @@ module Google
2330
2341
  # # Call the delete_phrase_set method.
2331
2342
  # result = client.delete_phrase_set request
2332
2343
  #
2333
- # # The returned object is of type Gapic::Operation. You can use this
2334
- # # object to check the status of an operation, cancel it, or wait
2335
- # # for results. Here is how to block until completion:
2344
+ # # The returned object is of type Gapic::Operation. You can use it to
2345
+ # # check the status of an operation, cancel it, or wait for results.
2346
+ # # Here is how to wait for a response.
2336
2347
  # result.wait_until_done! timeout: 60
2337
2348
  # if result.response?
2338
2349
  # p result.response
2339
2350
  # else
2340
- # puts "Error!"
2351
+ # puts "No response received."
2341
2352
  # end
2342
2353
  #
2343
2354
  def delete_phrase_set request, options = nil
@@ -2431,14 +2442,14 @@ module Google
2431
2442
  # # Call the undelete_phrase_set method.
2432
2443
  # result = client.undelete_phrase_set request
2433
2444
  #
2434
- # # The returned object is of type Gapic::Operation. You can use this
2435
- # # object to check the status of an operation, cancel it, or wait
2436
- # # for results. Here is how to block until completion:
2445
+ # # The returned object is of type Gapic::Operation. You can use it to
2446
+ # # check the status of an operation, cancel it, or wait for results.
2447
+ # # Here is how to wait for a response.
2437
2448
  # result.wait_until_done! timeout: 60
2438
2449
  # if result.response?
2439
2450
  # p result.response
2440
2451
  # else
2441
- # puts "Error!"
2452
+ # puts "No response received."
2442
2453
  # end
2443
2454
  #
2444
2455
  def undelete_phrase_set request, options = nil
@@ -2521,9 +2532,9 @@ module Google
2521
2532
  # * (`String`) The path to a service account key file in JSON format
2522
2533
  # * (`Hash`) A service account key as a Hash
2523
2534
  # * (`Google::Auth::Credentials`) A googleauth credentials object
2524
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2535
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2525
2536
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2526
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2537
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2527
2538
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2528
2539
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2529
2540
  # * (`nil`) indicating no credentials