google-cloud-speech-v1 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/speech/v1/adaptation/client.rb +29 -11
- data/lib/google/cloud/speech/v1/adaptation/rest/client.rb +29 -11
- data/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb +94 -62
- data/lib/google/cloud/speech/v1/speech/client.rb +28 -4
- data/lib/google/cloud/speech/v1/speech/operations.rb +12 -15
- data/lib/google/cloud/speech/v1/speech/rest/client.rb +28 -3
- data/lib/google/cloud/speech/v1/speech/rest/operations.rb +43 -38
- data/lib/google/cloud/speech/v1/speech/rest/service_stub.rb +30 -14
- data/lib/google/cloud/speech/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +70 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -176,8 +176,19 @@ module Google
|
|
176
176
|
universe_domain: @config.universe_domain,
|
177
177
|
channel_args: @config.channel_args,
|
178
178
|
interceptors: @config.interceptors,
|
179
|
-
channel_pool_config: @config.channel_pool
|
179
|
+
channel_pool_config: @config.channel_pool,
|
180
|
+
logger: @config.logger
|
180
181
|
)
|
182
|
+
|
183
|
+
@speech_stub.stub_logger&.info do |entry|
|
184
|
+
entry.set_system_name
|
185
|
+
entry.set_service
|
186
|
+
entry.message = "Created client for #{entry.service}"
|
187
|
+
entry.set_credentials_fields credentials
|
188
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
189
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
190
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
191
|
+
end
|
181
192
|
end
|
182
193
|
|
183
194
|
##
|
@@ -187,6 +198,15 @@ module Google
|
|
187
198
|
#
|
188
199
|
attr_reader :operations_client
|
189
200
|
|
201
|
+
##
|
202
|
+
# The logger used for request/response debug logging.
|
203
|
+
#
|
204
|
+
# @return [Logger]
|
205
|
+
#
|
206
|
+
def logger
|
207
|
+
@speech_stub.logger
|
208
|
+
end
|
209
|
+
|
190
210
|
# Service calls
|
191
211
|
|
192
212
|
##
|
@@ -265,7 +285,6 @@ module Google
|
|
265
285
|
|
266
286
|
@speech_stub.call_rpc :recognize, request, options: options do |response, operation|
|
267
287
|
yield response, operation if block_given?
|
268
|
-
return response
|
269
288
|
end
|
270
289
|
rescue ::GRPC::BadStatus => e
|
271
290
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -361,7 +380,7 @@ module Google
|
|
361
380
|
@speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation|
|
362
381
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
363
382
|
yield response, operation if block_given?
|
364
|
-
|
383
|
+
throw :response, response
|
365
384
|
end
|
366
385
|
rescue ::GRPC::BadStatus => e
|
367
386
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -441,7 +460,6 @@ module Google
|
|
441
460
|
|
442
461
|
@speech_stub.call_rpc :streaming_recognize, request, options: options do |response, operation|
|
443
462
|
yield response, operation if block_given?
|
444
|
-
return response
|
445
463
|
end
|
446
464
|
rescue ::GRPC::BadStatus => e
|
447
465
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -530,6 +548,11 @@ module Google
|
|
530
548
|
# default endpoint URL. The default value of nil uses the environment
|
531
549
|
# universe (usually the default "googleapis.com" universe).
|
532
550
|
# @return [::String,nil]
|
551
|
+
# @!attribute [rw] logger
|
552
|
+
# A custom logger to use for request/response debug logging, or the value
|
553
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
554
|
+
# explicitly disable logging.
|
555
|
+
# @return [::Logger,:default,nil]
|
533
556
|
#
|
534
557
|
class Configuration
|
535
558
|
extend ::Gapic::Config
|
@@ -554,6 +577,7 @@ module Google
|
|
554
577
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
555
578
|
config_attr :quota_project, nil, ::String, nil
|
556
579
|
config_attr :universe_domain, nil, ::String, nil
|
580
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
557
581
|
|
558
582
|
# @private
|
559
583
|
def initialize parent_config = nil
|
@@ -124,14 +124,6 @@ module Google
|
|
124
124
|
# Lists operations that match the specified filter in the request. If the
|
125
125
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
126
126
|
#
|
127
|
-
# NOTE: the `name` binding allows API services to override the binding
|
128
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
129
|
-
# override the binding, API services can add a binding such as
|
130
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
131
|
-
# For backwards compatibility, the default name includes the operations
|
132
|
-
# collection id, however overriding users must ensure the name binding
|
133
|
-
# is the parent resource, without the operations collection id.
|
134
|
-
#
|
135
127
|
# @overload list_operations(request, options = nil)
|
136
128
|
# Pass arguments to `list_operations` via a request object, either of type
|
137
129
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -213,7 +205,7 @@ module Google
|
|
213
205
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
214
206
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
215
207
|
yield response, operation if block_given?
|
216
|
-
|
208
|
+
throw :response, response
|
217
209
|
end
|
218
210
|
rescue ::GRPC::BadStatus => e
|
219
211
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -309,7 +301,7 @@ module Google
|
|
309
301
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
310
302
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
311
303
|
yield response, operation if block_given?
|
312
|
-
|
304
|
+
throw :response, response
|
313
305
|
end
|
314
306
|
rescue ::GRPC::BadStatus => e
|
315
307
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -398,7 +390,6 @@ module Google
|
|
398
390
|
|
399
391
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
400
392
|
yield response, operation if block_given?
|
401
|
-
return response
|
402
393
|
end
|
403
394
|
rescue ::GRPC::BadStatus => e
|
404
395
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -413,8 +404,9 @@ module Google
|
|
413
404
|
# other methods to check whether the cancellation succeeded or whether the
|
414
405
|
# operation completed despite cancellation. On successful cancellation,
|
415
406
|
# the operation is not deleted; instead, it becomes an operation with
|
416
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
417
|
-
# corresponding to
|
407
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
408
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
409
|
+
# `Code.CANCELLED`.
|
418
410
|
#
|
419
411
|
# @overload cancel_operation(request, options = nil)
|
420
412
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -493,7 +485,6 @@ module Google
|
|
493
485
|
|
494
486
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
495
487
|
yield response, operation if block_given?
|
496
|
-
return response
|
497
488
|
end
|
498
489
|
rescue ::GRPC::BadStatus => e
|
499
490
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -591,7 +582,7 @@ module Google
|
|
591
582
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
592
583
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
593
584
|
yield response, operation if block_given?
|
594
|
-
|
585
|
+
throw :response, response
|
595
586
|
end
|
596
587
|
rescue ::GRPC::BadStatus => e
|
597
588
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -680,6 +671,11 @@ module Google
|
|
680
671
|
# default endpoint URL. The default value of nil uses the environment
|
681
672
|
# universe (usually the default "googleapis.com" universe).
|
682
673
|
# @return [::String,nil]
|
674
|
+
# @!attribute [rw] logger
|
675
|
+
# A custom logger to use for request/response debug logging, or the value
|
676
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
677
|
+
# explicitly disable logging.
|
678
|
+
# @return [::Logger,:default,nil]
|
683
679
|
#
|
684
680
|
class Configuration
|
685
681
|
extend ::Gapic::Config
|
@@ -704,6 +700,7 @@ module Google
|
|
704
700
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
705
701
|
config_attr :quota_project, nil, ::String, nil
|
706
702
|
config_attr :universe_domain, nil, ::String, nil
|
703
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
707
704
|
|
708
705
|
# @private
|
709
706
|
def initialize parent_config = nil
|
@@ -164,8 +164,19 @@ module Google
|
|
164
164
|
endpoint: @config.endpoint,
|
165
165
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
166
166
|
universe_domain: @config.universe_domain,
|
167
|
-
credentials: credentials
|
167
|
+
credentials: credentials,
|
168
|
+
logger: @config.logger
|
168
169
|
)
|
170
|
+
|
171
|
+
@speech_stub.logger(stub: true)&.info do |entry|
|
172
|
+
entry.set_system_name
|
173
|
+
entry.set_service
|
174
|
+
entry.message = "Created client for #{entry.service}"
|
175
|
+
entry.set_credentials_fields credentials
|
176
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
177
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
178
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
179
|
+
end
|
169
180
|
end
|
170
181
|
|
171
182
|
##
|
@@ -175,6 +186,15 @@ module Google
|
|
175
186
|
#
|
176
187
|
attr_reader :operations_client
|
177
188
|
|
189
|
+
##
|
190
|
+
# The logger used for request/response debug logging.
|
191
|
+
#
|
192
|
+
# @return [Logger]
|
193
|
+
#
|
194
|
+
def logger
|
195
|
+
@speech_stub.logger
|
196
|
+
end
|
197
|
+
|
178
198
|
# Service calls
|
179
199
|
|
180
200
|
##
|
@@ -254,7 +274,6 @@ module Google
|
|
254
274
|
|
255
275
|
@speech_stub.recognize request, options do |result, operation|
|
256
276
|
yield result, operation if block_given?
|
257
|
-
return result
|
258
277
|
end
|
259
278
|
rescue ::Gapic::Rest::Error => e
|
260
279
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -351,7 +370,7 @@ module Google
|
|
351
370
|
@speech_stub.long_running_recognize request, options do |result, operation|
|
352
371
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
353
372
|
yield result, operation if block_given?
|
354
|
-
|
373
|
+
throw :response, result
|
355
374
|
end
|
356
375
|
rescue ::Gapic::Rest::Error => e
|
357
376
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -431,6 +450,11 @@ module Google
|
|
431
450
|
# default endpoint URL. The default value of nil uses the environment
|
432
451
|
# universe (usually the default "googleapis.com" universe).
|
433
452
|
# @return [::String,nil]
|
453
|
+
# @!attribute [rw] logger
|
454
|
+
# A custom logger to use for request/response debug logging, or the value
|
455
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
456
|
+
# explicitly disable logging.
|
457
|
+
# @return [::Logger,:default,nil]
|
434
458
|
#
|
435
459
|
class Configuration
|
436
460
|
extend ::Gapic::Config
|
@@ -452,6 +476,7 @@ module Google
|
|
452
476
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
453
477
|
config_attr :quota_project, nil, ::String, nil
|
454
478
|
config_attr :universe_domain, nil, ::String, nil
|
479
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
455
480
|
|
456
481
|
# @private
|
457
482
|
def initialize parent_config = nil
|
@@ -115,14 +115,6 @@ module Google
|
|
115
115
|
# Lists operations that match the specified filter in the request. If the
|
116
116
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
117
117
|
#
|
118
|
-
# NOTE: the `name` binding allows API services to override the binding
|
119
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
120
|
-
# override the binding, API services can add a binding such as
|
121
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
122
|
-
# For backwards compatibility, the default name includes the operations
|
123
|
-
# collection id, however overriding users must ensure the name binding
|
124
|
-
# is the parent resource, without the operations collection id.
|
125
|
-
#
|
126
118
|
# @overload list_operations(request, options = nil)
|
127
119
|
# Pass arguments to `list_operations` via a request object, either of type
|
128
120
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -204,7 +196,7 @@ module Google
|
|
204
196
|
@operations_stub.list_operations request, options do |result, operation|
|
205
197
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
206
198
|
yield result, operation if block_given?
|
207
|
-
|
199
|
+
throw :response, result
|
208
200
|
end
|
209
201
|
rescue ::Gapic::Rest::Error => e
|
210
202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -293,7 +285,7 @@ module Google
|
|
293
285
|
@operations_stub.get_operation request, options do |result, operation|
|
294
286
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
295
287
|
yield result, operation if block_given?
|
296
|
-
|
288
|
+
throw :response, result
|
297
289
|
end
|
298
290
|
rescue ::Gapic::Rest::Error => e
|
299
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -375,7 +367,6 @@ module Google
|
|
375
367
|
|
376
368
|
@operations_stub.delete_operation request, options do |result, operation|
|
377
369
|
yield result, operation if block_given?
|
378
|
-
return result
|
379
370
|
end
|
380
371
|
rescue ::Gapic::Rest::Error => e
|
381
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -390,8 +381,9 @@ module Google
|
|
390
381
|
# other methods to check whether the cancellation succeeded or whether the
|
391
382
|
# operation completed despite cancellation. On successful cancellation,
|
392
383
|
# the operation is not deleted; instead, it becomes an operation with
|
393
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
394
|
-
# corresponding to
|
384
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
385
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
386
|
+
# `Code.CANCELLED`.
|
395
387
|
#
|
396
388
|
# @overload cancel_operation(request, options = nil)
|
397
389
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -463,7 +455,6 @@ module Google
|
|
463
455
|
|
464
456
|
@operations_stub.cancel_operation request, options do |result, operation|
|
465
457
|
yield result, operation if block_given?
|
466
|
-
return result
|
467
458
|
end
|
468
459
|
rescue ::Gapic::Rest::Error => e
|
469
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -543,6 +534,11 @@ module Google
|
|
543
534
|
# default endpoint URL. The default value of nil uses the environment
|
544
535
|
# universe (usually the default "googleapis.com" universe).
|
545
536
|
# @return [::String,nil]
|
537
|
+
# @!attribute [rw] logger
|
538
|
+
# A custom logger to use for request/response debug logging, or the value
|
539
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
540
|
+
# explicitly disable logging.
|
541
|
+
# @return [::Logger,:default,nil]
|
546
542
|
#
|
547
543
|
class Configuration
|
548
544
|
extend ::Gapic::Config
|
@@ -564,6 +560,7 @@ module Google
|
|
564
560
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
565
561
|
config_attr :quota_project, nil, ::String, nil
|
566
562
|
config_attr :universe_domain, nil, ::String, nil
|
563
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
567
564
|
|
568
565
|
# @private
|
569
566
|
def initialize parent_config = nil
|
@@ -683,16 +680,18 @@ module Google
|
|
683
680
|
|
684
681
|
response = @client_stub.make_http_request(
|
685
682
|
verb,
|
686
|
-
uri:
|
687
|
-
body:
|
688
|
-
params:
|
683
|
+
uri: uri,
|
684
|
+
body: body || "",
|
685
|
+
params: query_string_params,
|
686
|
+
method_name: "list_operations",
|
689
687
|
options: options
|
690
688
|
)
|
691
689
|
operation = ::Gapic::Rest::TransportOperation.new response
|
692
690
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
693
|
-
|
694
|
-
|
695
|
-
|
691
|
+
catch :response do
|
692
|
+
yield result, operation if block_given?
|
693
|
+
result
|
694
|
+
end
|
696
695
|
end
|
697
696
|
|
698
697
|
##
|
@@ -721,16 +720,18 @@ module Google
|
|
721
720
|
|
722
721
|
response = @client_stub.make_http_request(
|
723
722
|
verb,
|
724
|
-
uri:
|
725
|
-
body:
|
726
|
-
params:
|
723
|
+
uri: uri,
|
724
|
+
body: body || "",
|
725
|
+
params: query_string_params,
|
726
|
+
method_name: "get_operation",
|
727
727
|
options: options
|
728
728
|
)
|
729
729
|
operation = ::Gapic::Rest::TransportOperation.new response
|
730
730
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
731
|
-
|
732
|
-
|
733
|
-
|
731
|
+
catch :response do
|
732
|
+
yield result, operation if block_given?
|
733
|
+
result
|
734
|
+
end
|
734
735
|
end
|
735
736
|
|
736
737
|
##
|
@@ -759,16 +760,18 @@ module Google
|
|
759
760
|
|
760
761
|
response = @client_stub.make_http_request(
|
761
762
|
verb,
|
762
|
-
uri:
|
763
|
-
body:
|
764
|
-
params:
|
763
|
+
uri: uri,
|
764
|
+
body: body || "",
|
765
|
+
params: query_string_params,
|
766
|
+
method_name: "delete_operation",
|
765
767
|
options: options
|
766
768
|
)
|
767
769
|
operation = ::Gapic::Rest::TransportOperation.new response
|
768
770
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
769
|
-
|
770
|
-
|
771
|
-
|
771
|
+
catch :response do
|
772
|
+
yield result, operation if block_given?
|
773
|
+
result
|
774
|
+
end
|
772
775
|
end
|
773
776
|
|
774
777
|
##
|
@@ -797,16 +800,18 @@ module Google
|
|
797
800
|
|
798
801
|
response = @client_stub.make_http_request(
|
799
802
|
verb,
|
800
|
-
uri:
|
801
|
-
body:
|
802
|
-
params:
|
803
|
+
uri: uri,
|
804
|
+
body: body || "",
|
805
|
+
params: query_string_params,
|
806
|
+
method_name: "cancel_operation",
|
803
807
|
options: options
|
804
808
|
)
|
805
809
|
operation = ::Gapic::Rest::TransportOperation.new response
|
806
810
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
807
|
-
|
808
|
-
|
809
|
-
|
811
|
+
catch :response do
|
812
|
+
yield result, operation if block_given?
|
813
|
+
result
|
814
|
+
end
|
810
815
|
end
|
811
816
|
|
812
817
|
##
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
|
33
|
+
# @private
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
34
35
|
# These require statements are intentionally placed here to initialize
|
35
36
|
# the REST modules only when it's required.
|
36
37
|
require "gapic/rest"
|
@@ -40,7 +41,9 @@ module Google
|
|
40
41
|
universe_domain: universe_domain,
|
41
42
|
credentials: credentials,
|
42
43
|
numeric_enums: true,
|
43
|
-
|
44
|
+
service_name: self.class,
|
45
|
+
raise_faraday_errors: false,
|
46
|
+
logger: logger
|
44
47
|
end
|
45
48
|
|
46
49
|
##
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@client_stub.endpoint
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The logger used for request/response debug logging.
|
69
|
+
#
|
70
|
+
# @return [Logger]
|
71
|
+
#
|
72
|
+
def logger stub: false
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Baseline implementation for the recognize REST call
|
66
78
|
#
|
@@ -87,16 +99,18 @@ module Google
|
|
87
99
|
|
88
100
|
response = @client_stub.make_http_request(
|
89
101
|
verb,
|
90
|
-
uri:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "recognize",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Speech::V1::RecognizeResponse.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -125,16 +139,18 @@ module Google
|
|
125
139
|
|
126
140
|
response = @client_stub.make_http_request(
|
127
141
|
verb,
|
128
|
-
uri:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "long_running_recognize",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -28,6 +28,9 @@ module Google
|
|
28
28
|
# @!attribute [rw] destinations
|
29
29
|
# @return [::Array<::Google::Api::ClientLibraryDestination>]
|
30
30
|
# The destination where API teams want this client library to be published.
|
31
|
+
# @!attribute [rw] selective_gapic_generation
|
32
|
+
# @return [::Google::Api::SelectiveGapicGeneration]
|
33
|
+
# Configuration for which RPCs should be generated in the GAPIC client.
|
31
34
|
class CommonLanguageSettings
|
32
35
|
include ::Google::Protobuf::MessageExts
|
33
36
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -196,9 +199,32 @@ module Google
|
|
196
199
|
# @!attribute [rw] common
|
197
200
|
# @return [::Google::Api::CommonLanguageSettings]
|
198
201
|
# Some settings.
|
202
|
+
# @!attribute [rw] experimental_features
|
203
|
+
# @return [::Google::Api::PythonSettings::ExperimentalFeatures]
|
204
|
+
# Experimental features to be included during client library generation.
|
199
205
|
class PythonSettings
|
200
206
|
include ::Google::Protobuf::MessageExts
|
201
207
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
208
|
+
|
209
|
+
# Experimental features to be included during client library generation.
|
210
|
+
# These fields will be deprecated once the feature graduates and is enabled
|
211
|
+
# by default.
|
212
|
+
# @!attribute [rw] rest_async_io_enabled
|
213
|
+
# @return [::Boolean]
|
214
|
+
# Enables generation of asynchronous REST clients if `rest` transport is
|
215
|
+
# enabled. By default, asynchronous REST clients will not be generated.
|
216
|
+
# This feature will be enabled by default 1 month after launching the
|
217
|
+
# feature in preview packages.
|
218
|
+
# @!attribute [rw] protobuf_pythonic_types_enabled
|
219
|
+
# @return [::Boolean]
|
220
|
+
# Enables generation of protobuf code using new types that are more
|
221
|
+
# Pythonic which are included in `protobuf>=5.29.x`. This feature will be
|
222
|
+
# enabled by default 1 month after launching the feature in preview
|
223
|
+
# packages.
|
224
|
+
class ExperimentalFeatures
|
225
|
+
include ::Google::Protobuf::MessageExts
|
226
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
227
|
+
end
|
202
228
|
end
|
203
229
|
|
204
230
|
# Settings for Node client libraries.
|
@@ -280,9 +306,28 @@ module Google
|
|
280
306
|
# @!attribute [rw] common
|
281
307
|
# @return [::Google::Api::CommonLanguageSettings]
|
282
308
|
# Some settings.
|
309
|
+
# @!attribute [rw] renamed_services
|
310
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
311
|
+
# Map of service names to renamed services. Keys are the package relative
|
312
|
+
# service names and values are the name to be used for the service client
|
313
|
+
# and call options.
|
314
|
+
#
|
315
|
+
# publishing:
|
316
|
+
# go_settings:
|
317
|
+
# renamed_services:
|
318
|
+
# Publisher: TopicAdmin
|
283
319
|
class GoSettings
|
284
320
|
include ::Google::Protobuf::MessageExts
|
285
321
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
322
|
+
|
323
|
+
# @!attribute [rw] key
|
324
|
+
# @return [::String]
|
325
|
+
# @!attribute [rw] value
|
326
|
+
# @return [::String]
|
327
|
+
class RenamedServicesEntry
|
328
|
+
include ::Google::Protobuf::MessageExts
|
329
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
330
|
+
end
|
286
331
|
end
|
287
332
|
|
288
333
|
# Describes the generator configuration for a method.
|
@@ -290,6 +335,13 @@ module Google
|
|
290
335
|
# @return [::String]
|
291
336
|
# The fully qualified name of the method, for which the options below apply.
|
292
337
|
# This is used to find the method to apply the options.
|
338
|
+
#
|
339
|
+
# Example:
|
340
|
+
#
|
341
|
+
# publishing:
|
342
|
+
# method_settings:
|
343
|
+
# - selector: google.storage.control.v2.StorageControl.CreateFolder
|
344
|
+
# # method settings for CreateFolder...
|
293
345
|
# @!attribute [rw] long_running
|
294
346
|
# @return [::Google::Api::MethodSettings::LongRunning]
|
295
347
|
# Describes settings to use for long-running operations when generating
|
@@ -298,17 +350,14 @@ module Google
|
|
298
350
|
#
|
299
351
|
# Example of a YAML configuration::
|
300
352
|
#
|
301
|
-
#
|
302
|
-
#
|
353
|
+
# publishing:
|
354
|
+
# method_settings:
|
303
355
|
# - selector: google.cloud.speech.v2.Speech.BatchRecognize
|
304
356
|
# long_running:
|
305
|
-
# initial_poll_delay:
|
306
|
-
# seconds: 60 # 1 minute
|
357
|
+
# initial_poll_delay: 60s # 1 minute
|
307
358
|
# poll_delay_multiplier: 1.5
|
308
|
-
# max_poll_delay:
|
309
|
-
#
|
310
|
-
# total_poll_timeout:
|
311
|
-
# seconds: 54000 # 90 minutes
|
359
|
+
# max_poll_delay: 360s # 6 minutes
|
360
|
+
# total_poll_timeout: 54000s # 90 minutes
|
312
361
|
# @!attribute [rw] auto_populated_fields
|
313
362
|
# @return [::Array<::String>]
|
314
363
|
# List of top-level fields of the request message, that should be
|
@@ -317,8 +366,8 @@ module Google
|
|
317
366
|
#
|
318
367
|
# Example of a YAML configuration:
|
319
368
|
#
|
320
|
-
#
|
321
|
-
#
|
369
|
+
# publishing:
|
370
|
+
# method_settings:
|
322
371
|
# - selector: google.example.v1.ExampleService.CreateExample
|
323
372
|
# auto_populated_fields:
|
324
373
|
# - request_id
|
@@ -354,6 +403,17 @@ module Google
|
|
354
403
|
end
|
355
404
|
end
|
356
405
|
|
406
|
+
# This message is used to configure the generation of a subset of the RPCs in
|
407
|
+
# a service for client libraries.
|
408
|
+
# @!attribute [rw] methods
|
409
|
+
# @return [::Array<::String>]
|
410
|
+
# An allowlist of the fully qualified names of RPCs that should be included
|
411
|
+
# on public client surfaces.
|
412
|
+
class SelectiveGapicGeneration
|
413
|
+
include ::Google::Protobuf::MessageExts
|
414
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
415
|
+
end
|
416
|
+
|
357
417
|
# The organization for which the client libraries are being published.
|
358
418
|
# Affects the url where generated docs are published, etc.
|
359
419
|
module ClientLibraryOrganization
|
@@ -124,8 +124,13 @@ module Google
|
|
124
124
|
# @return [::String]
|
125
125
|
# The plural name used in the resource name and permission names, such as
|
126
126
|
# 'projects' for the resource name of 'projects/\\{project}' and the permission
|
127
|
-
# name of 'cloudresourcemanager.googleapis.com/projects.get'.
|
128
|
-
#
|
127
|
+
# name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
|
128
|
+
# to this is for Nested Collections that have stuttering names, as defined
|
129
|
+
# in [AIP-122](https://google.aip.dev/122#nested-collections), where the
|
130
|
+
# collection ID in the resource name pattern does not necessarily directly
|
131
|
+
# match the `plural` value.
|
132
|
+
#
|
133
|
+
# It is the same concept of the `plural` field in k8s CRD spec
|
129
134
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
130
135
|
#
|
131
136
|
# Note: The plural form is required even for singleton resources. See
|