google-cloud-automl-v1beta1 0.11.1 → 0.13.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 +4 -4
- data/README.md +31 -21
- data/lib/google/cloud/automl/v1beta1/automl/client.rb +52 -25
- data/lib/google/cloud/automl/v1beta1/automl/operations.rb +19 -15
- data/lib/google/cloud/automl/v1beta1/automl/rest/client.rb +52 -25
- data/lib/google/cloud/automl/v1beta1/automl/rest/operations.rb +59 -45
- data/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb +206 -146
- data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +35 -3
- data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +19 -15
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb +35 -3
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/operations.rb +59 -45
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/automl/v1beta1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/automl/v1beta1/annotation_payload.rb +16 -0
- data/proto_docs/google/cloud/automl/v1beta1/data_items.rb +12 -0
- data/proto_docs/google/cloud/automl/v1beta1/data_stats.rb +12 -0
- data/proto_docs/google/cloud/automl/v1beta1/data_types.rb +6 -0
- data/proto_docs/google/cloud/automl/v1beta1/dataset.rb +18 -0
- data/proto_docs/google/cloud/automl/v1beta1/io.rb +20 -0
- data/proto_docs/google/cloud/automl/v1beta1/model.rb +18 -0
- data/proto_docs/google/cloud/automl/v1beta1/model_evaluation.rb +14 -0
- data/proto_docs/google/cloud/automl/v1beta1/operations.rb +26 -0
- data/proto_docs/google/cloud/automl/v1beta1/service.rb +4 -0
- data/proto_docs/google/cloud/automl/v1beta1/tables.rb +4 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- data/proto_docs/google/protobuf/struct.rb +12 -0
- metadata +6 -9
@@ -171,8 +171,19 @@ module Google
|
|
171
171
|
universe_domain: @config.universe_domain,
|
172
172
|
channel_args: @config.channel_args,
|
173
173
|
interceptors: @config.interceptors,
|
174
|
-
channel_pool_config: @config.channel_pool
|
174
|
+
channel_pool_config: @config.channel_pool,
|
175
|
+
logger: @config.logger
|
175
176
|
)
|
177
|
+
|
178
|
+
@prediction_service_stub.stub_logger&.info do |entry|
|
179
|
+
entry.set_system_name
|
180
|
+
entry.set_service
|
181
|
+
entry.message = "Created client for #{entry.service}"
|
182
|
+
entry.set_credentials_fields credentials
|
183
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
184
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
185
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
186
|
+
end
|
176
187
|
end
|
177
188
|
|
178
189
|
##
|
@@ -182,6 +193,15 @@ module Google
|
|
182
193
|
#
|
183
194
|
attr_reader :operations_client
|
184
195
|
|
196
|
+
##
|
197
|
+
# The logger used for request/response debug logging.
|
198
|
+
#
|
199
|
+
# @return [Logger]
|
200
|
+
#
|
201
|
+
def logger
|
202
|
+
@prediction_service_stub.logger
|
203
|
+
end
|
204
|
+
|
185
205
|
# Service calls
|
186
206
|
|
187
207
|
##
|
@@ -306,7 +326,6 @@ module Google
|
|
306
326
|
|
307
327
|
@prediction_service_stub.call_rpc :predict, request, options: options do |response, operation|
|
308
328
|
yield response, operation if block_given?
|
309
|
-
return response
|
310
329
|
end
|
311
330
|
rescue ::GRPC::BadStatus => e
|
312
331
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -487,7 +506,7 @@ module Google
|
|
487
506
|
@prediction_service_stub.call_rpc :batch_predict, request, options: options do |response, operation|
|
488
507
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
489
508
|
yield response, operation if block_given?
|
490
|
-
|
509
|
+
throw :response, response
|
491
510
|
end
|
492
511
|
rescue ::GRPC::BadStatus => e
|
493
512
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -537,6 +556,13 @@ module Google
|
|
537
556
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
538
557
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
539
558
|
# * (`nil`) indicating no credentials
|
559
|
+
#
|
560
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
561
|
+
# external source for authentication to Google Cloud, you must validate it before
|
562
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
563
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
564
|
+
# For more information, refer to [Validate credential configurations from external
|
565
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
540
566
|
# @return [::Object]
|
541
567
|
# @!attribute [rw] scope
|
542
568
|
# The OAuth scopes
|
@@ -576,6 +602,11 @@ module Google
|
|
576
602
|
# default endpoint URL. The default value of nil uses the environment
|
577
603
|
# universe (usually the default "googleapis.com" universe).
|
578
604
|
# @return [::String,nil]
|
605
|
+
# @!attribute [rw] logger
|
606
|
+
# A custom logger to use for request/response debug logging, or the value
|
607
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
608
|
+
# explicitly disable logging.
|
609
|
+
# @return [::Logger,:default,nil]
|
579
610
|
#
|
580
611
|
class Configuration
|
581
612
|
extend ::Gapic::Config
|
@@ -600,6 +631,7 @@ module Google
|
|
600
631
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
601
632
|
config_attr :quota_project, nil, ::String, nil
|
602
633
|
config_attr :universe_domain, nil, ::String, nil
|
634
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
603
635
|
|
604
636
|
# @private
|
605
637
|
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.
|
@@ -221,7 +213,7 @@ module Google
|
|
221
213
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
222
214
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
223
215
|
yield response, operation if block_given?
|
224
|
-
|
216
|
+
throw :response, response
|
225
217
|
end
|
226
218
|
rescue ::GRPC::BadStatus => e
|
227
219
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -317,7 +309,7 @@ module Google
|
|
317
309
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
318
310
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
319
311
|
yield response, operation if block_given?
|
320
|
-
|
312
|
+
throw :response, response
|
321
313
|
end
|
322
314
|
rescue ::GRPC::BadStatus => e
|
323
315
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -406,7 +398,6 @@ module Google
|
|
406
398
|
|
407
399
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
408
400
|
yield response, operation if block_given?
|
409
|
-
return response
|
410
401
|
end
|
411
402
|
rescue ::GRPC::BadStatus => e
|
412
403
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -421,8 +412,9 @@ module Google
|
|
421
412
|
# other methods to check whether the cancellation succeeded or whether the
|
422
413
|
# operation completed despite cancellation. On successful cancellation,
|
423
414
|
# the operation is not deleted; instead, it becomes an operation with
|
424
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
425
|
-
# corresponding to
|
415
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
416
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
417
|
+
# `Code.CANCELLED`.
|
426
418
|
#
|
427
419
|
# @overload cancel_operation(request, options = nil)
|
428
420
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -501,7 +493,6 @@ module Google
|
|
501
493
|
|
502
494
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
503
495
|
yield response, operation if block_given?
|
504
|
-
return response
|
505
496
|
end
|
506
497
|
rescue ::GRPC::BadStatus => e
|
507
498
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -607,7 +598,7 @@ module Google
|
|
607
598
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
608
599
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
609
600
|
yield response, operation if block_given?
|
610
|
-
|
601
|
+
throw :response, response
|
611
602
|
end
|
612
603
|
rescue ::GRPC::BadStatus => e
|
613
604
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -657,6 +648,13 @@ module Google
|
|
657
648
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
658
649
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
659
650
|
# * (`nil`) indicating no credentials
|
651
|
+
#
|
652
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
653
|
+
# external source for authentication to Google Cloud, you must validate it before
|
654
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
655
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
656
|
+
# For more information, refer to [Validate credential configurations from external
|
657
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
660
658
|
# @return [::Object]
|
661
659
|
# @!attribute [rw] scope
|
662
660
|
# The OAuth scopes
|
@@ -696,6 +694,11 @@ module Google
|
|
696
694
|
# default endpoint URL. The default value of nil uses the environment
|
697
695
|
# universe (usually the default "googleapis.com" universe).
|
698
696
|
# @return [::String,nil]
|
697
|
+
# @!attribute [rw] logger
|
698
|
+
# A custom logger to use for request/response debug logging, or the value
|
699
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
700
|
+
# explicitly disable logging.
|
701
|
+
# @return [::Logger,:default,nil]
|
699
702
|
#
|
700
703
|
class Configuration
|
701
704
|
extend ::Gapic::Config
|
@@ -720,6 +723,7 @@ module Google
|
|
720
723
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
721
724
|
config_attr :quota_project, nil, ::String, nil
|
722
725
|
config_attr :universe_domain, nil, ::String, nil
|
726
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
723
727
|
|
724
728
|
# @private
|
725
729
|
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
|
+
@prediction_service_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
|
+
@prediction_service_stub.logger
|
196
|
+
end
|
197
|
+
|
178
198
|
# Service calls
|
179
199
|
|
180
200
|
##
|
@@ -292,7 +312,6 @@ module Google
|
|
292
312
|
|
293
313
|
@prediction_service_stub.predict request, options do |result, operation|
|
294
314
|
yield result, operation if block_given?
|
295
|
-
return result
|
296
315
|
end
|
297
316
|
rescue ::Gapic::Rest::Error => e
|
298
317
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -466,7 +485,7 @@ module Google
|
|
466
485
|
@prediction_service_stub.batch_predict request, options do |result, operation|
|
467
486
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
468
487
|
yield result, operation if block_given?
|
469
|
-
|
488
|
+
throw :response, result
|
470
489
|
end
|
471
490
|
rescue ::Gapic::Rest::Error => e
|
472
491
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -514,6 +533,13 @@ module Google
|
|
514
533
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
515
534
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
516
535
|
# * (`nil`) indicating no credentials
|
536
|
+
#
|
537
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
538
|
+
# external source for authentication to Google Cloud, you must validate it before
|
539
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
540
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
541
|
+
# For more information, refer to [Validate credential configurations from external
|
542
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
517
543
|
# @return [::Object]
|
518
544
|
# @!attribute [rw] scope
|
519
545
|
# The OAuth scopes
|
@@ -546,6 +572,11 @@ module Google
|
|
546
572
|
# default endpoint URL. The default value of nil uses the environment
|
547
573
|
# universe (usually the default "googleapis.com" universe).
|
548
574
|
# @return [::String,nil]
|
575
|
+
# @!attribute [rw] logger
|
576
|
+
# A custom logger to use for request/response debug logging, or the value
|
577
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
578
|
+
# explicitly disable logging.
|
579
|
+
# @return [::Logger,:default,nil]
|
549
580
|
#
|
550
581
|
class Configuration
|
551
582
|
extend ::Gapic::Config
|
@@ -567,6 +598,7 @@ module Google
|
|
567
598
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
568
599
|
config_attr :quota_project, nil, ::String, nil
|
569
600
|
config_attr :universe_domain, nil, ::String, nil
|
601
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
570
602
|
|
571
603
|
# @private
|
572
604
|
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)
|
@@ -562,7 +553,7 @@ module Google
|
|
562
553
|
@operations_stub.wait_operation request, options do |result, operation|
|
563
554
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
564
555
|
yield result, operation if block_given?
|
565
|
-
|
556
|
+
throw :response, result
|
566
557
|
end
|
567
558
|
rescue ::Gapic::Rest::Error => e
|
568
559
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -610,6 +601,13 @@ module Google
|
|
610
601
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
611
602
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
612
603
|
# * (`nil`) indicating no credentials
|
604
|
+
#
|
605
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
606
|
+
# external source for authentication to Google Cloud, you must validate it before
|
607
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
608
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
609
|
+
# For more information, refer to [Validate credential configurations from external
|
610
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
613
611
|
# @return [::Object]
|
614
612
|
# @!attribute [rw] scope
|
615
613
|
# The OAuth scopes
|
@@ -642,6 +640,11 @@ module Google
|
|
642
640
|
# default endpoint URL. The default value of nil uses the environment
|
643
641
|
# universe (usually the default "googleapis.com" universe).
|
644
642
|
# @return [::String,nil]
|
643
|
+
# @!attribute [rw] logger
|
644
|
+
# A custom logger to use for request/response debug logging, or the value
|
645
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
646
|
+
# explicitly disable logging.
|
647
|
+
# @return [::Logger,:default,nil]
|
645
648
|
#
|
646
649
|
class Configuration
|
647
650
|
extend ::Gapic::Config
|
@@ -663,6 +666,7 @@ module Google
|
|
663
666
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
664
667
|
config_attr :quota_project, nil, ::String, nil
|
665
668
|
config_attr :universe_domain, nil, ::String, nil
|
669
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
666
670
|
|
667
671
|
# @private
|
668
672
|
def initialize parent_config = nil
|
@@ -789,16 +793,18 @@ module Google
|
|
789
793
|
|
790
794
|
response = @client_stub.make_http_request(
|
791
795
|
verb,
|
792
|
-
uri:
|
793
|
-
body:
|
794
|
-
params:
|
796
|
+
uri: uri,
|
797
|
+
body: body || "",
|
798
|
+
params: query_string_params,
|
799
|
+
method_name: "list_operations",
|
795
800
|
options: options
|
796
801
|
)
|
797
802
|
operation = ::Gapic::Rest::TransportOperation.new response
|
798
803
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
799
|
-
|
800
|
-
|
801
|
-
|
804
|
+
catch :response do
|
805
|
+
yield result, operation if block_given?
|
806
|
+
result
|
807
|
+
end
|
802
808
|
end
|
803
809
|
|
804
810
|
##
|
@@ -827,16 +833,18 @@ module Google
|
|
827
833
|
|
828
834
|
response = @client_stub.make_http_request(
|
829
835
|
verb,
|
830
|
-
uri:
|
831
|
-
body:
|
832
|
-
params:
|
836
|
+
uri: uri,
|
837
|
+
body: body || "",
|
838
|
+
params: query_string_params,
|
839
|
+
method_name: "get_operation",
|
833
840
|
options: options
|
834
841
|
)
|
835
842
|
operation = ::Gapic::Rest::TransportOperation.new response
|
836
843
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
837
|
-
|
838
|
-
|
839
|
-
|
844
|
+
catch :response do
|
845
|
+
yield result, operation if block_given?
|
846
|
+
result
|
847
|
+
end
|
840
848
|
end
|
841
849
|
|
842
850
|
##
|
@@ -865,16 +873,18 @@ module Google
|
|
865
873
|
|
866
874
|
response = @client_stub.make_http_request(
|
867
875
|
verb,
|
868
|
-
uri:
|
869
|
-
body:
|
870
|
-
params:
|
876
|
+
uri: uri,
|
877
|
+
body: body || "",
|
878
|
+
params: query_string_params,
|
879
|
+
method_name: "delete_operation",
|
871
880
|
options: options
|
872
881
|
)
|
873
882
|
operation = ::Gapic::Rest::TransportOperation.new response
|
874
883
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
875
|
-
|
876
|
-
|
877
|
-
|
884
|
+
catch :response do
|
885
|
+
yield result, operation if block_given?
|
886
|
+
result
|
887
|
+
end
|
878
888
|
end
|
879
889
|
|
880
890
|
##
|
@@ -903,16 +913,18 @@ module Google
|
|
903
913
|
|
904
914
|
response = @client_stub.make_http_request(
|
905
915
|
verb,
|
906
|
-
uri:
|
907
|
-
body:
|
908
|
-
params:
|
916
|
+
uri: uri,
|
917
|
+
body: body || "",
|
918
|
+
params: query_string_params,
|
919
|
+
method_name: "cancel_operation",
|
909
920
|
options: options
|
910
921
|
)
|
911
922
|
operation = ::Gapic::Rest::TransportOperation.new response
|
912
923
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
913
|
-
|
914
|
-
|
915
|
-
|
924
|
+
catch :response do
|
925
|
+
yield result, operation if block_given?
|
926
|
+
result
|
927
|
+
end
|
916
928
|
end
|
917
929
|
|
918
930
|
##
|
@@ -941,16 +953,18 @@ module Google
|
|
941
953
|
|
942
954
|
response = @client_stub.make_http_request(
|
943
955
|
verb,
|
944
|
-
uri:
|
945
|
-
body:
|
946
|
-
params:
|
956
|
+
uri: uri,
|
957
|
+
body: body || "",
|
958
|
+
params: query_string_params,
|
959
|
+
method_name: "wait_operation",
|
947
960
|
options: options
|
948
961
|
)
|
949
962
|
operation = ::Gapic::Rest::TransportOperation.new response
|
950
963
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
951
|
-
|
952
|
-
|
953
|
-
|
964
|
+
catch :response do
|
965
|
+
yield result, operation if block_given?
|
966
|
+
result
|
967
|
+
end
|
954
968
|
end
|
955
969
|
|
956
970
|
##
|
@@ -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 predict 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: "predict",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::AutoML::V1beta1::PredictResponse.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: "batch_predict",
|
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
|
@@ -212,6 +215,12 @@ module Google
|
|
212
215
|
# enabled. By default, asynchronous REST clients will not be generated.
|
213
216
|
# This feature will be enabled by default 1 month after launching the
|
214
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.
|
215
224
|
class ExperimentalFeatures
|
216
225
|
include ::Google::Protobuf::MessageExts
|
217
226
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -297,9 +306,28 @@ module Google
|
|
297
306
|
# @!attribute [rw] common
|
298
307
|
# @return [::Google::Api::CommonLanguageSettings]
|
299
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
|
300
319
|
class GoSettings
|
301
320
|
include ::Google::Protobuf::MessageExts
|
302
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
|
303
331
|
end
|
304
332
|
|
305
333
|
# Describes the generator configuration for a method.
|
@@ -375,6 +403,17 @@ module Google
|
|
375
403
|
end
|
376
404
|
end
|
377
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
|
+
|
378
417
|
# The organization for which the client libraries are being published.
|
379
418
|
# Affects the url where generated docs are published, etc.
|
380
419
|
module ClientLibraryOrganization
|