google-cloud-automl-v1beta1 0.11.1 → 0.12.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/automl/v1beta1/automl/client.rb +41 -25
- data/lib/google/cloud/automl/v1beta1/automl/operations.rb +12 -15
- data/lib/google/cloud/automl/v1beta1/automl/rest/client.rb +41 -25
- data/lib/google/cloud/automl/v1beta1/automl/rest/operations.rb +52 -45
- data/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb +206 -146
- data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +28 -3
- data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +12 -15
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb +28 -3
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/operations.rb +52 -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/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -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)
|
@@ -576,6 +595,11 @@ module Google
|
|
576
595
|
# default endpoint URL. The default value of nil uses the environment
|
577
596
|
# universe (usually the default "googleapis.com" universe).
|
578
597
|
# @return [::String,nil]
|
598
|
+
# @!attribute [rw] logger
|
599
|
+
# A custom logger to use for request/response debug logging, or the value
|
600
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
601
|
+
# explicitly disable logging.
|
602
|
+
# @return [::Logger,:default,nil]
|
579
603
|
#
|
580
604
|
class Configuration
|
581
605
|
extend ::Gapic::Config
|
@@ -600,6 +624,7 @@ module Google
|
|
600
624
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
601
625
|
config_attr :quota_project, nil, ::String, nil
|
602
626
|
config_attr :universe_domain, nil, ::String, nil
|
627
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
603
628
|
|
604
629
|
# @private
|
605
630
|
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)
|
@@ -696,6 +687,11 @@ module Google
|
|
696
687
|
# default endpoint URL. The default value of nil uses the environment
|
697
688
|
# universe (usually the default "googleapis.com" universe).
|
698
689
|
# @return [::String,nil]
|
690
|
+
# @!attribute [rw] logger
|
691
|
+
# A custom logger to use for request/response debug logging, or the value
|
692
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
693
|
+
# explicitly disable logging.
|
694
|
+
# @return [::Logger,:default,nil]
|
699
695
|
#
|
700
696
|
class Configuration
|
701
697
|
extend ::Gapic::Config
|
@@ -720,6 +716,7 @@ module Google
|
|
720
716
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
721
717
|
config_attr :quota_project, nil, ::String, nil
|
722
718
|
config_attr :universe_domain, nil, ::String, nil
|
719
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
723
720
|
|
724
721
|
# @private
|
725
722
|
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)
|
@@ -546,6 +565,11 @@ module Google
|
|
546
565
|
# default endpoint URL. The default value of nil uses the environment
|
547
566
|
# universe (usually the default "googleapis.com" universe).
|
548
567
|
# @return [::String,nil]
|
568
|
+
# @!attribute [rw] logger
|
569
|
+
# A custom logger to use for request/response debug logging, or the value
|
570
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
571
|
+
# explicitly disable logging.
|
572
|
+
# @return [::Logger,:default,nil]
|
549
573
|
#
|
550
574
|
class Configuration
|
551
575
|
extend ::Gapic::Config
|
@@ -567,6 +591,7 @@ module Google
|
|
567
591
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
568
592
|
config_attr :quota_project, nil, ::String, nil
|
569
593
|
config_attr :universe_domain, nil, ::String, nil
|
594
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
570
595
|
|
571
596
|
# @private
|
572
597
|
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)
|
@@ -642,6 +633,11 @@ module Google
|
|
642
633
|
# default endpoint URL. The default value of nil uses the environment
|
643
634
|
# universe (usually the default "googleapis.com" universe).
|
644
635
|
# @return [::String,nil]
|
636
|
+
# @!attribute [rw] logger
|
637
|
+
# A custom logger to use for request/response debug logging, or the value
|
638
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
639
|
+
# explicitly disable logging.
|
640
|
+
# @return [::Logger,:default,nil]
|
645
641
|
#
|
646
642
|
class Configuration
|
647
643
|
extend ::Gapic::Config
|
@@ -663,6 +659,7 @@ module Google
|
|
663
659
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
664
660
|
config_attr :quota_project, nil, ::String, nil
|
665
661
|
config_attr :universe_domain, nil, ::String, nil
|
662
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
666
663
|
|
667
664
|
# @private
|
668
665
|
def initialize parent_config = nil
|
@@ -789,16 +786,18 @@ module Google
|
|
789
786
|
|
790
787
|
response = @client_stub.make_http_request(
|
791
788
|
verb,
|
792
|
-
uri:
|
793
|
-
body:
|
794
|
-
params:
|
789
|
+
uri: uri,
|
790
|
+
body: body || "",
|
791
|
+
params: query_string_params,
|
792
|
+
method_name: "list_operations",
|
795
793
|
options: options
|
796
794
|
)
|
797
795
|
operation = ::Gapic::Rest::TransportOperation.new response
|
798
796
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
799
|
-
|
800
|
-
|
801
|
-
|
797
|
+
catch :response do
|
798
|
+
yield result, operation if block_given?
|
799
|
+
result
|
800
|
+
end
|
802
801
|
end
|
803
802
|
|
804
803
|
##
|
@@ -827,16 +826,18 @@ module Google
|
|
827
826
|
|
828
827
|
response = @client_stub.make_http_request(
|
829
828
|
verb,
|
830
|
-
uri:
|
831
|
-
body:
|
832
|
-
params:
|
829
|
+
uri: uri,
|
830
|
+
body: body || "",
|
831
|
+
params: query_string_params,
|
832
|
+
method_name: "get_operation",
|
833
833
|
options: options
|
834
834
|
)
|
835
835
|
operation = ::Gapic::Rest::TransportOperation.new response
|
836
836
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
837
|
-
|
838
|
-
|
839
|
-
|
837
|
+
catch :response do
|
838
|
+
yield result, operation if block_given?
|
839
|
+
result
|
840
|
+
end
|
840
841
|
end
|
841
842
|
|
842
843
|
##
|
@@ -865,16 +866,18 @@ module Google
|
|
865
866
|
|
866
867
|
response = @client_stub.make_http_request(
|
867
868
|
verb,
|
868
|
-
uri:
|
869
|
-
body:
|
870
|
-
params:
|
869
|
+
uri: uri,
|
870
|
+
body: body || "",
|
871
|
+
params: query_string_params,
|
872
|
+
method_name: "delete_operation",
|
871
873
|
options: options
|
872
874
|
)
|
873
875
|
operation = ::Gapic::Rest::TransportOperation.new response
|
874
876
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
875
|
-
|
876
|
-
|
877
|
-
|
877
|
+
catch :response do
|
878
|
+
yield result, operation if block_given?
|
879
|
+
result
|
880
|
+
end
|
878
881
|
end
|
879
882
|
|
880
883
|
##
|
@@ -903,16 +906,18 @@ module Google
|
|
903
906
|
|
904
907
|
response = @client_stub.make_http_request(
|
905
908
|
verb,
|
906
|
-
uri:
|
907
|
-
body:
|
908
|
-
params:
|
909
|
+
uri: uri,
|
910
|
+
body: body || "",
|
911
|
+
params: query_string_params,
|
912
|
+
method_name: "cancel_operation",
|
909
913
|
options: options
|
910
914
|
)
|
911
915
|
operation = ::Gapic::Rest::TransportOperation.new response
|
912
916
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
913
|
-
|
914
|
-
|
915
|
-
|
917
|
+
catch :response do
|
918
|
+
yield result, operation if block_given?
|
919
|
+
result
|
920
|
+
end
|
916
921
|
end
|
917
922
|
|
918
923
|
##
|
@@ -941,16 +946,18 @@ module Google
|
|
941
946
|
|
942
947
|
response = @client_stub.make_http_request(
|
943
948
|
verb,
|
944
|
-
uri:
|
945
|
-
body:
|
946
|
-
params:
|
949
|
+
uri: uri,
|
950
|
+
body: body || "",
|
951
|
+
params: query_string_params,
|
952
|
+
method_name: "wait_operation",
|
947
953
|
options: options
|
948
954
|
)
|
949
955
|
operation = ::Gapic::Rest::TransportOperation.new response
|
950
956
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
951
|
-
|
952
|
-
|
953
|
-
|
957
|
+
catch :response do
|
958
|
+
yield result, operation if block_given?
|
959
|
+
result
|
960
|
+
end
|
954
961
|
end
|
955
962
|
|
956
963
|
##
|
@@ -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
|