google-cloud-speech-v1 0.1.3 → 0.1.4
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 +4 -4
- data/AUTHENTICATION.md +6 -6
- data/README.md +1 -1
- data/lib/google/cloud/speech/v1/speech/client.rb +88 -88
- data/lib/google/cloud/speech/v1/speech/credentials.rb +1 -1
- data/lib/google/cloud/speech/v1/speech/operations.rb +100 -100
- data/lib/google/cloud/speech/v1/speech.rb +1 -1
- data/lib/google/cloud/speech/v1/version.rb +1 -1
- data/lib/google/cloud/speech/v1.rb +1 -1
- data/proto_docs/google/api/resource.rb +12 -12
- data/proto_docs/google/cloud/speech/v1/cloud_speech.rb +99 -99
- data/proto_docs/google/longrunning/operations.rb +30 -30
- data/proto_docs/google/protobuf/any.rb +4 -4
- data/proto_docs/google/protobuf/duration.rb +4 -4
- data/proto_docs/google/protobuf/empty.rb +2 -2
- data/proto_docs/google/protobuf/timestamp.rb +4 -4
- data/proto_docs/google/rpc/status.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e61467bec2b883587f3bbd2b40b86c3b103be3446fb34fe56d5f4281eac996aa
|
4
|
+
data.tar.gz: 66649e057ae49b6a217b4061a0a54dda84e25951eabad1e8d3a845fb1b5a1169
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2519ad72380ad73d5bdaa281be246787df7e1ea7569c15805471d634e1d0afaafbb42a18ca5d708543d2a76d5173ed6074d059291118d4898772978251b6d013
|
7
|
+
data.tar.gz: 7288627763768ab25e3cae2c0b4a0121941ababe90fefee268ff9cc9ed31922d2c3014ab11f447250f8de58c133612f6ec3facc3c5efdb67da2ba458ebbbc951
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export SPEECH_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/speech/v1"
|
29
29
|
|
30
|
-
client = Google::Cloud::Speech::V1::Speech::Client.new
|
30
|
+
client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
31
31
|
```
|
32
32
|
|
33
33
|
## Credential Lookup
|
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
|
|
64
64
|
|
65
65
|
The environment variables that google-cloud-speech-v1
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{Google::Cloud::Speech::V1::Speech::Credentials}):
|
67
|
+
{::Google::Cloud::Speech::V1::Speech::Credentials}):
|
68
68
|
|
69
69
|
1. `SPEECH_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
70
|
2. `SPEECH_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -77,7 +77,7 @@ require "google/cloud/speech/v1"
|
|
77
77
|
|
78
78
|
ENV["SPEECH_CREDENTIALS"] = "path/to/keyfile.json"
|
79
79
|
|
80
|
-
client = Google::Cloud::Speech::V1::Speech::Client.new
|
80
|
+
client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
81
81
|
```
|
82
82
|
|
83
83
|
### Configuration
|
@@ -88,7 +88,7 @@ environment variables. Either on an individual client initialization:
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/speech/v1"
|
90
90
|
|
91
|
-
client = Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
91
|
+
client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
92
92
|
config.credentials = "path/to/keyfile.json"
|
93
93
|
end
|
94
94
|
```
|
@@ -98,11 +98,11 @@ Or configured globally for all clients:
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/speech/v1"
|
100
100
|
|
101
|
-
Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
101
|
+
::Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
102
102
|
config.credentials = "path/to/keyfile.json"
|
103
103
|
end
|
104
104
|
|
105
|
-
client = Google::Cloud::Speech::V1::Speech::Client.new
|
105
|
+
client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
106
106
|
```
|
107
107
|
|
108
108
|
### Cloud SDK
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ In order to use this library, you first need to go through the following steps:
|
|
25
25
|
```ruby
|
26
26
|
require "google/cloud/speech/v1"
|
27
27
|
|
28
|
-
client = Google::Cloud::Speech::V1::Speech::Client.new
|
28
|
+
client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
29
29
|
request = my_create_request
|
30
30
|
response = client.recognize request
|
31
31
|
```
|
@@ -36,15 +36,15 @@ module Google
|
|
36
36
|
##
|
37
37
|
# Configure the Speech Client class.
|
38
38
|
#
|
39
|
-
# See {Google::Cloud::Speech::V1::Speech::Client::Configuration}
|
39
|
+
# See {::Google::Cloud::Speech::V1::Speech::Client::Configuration}
|
40
40
|
# for a description of the configuration fields.
|
41
41
|
#
|
42
42
|
# ## Example
|
43
43
|
#
|
44
44
|
# To modify the configuration for all Speech clients:
|
45
45
|
#
|
46
|
-
# Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
47
|
-
# config.timeout =
|
46
|
+
# ::Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
47
|
+
# config.timeout = 10.0
|
48
48
|
# end
|
49
49
|
#
|
50
50
|
# @yield [config] Configure the Client client.
|
@@ -94,7 +94,7 @@ module Google
|
|
94
94
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
95
95
|
# should be made on {Client.configure}.
|
96
96
|
#
|
97
|
-
# See {Google::Cloud::Speech::V1::Speech::Client::Configuration}
|
97
|
+
# See {::Google::Cloud::Speech::V1::Speech::Client::Configuration}
|
98
98
|
# for a description of the configuration fields.
|
99
99
|
#
|
100
100
|
# @yield [config] Configure the Client client.
|
@@ -115,13 +115,13 @@ module Google
|
|
115
115
|
# To create a new Speech client with the default
|
116
116
|
# configuration:
|
117
117
|
#
|
118
|
-
# client = Google::Cloud::Speech::V1::Speech::Client.new
|
118
|
+
# client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
119
119
|
#
|
120
120
|
# To create a new Speech client with a custom
|
121
121
|
# configuration:
|
122
122
|
#
|
123
|
-
# client = Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
124
|
-
# config.timeout =
|
123
|
+
# client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
124
|
+
# config.timeout = 10.0
|
125
125
|
# end
|
126
126
|
#
|
127
127
|
# @yield [config] Configure the Speech client.
|
@@ -153,8 +153,8 @@ module Google
|
|
153
153
|
config.endpoint = @config.endpoint
|
154
154
|
end
|
155
155
|
|
156
|
-
@speech_stub = Gapic::ServiceStub.new(
|
157
|
-
Google::Cloud::Speech::V1::Speech::Stub,
|
156
|
+
@speech_stub = ::Gapic::ServiceStub.new(
|
157
|
+
::Google::Cloud::Speech::V1::Speech::Stub,
|
158
158
|
credentials: credentials,
|
159
159
|
endpoint: @config.endpoint,
|
160
160
|
channel_args: @config.channel_args,
|
@@ -165,7 +165,7 @@ module Google
|
|
165
165
|
##
|
166
166
|
# Get the associated client for long-running operations.
|
167
167
|
#
|
168
|
-
# @return [Google::Cloud::Speech::V1::Speech::Operations]
|
168
|
+
# @return [::Google::Cloud::Speech::V1::Speech::Operations]
|
169
169
|
#
|
170
170
|
attr_reader :operations_client
|
171
171
|
|
@@ -177,12 +177,12 @@ module Google
|
|
177
177
|
#
|
178
178
|
# @overload recognize(request, options = nil)
|
179
179
|
# Pass arguments to `recognize` via a request object, either of type
|
180
|
-
# {Google::Cloud::Speech::V1::RecognizeRequest} or an equivalent Hash.
|
180
|
+
# {::Google::Cloud::Speech::V1::RecognizeRequest} or an equivalent Hash.
|
181
181
|
#
|
182
|
-
# @param request [Google::Cloud::Speech::V1::RecognizeRequest, Hash]
|
182
|
+
# @param request [::Google::Cloud::Speech::V1::RecognizeRequest, ::Hash]
|
183
183
|
# A request object representing the call parameters. Required. To specify no
|
184
184
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
185
|
-
# @param options [Gapic::CallOptions, Hash]
|
185
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
186
186
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
187
187
|
#
|
188
188
|
# @overload recognize(config: nil, audio: nil)
|
@@ -190,33 +190,33 @@ module Google
|
|
190
190
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
191
191
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
192
192
|
#
|
193
|
-
# @param config [Google::Cloud::Speech::V1::RecognitionConfig, Hash]
|
193
|
+
# @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash]
|
194
194
|
# Required. Provides information to the recognizer that specifies how to
|
195
195
|
# process the request.
|
196
|
-
# @param audio [Google::Cloud::Speech::V1::RecognitionAudio, Hash]
|
196
|
+
# @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash]
|
197
197
|
# Required. The audio data to be recognized.
|
198
198
|
#
|
199
199
|
# @yield [response, operation] Access the result along with the RPC operation
|
200
|
-
# @yieldparam response [Google::Cloud::Speech::V1::RecognizeResponse]
|
201
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
200
|
+
# @yieldparam response [::Google::Cloud::Speech::V1::RecognizeResponse]
|
201
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
202
202
|
#
|
203
|
-
# @return [Google::Cloud::Speech::V1::RecognizeResponse]
|
203
|
+
# @return [::Google::Cloud::Speech::V1::RecognizeResponse]
|
204
204
|
#
|
205
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
205
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
206
206
|
#
|
207
207
|
def recognize request, options = nil
|
208
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
208
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
209
209
|
|
210
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Speech::V1::RecognizeRequest
|
210
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::RecognizeRequest
|
211
211
|
|
212
212
|
# Converts hash and nil to an options object
|
213
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
213
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
214
214
|
|
215
215
|
# Customize the options with defaults
|
216
216
|
metadata = @config.rpcs.recognize.metadata.to_h
|
217
217
|
|
218
218
|
# Set x-goog-api-client and x-goog-user-project headers
|
219
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
219
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
220
220
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
221
221
|
gapic_version: ::Google::Cloud::Speech::V1::VERSION
|
222
222
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -231,8 +231,8 @@ module Google
|
|
231
231
|
yield response, operation if block_given?
|
232
232
|
return response
|
233
233
|
end
|
234
|
-
rescue GRPC::BadStatus => e
|
235
|
-
raise Google::Cloud::Error.from_error(e)
|
234
|
+
rescue ::GRPC::BadStatus => e
|
235
|
+
raise ::Google::Cloud::Error.from_error(e)
|
236
236
|
end
|
237
237
|
|
238
238
|
##
|
@@ -245,12 +245,12 @@ module Google
|
|
245
245
|
#
|
246
246
|
# @overload long_running_recognize(request, options = nil)
|
247
247
|
# Pass arguments to `long_running_recognize` via a request object, either of type
|
248
|
-
# {Google::Cloud::Speech::V1::LongRunningRecognizeRequest} or an equivalent Hash.
|
248
|
+
# {::Google::Cloud::Speech::V1::LongRunningRecognizeRequest} or an equivalent Hash.
|
249
249
|
#
|
250
|
-
# @param request [Google::Cloud::Speech::V1::LongRunningRecognizeRequest, Hash]
|
250
|
+
# @param request [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, ::Hash]
|
251
251
|
# A request object representing the call parameters. Required. To specify no
|
252
252
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
253
|
-
# @param options [Gapic::CallOptions, Hash]
|
253
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
254
254
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
255
255
|
#
|
256
256
|
# @overload long_running_recognize(config: nil, audio: nil)
|
@@ -258,33 +258,33 @@ module Google
|
|
258
258
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
259
259
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
260
260
|
#
|
261
|
-
# @param config [Google::Cloud::Speech::V1::RecognitionConfig, Hash]
|
261
|
+
# @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash]
|
262
262
|
# Required. Provides information to the recognizer that specifies how to
|
263
263
|
# process the request.
|
264
|
-
# @param audio [Google::Cloud::Speech::V1::RecognitionAudio, Hash]
|
264
|
+
# @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash]
|
265
265
|
# Required. The audio data to be recognized.
|
266
266
|
#
|
267
267
|
# @yield [response, operation] Access the result along with the RPC operation
|
268
|
-
# @yieldparam response [Gapic::Operation]
|
269
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
268
|
+
# @yieldparam response [::Gapic::Operation]
|
269
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
270
270
|
#
|
271
|
-
# @return [Gapic::Operation]
|
271
|
+
# @return [::Gapic::Operation]
|
272
272
|
#
|
273
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
273
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
274
274
|
#
|
275
275
|
def long_running_recognize request, options = nil
|
276
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
276
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
277
277
|
|
278
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Speech::V1::LongRunningRecognizeRequest
|
278
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest
|
279
279
|
|
280
280
|
# Converts hash and nil to an options object
|
281
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
281
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
282
282
|
|
283
283
|
# Customize the options with defaults
|
284
284
|
metadata = @config.rpcs.long_running_recognize.metadata.to_h
|
285
285
|
|
286
286
|
# Set x-goog-api-client and x-goog-user-project headers
|
287
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
287
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
288
288
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
289
289
|
gapic_version: ::Google::Cloud::Speech::V1::VERSION
|
290
290
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -296,49 +296,49 @@ module Google
|
|
296
296
|
retry_policy: @config.retry_policy
|
297
297
|
|
298
298
|
@speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation|
|
299
|
-
response = Gapic::Operation.new response, @operations_client, options: options
|
299
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
300
300
|
yield response, operation if block_given?
|
301
301
|
return response
|
302
302
|
end
|
303
|
-
rescue GRPC::BadStatus => e
|
304
|
-
raise Google::Cloud::Error.from_error(e)
|
303
|
+
rescue ::GRPC::BadStatus => e
|
304
|
+
raise ::Google::Cloud::Error.from_error(e)
|
305
305
|
end
|
306
306
|
|
307
307
|
##
|
308
308
|
# Performs bidirectional streaming speech recognition: receive results while
|
309
309
|
# sending audio. This method is only available via the gRPC API (not REST).
|
310
310
|
#
|
311
|
-
# @param request [Gapic::StreamInput, Enumerable
|
312
|
-
# An enumerable of {Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances.
|
313
|
-
# @param options [Gapic::CallOptions, Hash]
|
311
|
+
# @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeRequest, ::Hash>]
|
312
|
+
# An enumerable of {::Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances.
|
313
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
314
314
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
315
315
|
#
|
316
316
|
# @yield [response, operation] Access the result along with the RPC operation
|
317
|
-
# @yieldparam response [Enumerable
|
318
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
317
|
+
# @yieldparam response [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>]
|
318
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
319
319
|
#
|
320
|
-
# @return [Enumerable
|
320
|
+
# @return [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>]
|
321
321
|
#
|
322
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
322
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
323
323
|
#
|
324
324
|
def streaming_recognize request, options = nil
|
325
|
-
unless request.is_a? Enumerable
|
326
|
-
raise ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
|
325
|
+
unless request.is_a? ::Enumerable
|
326
|
+
raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
|
327
327
|
request = request.to_enum
|
328
328
|
end
|
329
329
|
|
330
330
|
request = request.lazy.map do |req|
|
331
|
-
Gapic::Protobuf.coerce req, to: Google::Cloud::Speech::V1::StreamingRecognizeRequest
|
331
|
+
::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V1::StreamingRecognizeRequest
|
332
332
|
end
|
333
333
|
|
334
334
|
# Converts hash and nil to an options object
|
335
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
335
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
336
336
|
|
337
337
|
# Customize the options with defaults
|
338
338
|
metadata = @config.rpcs.streaming_recognize.metadata.to_h
|
339
339
|
|
340
340
|
# Set x-goog-api-client and x-goog-user-project headers
|
341
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
341
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
342
342
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
343
343
|
gapic_version: ::Google::Cloud::Speech::V1::VERSION
|
344
344
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -353,8 +353,8 @@ module Google
|
|
353
353
|
yield response, operation if block_given?
|
354
354
|
return response
|
355
355
|
end
|
356
|
-
rescue GRPC::BadStatus => e
|
357
|
-
raise Google::Cloud::Error.from_error(e)
|
356
|
+
rescue ::GRPC::BadStatus => e
|
357
|
+
raise ::Google::Cloud::Error.from_error(e)
|
358
358
|
end
|
359
359
|
|
360
360
|
##
|
@@ -364,7 +364,7 @@ module Google
|
|
364
364
|
# providing control over timeouts, retry behavior, logging, transport
|
365
365
|
# parameters, and other low-level controls. Certain parameters can also be
|
366
366
|
# applied individually to specific RPCs. See
|
367
|
-
# {Google::Cloud::Speech::V1::Speech::Client::Configuration::Rpcs}
|
367
|
+
# {::Google::Cloud::Speech::V1::Speech::Client::Configuration::Rpcs}
|
368
368
|
# for a list of RPCs that can be configured independently.
|
369
369
|
#
|
370
370
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -375,22 +375,22 @@ module Google
|
|
375
375
|
# To modify the global config, setting the timeout for recognize
|
376
376
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
377
377
|
#
|
378
|
-
# Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
379
|
-
# config.timeout =
|
380
|
-
# config.rpcs.recognize.timeout =
|
378
|
+
# ::Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
379
|
+
# config.timeout = 10.0
|
380
|
+
# config.rpcs.recognize.timeout = 20.0
|
381
381
|
# end
|
382
382
|
#
|
383
383
|
# To apply the above configuration only to a new client:
|
384
384
|
#
|
385
|
-
# client = Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
386
|
-
# config.timeout =
|
387
|
-
# config.rpcs.recognize.timeout =
|
385
|
+
# client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
386
|
+
# config.timeout = 10.0
|
387
|
+
# config.rpcs.recognize.timeout = 20.0
|
388
388
|
# end
|
389
389
|
#
|
390
390
|
# @!attribute [rw] endpoint
|
391
391
|
# The hostname or hostname:port of the service endpoint.
|
392
392
|
# Defaults to `"speech.googleapis.com"`.
|
393
|
-
# @return [String]
|
393
|
+
# @return [::String]
|
394
394
|
# @!attribute [rw] credentials
|
395
395
|
# Credentials to send with calls. You may provide any of the following types:
|
396
396
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -402,29 +402,29 @@ module Google
|
|
402
402
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
403
403
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
404
404
|
# * (`nil`) indicating no credentials
|
405
|
-
# @return [Object]
|
405
|
+
# @return [::Object]
|
406
406
|
# @!attribute [rw] scope
|
407
407
|
# The OAuth scopes
|
408
|
-
# @return [Array
|
408
|
+
# @return [::Array<::String>]
|
409
409
|
# @!attribute [rw] lib_name
|
410
410
|
# The library name as recorded in instrumentation and logging
|
411
|
-
# @return [String]
|
411
|
+
# @return [::String]
|
412
412
|
# @!attribute [rw] lib_version
|
413
413
|
# The library version as recorded in instrumentation and logging
|
414
|
-
# @return [String]
|
414
|
+
# @return [::String]
|
415
415
|
# @!attribute [rw] channel_args
|
416
416
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
417
417
|
# `GRPC::Core::Channel` object is provided as the credential.
|
418
|
-
# @return [Hash]
|
418
|
+
# @return [::Hash]
|
419
419
|
# @!attribute [rw] interceptors
|
420
420
|
# An array of interceptors that are run before calls are executed.
|
421
|
-
# @return [Array
|
421
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
422
422
|
# @!attribute [rw] timeout
|
423
|
-
# The call timeout in
|
424
|
-
# @return [Numeric]
|
423
|
+
# The call timeout in seconds.
|
424
|
+
# @return [::Numeric]
|
425
425
|
# @!attribute [rw] metadata
|
426
426
|
# Additional gRPC headers to be sent with the call.
|
427
|
-
# @return [Hash{Symbol
|
427
|
+
# @return [::Hash{::Symbol=>::String}]
|
428
428
|
# @!attribute [rw] retry_policy
|
429
429
|
# The retry policy. The value is a hash with the following keys:
|
430
430
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -432,10 +432,10 @@ module Google
|
|
432
432
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
433
433
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
434
434
|
# trigger a retry.
|
435
|
-
# @return [Hash]
|
435
|
+
# @return [::Hash]
|
436
436
|
#
|
437
437
|
class Configuration
|
438
|
-
extend Gapic::Config
|
438
|
+
extend ::Gapic::Config
|
439
439
|
|
440
440
|
config_attr :endpoint, "speech.googleapis.com", String
|
441
441
|
config_attr :credentials, nil do |value|
|
@@ -443,14 +443,14 @@ module Google
|
|
443
443
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
444
444
|
allowed.any? { |klass| klass === value }
|
445
445
|
end
|
446
|
-
config_attr :scope, nil, String, Array, nil
|
447
|
-
config_attr :lib_name, nil, String, nil
|
448
|
-
config_attr :lib_version, nil, String, nil
|
449
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
450
|
-
config_attr :interceptors, nil, Array, nil
|
451
|
-
config_attr :timeout, nil, Numeric, nil
|
452
|
-
config_attr :metadata, nil, Hash, nil
|
453
|
-
config_attr :retry_policy, nil, Hash, Proc, nil
|
446
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
447
|
+
config_attr :lib_name, nil, ::String, nil
|
448
|
+
config_attr :lib_version, nil, ::String, nil
|
449
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
450
|
+
config_attr :interceptors, nil, ::Array, nil
|
451
|
+
config_attr :timeout, nil, ::Numeric, nil
|
452
|
+
config_attr :metadata, nil, ::Hash, nil
|
453
|
+
config_attr :retry_policy, nil, ::Hash, Proc, nil
|
454
454
|
|
455
455
|
# @private
|
456
456
|
def initialize parent_config = nil
|
@@ -491,28 +491,28 @@ module Google
|
|
491
491
|
class Rpcs
|
492
492
|
##
|
493
493
|
# RPC-specific configuration for `recognize`
|
494
|
-
# @return [Gapic::Config::Method]
|
494
|
+
# @return [::Gapic::Config::Method]
|
495
495
|
#
|
496
496
|
attr_reader :recognize
|
497
497
|
##
|
498
498
|
# RPC-specific configuration for `long_running_recognize`
|
499
|
-
# @return [Gapic::Config::Method]
|
499
|
+
# @return [::Gapic::Config::Method]
|
500
500
|
#
|
501
501
|
attr_reader :long_running_recognize
|
502
502
|
##
|
503
503
|
# RPC-specific configuration for `streaming_recognize`
|
504
|
-
# @return [Gapic::Config::Method]
|
504
|
+
# @return [::Gapic::Config::Method]
|
505
505
|
#
|
506
506
|
attr_reader :streaming_recognize
|
507
507
|
|
508
508
|
# @private
|
509
509
|
def initialize parent_rpcs = nil
|
510
510
|
recognize_config = parent_rpcs&.recognize if parent_rpcs&.respond_to? :recognize
|
511
|
-
@recognize = Gapic::Config::Method.new recognize_config
|
511
|
+
@recognize = ::Gapic::Config::Method.new recognize_config
|
512
512
|
long_running_recognize_config = parent_rpcs&.long_running_recognize if parent_rpcs&.respond_to? :long_running_recognize
|
513
|
-
@long_running_recognize = Gapic::Config::Method.new long_running_recognize_config
|
513
|
+
@long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config
|
514
514
|
streaming_recognize_config = parent_rpcs&.streaming_recognize if parent_rpcs&.respond_to? :streaming_recognize
|
515
|
-
@streaming_recognize = Gapic::Config::Method.new streaming_recognize_config
|
515
|
+
@streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config
|
516
516
|
|
517
517
|
yield self if block_given?
|
518
518
|
end
|