google-cloud-speech-v1 0.10.1 → 0.11.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.
@@ -0,0 +1,52 @@
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/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/speech/v1/version"
24
+
25
+ require "google/cloud/speech/v1/adaptation/credentials"
26
+ require "google/cloud/speech/v1/adaptation/paths"
27
+ require "google/cloud/speech/v1/adaptation/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Speech
32
+ module V1
33
+ ##
34
+ # Service that implements Google Cloud Speech Adaptation API.
35
+ #
36
+ # To load this service and instantiate a REST client:
37
+ #
38
+ # require "google/cloud/speech/v1/adaptation/rest"
39
+ # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new
40
+ #
41
+ module Adaptation
42
+ # Client for the REST transport
43
+ module Rest
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
52
+ require "google/cloud/speech/v1/adaptation/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/speech/v1/version"
25
25
  require "google/cloud/speech/v1/adaptation/credentials"
26
26
  require "google/cloud/speech/v1/adaptation/paths"
27
27
  require "google/cloud/speech/v1/adaptation/client"
28
+ require "google/cloud/speech/v1/adaptation/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -38,6 +39,11 @@ module Google
38
39
  # require "google/cloud/speech/v1/adaptation"
39
40
  # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new
40
41
  #
42
+ # @example Load this service and instantiate a REST client
43
+ #
44
+ # require "google/cloud/speech/v1/adaptation/rest"
45
+ # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new
46
+ #
41
47
  module Adaptation
42
48
  end
43
49
  end
@@ -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/v1/speech/rest"
20
+ require "google/cloud/speech/v1/adaptation/rest"
21
+ require "google/cloud/speech/v1/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/v1/rest"
32
+ # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new
33
+ #
34
+ module V1
35
+ end
36
+ end
37
+ end
38
+ end
@@ -301,14 +301,14 @@ module Google
301
301
  # # Call the long_running_recognize method.
302
302
  # result = client.long_running_recognize request
303
303
  #
304
- # # The returned object is of type Gapic::Operation. You can use this
305
- # # object to check the status of an operation, cancel it, or wait
306
- # # for results. Here is how to block until completion:
304
+ # # The returned object is of type Gapic::Operation. You can use it to
305
+ # # check the status of an operation, cancel it, or wait for results.
306
+ # # Here is how to wait for a response.
307
307
  # result.wait_until_done! timeout: 60
308
308
  # if result.response?
309
309
  # p result.response
310
310
  # else
311
- # puts "Error!"
311
+ # puts "No response received."
312
312
  # end
313
313
  #
314
314
  def long_running_recognize request, options = nil
@@ -368,22 +368,22 @@ module Google
368
368
  # # Create a client object. The client can be reused for multiple calls.
369
369
  # client = Google::Cloud::Speech::V1::Speech::Client.new
370
370
  #
371
- # # Create an input stream
371
+ # # Create an input stream.
372
372
  # input = Gapic::StreamInput.new
373
373
  #
374
374
  # # Call the streaming_recognize method to start streaming.
375
375
  # output = client.streaming_recognize input
376
376
  #
377
- # # Send requests on the stream. For each request, pass in keyword
378
- # # arguments to set fields. Be sure to close the stream when done.
377
+ # # Send requests on the stream. For each request object, set fields by
378
+ # # passing keyword arguments. Be sure to close the stream when done.
379
379
  # input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new
380
380
  # input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new
381
381
  # input.close
382
382
  #
383
- # # Handle streamed responses. These may be interleaved with inputs.
384
- # # Each response is of type ::Google::Cloud::Speech::V1::StreamingRecognizeResponse.
385
- # output.each do |response|
386
- # p response
383
+ # # The returned object is a streamed enumerable yielding elements of type
384
+ # # ::Google::Cloud::Speech::V1::StreamingRecognizeResponse
385
+ # output.each do |current_response|
386
+ # p current_response
387
387
  # end
388
388
  #
389
389
  def streaming_recognize request, options = nil
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -184,14 +182,6 @@ module Google
184
182
  gapic_version: ::Google::Cloud::Speech::V1::VERSION
185
183
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
186
184
 
187
- header_params = {}
188
- if request.name
189
- header_params["name"] = request.name
190
- end
191
-
192
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
193
- metadata[:"x-goog-request-params"] ||= request_params_header
194
-
195
185
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
196
186
  metadata: metadata,
197
187
  retry_policy: @config.rpcs.list_operations.retry_policy
@@ -253,14 +243,14 @@ module Google
253
243
  # # Call the get_operation method.
254
244
  # result = client.get_operation request
255
245
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
246
+ # # The returned object is of type Gapic::Operation. You can use it to
247
+ # # check the status of an operation, cancel it, or wait for results.
248
+ # # Here is how to wait for a response.
259
249
  # result.wait_until_done! timeout: 60
260
250
  # if result.response?
261
251
  # p result.response
262
252
  # else
263
- # puts "Error!"
253
+ # puts "No response received."
264
254
  # end
265
255
  #
266
256
  def get_operation request, options = nil
@@ -540,14 +530,14 @@ module Google
540
530
  # # Call the wait_operation method.
541
531
  # result = client.wait_operation request
542
532
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
533
+ # # The returned object is of type Gapic::Operation. You can use it to
534
+ # # check the status of an operation, cancel it, or wait for results.
535
+ # # Here is how to wait for a response.
546
536
  # result.wait_until_done! timeout: 60
547
537
  # if result.response?
548
538
  # p result.response
549
539
  # else
550
- # puts "Error!"
540
+ # puts "No response received."
551
541
  # end
552
542
  #
553
543
  def wait_operation request, options = nil