google-cloud-automl-v1 1.0.0 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3390a47702bbcf46f2ddd4718b0d79cf5b338b29694ce40c943aca4e824ba3f5
4
- data.tar.gz: f0b1c032c5532c4b20ad50d6b3ea33ad3c27a1f70a1d21bf3e9927a0e73189a8
3
+ metadata.gz: a58904159468db064e2ddc6dbfb6314297894bcf157cd403d987d0df975d34fb
4
+ data.tar.gz: 565259644fef4ffd9e9793be7bc312c47f31e10cfda6b08453da9adfbe5fa2e1
5
5
  SHA512:
6
- metadata.gz: b35722bd55b9ca5a57133e938f0062b0abbe82ecb824742a57c530d060e132f2d4884ef0a427568194fb5e2ad8e55055a99bdd6ad8a62bda90bcdf056a4aab1b
7
- data.tar.gz: 11a0ebbe2c640ea1e751f498ce9aa1025b99f54160dfbd9053e37d011e43a22c9df448d639211690b0b7b8ca87f76b03e74d0fe04b9449cca9d2363275bb2a6a
6
+ metadata.gz: 7c5df8a5888b3a4dfe63865a646f802d6e75d8fa6103831e186a688a98e51886aa0f58eadf5c549a0624a654cf905e9f6d3c838b308aaa87492cc5cc9b2f252c
7
+ data.tar.gz: c59e2470f78eae21658513398d374e120a6284a0ded680f4ee91d016599070a3dbd40fcaaf650320506060330934415824261a140ab048caddc69ef75d083afb
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/automl)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/automl/v1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -240,8 +240,19 @@ module Google
240
240
  universe_domain: @config.universe_domain,
241
241
  channel_args: @config.channel_args,
242
242
  interceptors: @config.interceptors,
243
- channel_pool_config: @config.channel_pool
243
+ channel_pool_config: @config.channel_pool,
244
+ logger: @config.logger
244
245
  )
246
+
247
+ @auto_ml_stub.stub_logger&.info do |entry|
248
+ entry.set_system_name
249
+ entry.set_service
250
+ entry.message = "Created client for #{entry.service}"
251
+ entry.set_credentials_fields credentials
252
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
253
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
254
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
255
+ end
245
256
  end
246
257
 
247
258
  ##
@@ -251,6 +262,15 @@ module Google
251
262
  #
252
263
  attr_reader :operations_client
253
264
 
265
+ ##
266
+ # The logger used for request/response debug logging.
267
+ #
268
+ # @return [Logger]
269
+ #
270
+ def logger
271
+ @auto_ml_stub.logger
272
+ end
273
+
254
274
  # Service calls
255
275
 
256
276
  ##
@@ -343,7 +363,7 @@ module Google
343
363
  @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
344
364
  response = ::Gapic::Operation.new response, @operations_client, options: options
345
365
  yield response, operation if block_given?
346
- return response
366
+ throw :response, response
347
367
  end
348
368
  rescue ::GRPC::BadStatus => e
349
369
  raise ::Google::Cloud::Error.from_error(e)
@@ -429,7 +449,6 @@ module Google
429
449
 
430
450
  @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
431
451
  yield response, operation if block_given?
432
- return response
433
452
  end
434
453
  rescue ::GRPC::BadStatus => e
435
454
  raise ::Google::Cloud::Error.from_error(e)
@@ -536,7 +555,7 @@ module Google
536
555
  @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
537
556
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options
538
557
  yield response, operation if block_given?
539
- return response
558
+ throw :response, response
540
559
  end
541
560
  rescue ::GRPC::BadStatus => e
542
561
  raise ::Google::Cloud::Error.from_error(e)
@@ -624,7 +643,6 @@ module Google
624
643
 
625
644
  @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
626
645
  yield response, operation if block_given?
627
- return response
628
646
  end
629
647
  rescue ::GRPC::BadStatus => e
630
648
  raise ::Google::Cloud::Error.from_error(e)
@@ -722,7 +740,7 @@ module Google
722
740
  @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
723
741
  response = ::Gapic::Operation.new response, @operations_client, options: options
724
742
  yield response, operation if block_given?
725
- return response
743
+ throw :response, response
726
744
  end
727
745
  rescue ::GRPC::BadStatus => e
728
746
  raise ::Google::Cloud::Error.from_error(e)
@@ -828,7 +846,7 @@ module Google
828
846
  @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
829
847
  response = ::Gapic::Operation.new response, @operations_client, options: options
830
848
  yield response, operation if block_given?
831
- return response
849
+ throw :response, response
832
850
  end
833
851
  rescue ::GRPC::BadStatus => e
834
852
  raise ::Google::Cloud::Error.from_error(e)
@@ -926,7 +944,7 @@ module Google
926
944
  @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
927
945
  response = ::Gapic::Operation.new response, @operations_client, options: options
928
946
  yield response, operation if block_given?
929
- return response
947
+ throw :response, response
930
948
  end
931
949
  rescue ::GRPC::BadStatus => e
932
950
  raise ::Google::Cloud::Error.from_error(e)
@@ -1012,7 +1030,6 @@ module Google
1012
1030
 
1013
1031
  @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
1014
1032
  yield response, operation if block_given?
1015
- return response
1016
1033
  end
1017
1034
  rescue ::GRPC::BadStatus => e
1018
1035
  raise ::Google::Cloud::Error.from_error(e)
@@ -1112,7 +1129,7 @@ module Google
1112
1129
  @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
1113
1130
  response = ::Gapic::Operation.new response, @operations_client, options: options
1114
1131
  yield response, operation if block_given?
1115
- return response
1132
+ throw :response, response
1116
1133
  end
1117
1134
  rescue ::GRPC::BadStatus => e
1118
1135
  raise ::Google::Cloud::Error.from_error(e)
@@ -1198,7 +1215,6 @@ module Google
1198
1215
 
1199
1216
  @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
1200
1217
  yield response, operation if block_given?
1201
- return response
1202
1218
  end
1203
1219
  rescue ::GRPC::BadStatus => e
1204
1220
  raise ::Google::Cloud::Error.from_error(e)
@@ -1306,7 +1322,7 @@ module Google
1306
1322
  @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
1307
1323
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options
1308
1324
  yield response, operation if block_given?
1309
- return response
1325
+ throw :response, response
1310
1326
  end
1311
1327
  rescue ::GRPC::BadStatus => e
1312
1328
  raise ::Google::Cloud::Error.from_error(e)
@@ -1404,7 +1420,7 @@ module Google
1404
1420
  @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
1405
1421
  response = ::Gapic::Operation.new response, @operations_client, options: options
1406
1422
  yield response, operation if block_given?
1407
- return response
1423
+ throw :response, response
1408
1424
  end
1409
1425
  rescue ::GRPC::BadStatus => e
1410
1426
  raise ::Google::Cloud::Error.from_error(e)
@@ -1492,7 +1508,6 @@ module Google
1492
1508
 
1493
1509
  @auto_ml_stub.call_rpc :update_model, request, options: options do |response, operation|
1494
1510
  yield response, operation if block_given?
1495
- return response
1496
1511
  end
1497
1512
  rescue ::GRPC::BadStatus => e
1498
1513
  raise ::Google::Cloud::Error.from_error(e)
@@ -1600,7 +1615,7 @@ module Google
1600
1615
  @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
1601
1616
  response = ::Gapic::Operation.new response, @operations_client, options: options
1602
1617
  yield response, operation if block_given?
1603
- return response
1618
+ throw :response, response
1604
1619
  end
1605
1620
  rescue ::GRPC::BadStatus => e
1606
1621
  raise ::Google::Cloud::Error.from_error(e)
@@ -1700,7 +1715,7 @@ module Google
1700
1715
  @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
1701
1716
  response = ::Gapic::Operation.new response, @operations_client, options: options
1702
1717
  yield response, operation if block_given?
1703
- return response
1718
+ throw :response, response
1704
1719
  end
1705
1720
  rescue ::GRPC::BadStatus => e
1706
1721
  raise ::Google::Cloud::Error.from_error(e)
@@ -1802,7 +1817,7 @@ module Google
1802
1817
  @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
1803
1818
  response = ::Gapic::Operation.new response, @operations_client, options: options
1804
1819
  yield response, operation if block_given?
1805
- return response
1820
+ throw :response, response
1806
1821
  end
1807
1822
  rescue ::GRPC::BadStatus => e
1808
1823
  raise ::Google::Cloud::Error.from_error(e)
@@ -1888,7 +1903,6 @@ module Google
1888
1903
 
1889
1904
  @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
1890
1905
  yield response, operation if block_given?
1891
- return response
1892
1906
  end
1893
1907
  rescue ::GRPC::BadStatus => e
1894
1908
  raise ::Google::Cloud::Error.from_error(e)
@@ -2000,7 +2014,7 @@ module Google
2000
2014
  @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
2001
2015
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options
2002
2016
  yield response, operation if block_given?
2003
- return response
2017
+ throw :response, response
2004
2018
  end
2005
2019
  rescue ::GRPC::BadStatus => e
2006
2020
  raise ::Google::Cloud::Error.from_error(e)
@@ -2089,6 +2103,11 @@ module Google
2089
2103
  # default endpoint URL. The default value of nil uses the environment
2090
2104
  # universe (usually the default "googleapis.com" universe).
2091
2105
  # @return [::String,nil]
2106
+ # @!attribute [rw] logger
2107
+ # A custom logger to use for request/response debug logging, or the value
2108
+ # `:default` (the default) to construct a default logger, or `nil` to
2109
+ # explicitly disable logging.
2110
+ # @return [::Logger,:default,nil]
2092
2111
  #
2093
2112
  class Configuration
2094
2113
  extend ::Gapic::Config
@@ -2113,6 +2132,7 @@ module Google
2113
2132
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2114
2133
  config_attr :quota_project, nil, ::String, nil
2115
2134
  config_attr :universe_domain, nil, ::String, nil
2135
+ config_attr :logger, :default, ::Logger, nil, :default
2116
2136
 
2117
2137
  # @private
2118
2138
  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
- return response
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
- return response
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 {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
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
- return response
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
@@ -233,8 +233,19 @@ module Google
233
233
  endpoint: @config.endpoint,
234
234
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
235
235
  universe_domain: @config.universe_domain,
236
- credentials: credentials
236
+ credentials: credentials,
237
+ logger: @config.logger
237
238
  )
239
+
240
+ @auto_ml_stub.logger(stub: true)&.info do |entry|
241
+ entry.set_system_name
242
+ entry.set_service
243
+ entry.message = "Created client for #{entry.service}"
244
+ entry.set_credentials_fields credentials
245
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
246
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
247
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
248
+ end
238
249
  end
239
250
 
240
251
  ##
@@ -244,6 +255,15 @@ module Google
244
255
  #
245
256
  attr_reader :operations_client
246
257
 
258
+ ##
259
+ # The logger used for request/response debug logging.
260
+ #
261
+ # @return [Logger]
262
+ #
263
+ def logger
264
+ @auto_ml_stub.logger
265
+ end
266
+
247
267
  # Service calls
248
268
 
249
269
  ##
@@ -329,7 +349,7 @@ module Google
329
349
  @auto_ml_stub.create_dataset request, options do |result, operation|
330
350
  result = ::Gapic::Operation.new result, @operations_client, options: options
331
351
  yield result, operation if block_given?
332
- return result
352
+ throw :response, result
333
353
  end
334
354
  rescue ::Gapic::Rest::Error => e
335
355
  raise ::Google::Cloud::Error.from_error(e)
@@ -408,7 +428,6 @@ module Google
408
428
 
409
429
  @auto_ml_stub.get_dataset request, options do |result, operation|
410
430
  yield result, operation if block_given?
411
- return result
412
431
  end
413
432
  rescue ::Gapic::Rest::Error => e
414
433
  raise ::Google::Cloud::Error.from_error(e)
@@ -508,7 +527,7 @@ module Google
508
527
  @auto_ml_stub.list_datasets request, options do |result, operation|
509
528
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_datasets, "datasets", request, result, options
510
529
  yield result, operation if block_given?
511
- return result
530
+ throw :response, result
512
531
  end
513
532
  rescue ::Gapic::Rest::Error => e
514
533
  raise ::Google::Cloud::Error.from_error(e)
@@ -589,7 +608,6 @@ module Google
589
608
 
590
609
  @auto_ml_stub.update_dataset request, options do |result, operation|
591
610
  yield result, operation if block_given?
592
- return result
593
611
  end
594
612
  rescue ::Gapic::Rest::Error => e
595
613
  raise ::Google::Cloud::Error.from_error(e)
@@ -680,7 +698,7 @@ module Google
680
698
  @auto_ml_stub.delete_dataset request, options do |result, operation|
681
699
  result = ::Gapic::Operation.new result, @operations_client, options: options
682
700
  yield result, operation if block_given?
683
- return result
701
+ throw :response, result
684
702
  end
685
703
  rescue ::Gapic::Rest::Error => e
686
704
  raise ::Google::Cloud::Error.from_error(e)
@@ -779,7 +797,7 @@ module Google
779
797
  @auto_ml_stub.import_data request, options do |result, operation|
780
798
  result = ::Gapic::Operation.new result, @operations_client, options: options
781
799
  yield result, operation if block_given?
782
- return result
800
+ throw :response, result
783
801
  end
784
802
  rescue ::Gapic::Rest::Error => e
785
803
  raise ::Google::Cloud::Error.from_error(e)
@@ -870,7 +888,7 @@ module Google
870
888
  @auto_ml_stub.export_data request, options do |result, operation|
871
889
  result = ::Gapic::Operation.new result, @operations_client, options: options
872
890
  yield result, operation if block_given?
873
- return result
891
+ throw :response, result
874
892
  end
875
893
  rescue ::Gapic::Rest::Error => e
876
894
  raise ::Google::Cloud::Error.from_error(e)
@@ -949,7 +967,6 @@ module Google
949
967
 
950
968
  @auto_ml_stub.get_annotation_spec request, options do |result, operation|
951
969
  yield result, operation if block_given?
952
- return result
953
970
  end
954
971
  rescue ::Gapic::Rest::Error => e
955
972
  raise ::Google::Cloud::Error.from_error(e)
@@ -1042,7 +1059,7 @@ module Google
1042
1059
  @auto_ml_stub.create_model request, options do |result, operation|
1043
1060
  result = ::Gapic::Operation.new result, @operations_client, options: options
1044
1061
  yield result, operation if block_given?
1045
- return result
1062
+ throw :response, result
1046
1063
  end
1047
1064
  rescue ::Gapic::Rest::Error => e
1048
1065
  raise ::Google::Cloud::Error.from_error(e)
@@ -1121,7 +1138,6 @@ module Google
1121
1138
 
1122
1139
  @auto_ml_stub.get_model request, options do |result, operation|
1123
1140
  yield result, operation if block_given?
1124
- return result
1125
1141
  end
1126
1142
  rescue ::Gapic::Rest::Error => e
1127
1143
  raise ::Google::Cloud::Error.from_error(e)
@@ -1222,7 +1238,7 @@ module Google
1222
1238
  @auto_ml_stub.list_models request, options do |result, operation|
1223
1239
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_models, "model", request, result, options
1224
1240
  yield result, operation if block_given?
1225
- return result
1241
+ throw :response, result
1226
1242
  end
1227
1243
  rescue ::Gapic::Rest::Error => e
1228
1244
  raise ::Google::Cloud::Error.from_error(e)
@@ -1313,7 +1329,7 @@ module Google
1313
1329
  @auto_ml_stub.delete_model request, options do |result, operation|
1314
1330
  result = ::Gapic::Operation.new result, @operations_client, options: options
1315
1331
  yield result, operation if block_given?
1316
- return result
1332
+ throw :response, result
1317
1333
  end
1318
1334
  rescue ::Gapic::Rest::Error => e
1319
1335
  raise ::Google::Cloud::Error.from_error(e)
@@ -1394,7 +1410,6 @@ module Google
1394
1410
 
1395
1411
  @auto_ml_stub.update_model request, options do |result, operation|
1396
1412
  yield result, operation if block_given?
1397
- return result
1398
1413
  end
1399
1414
  rescue ::Gapic::Rest::Error => e
1400
1415
  raise ::Google::Cloud::Error.from_error(e)
@@ -1495,7 +1510,7 @@ module Google
1495
1510
  @auto_ml_stub.deploy_model request, options do |result, operation|
1496
1511
  result = ::Gapic::Operation.new result, @operations_client, options: options
1497
1512
  yield result, operation if block_given?
1498
- return result
1513
+ throw :response, result
1499
1514
  end
1500
1515
  rescue ::Gapic::Rest::Error => e
1501
1516
  raise ::Google::Cloud::Error.from_error(e)
@@ -1588,7 +1603,7 @@ module Google
1588
1603
  @auto_ml_stub.undeploy_model request, options do |result, operation|
1589
1604
  result = ::Gapic::Operation.new result, @operations_client, options: options
1590
1605
  yield result, operation if block_given?
1591
- return result
1606
+ throw :response, result
1592
1607
  end
1593
1608
  rescue ::Gapic::Rest::Error => e
1594
1609
  raise ::Google::Cloud::Error.from_error(e)
@@ -1683,7 +1698,7 @@ module Google
1683
1698
  @auto_ml_stub.export_model request, options do |result, operation|
1684
1699
  result = ::Gapic::Operation.new result, @operations_client, options: options
1685
1700
  yield result, operation if block_given?
1686
- return result
1701
+ throw :response, result
1687
1702
  end
1688
1703
  rescue ::Gapic::Rest::Error => e
1689
1704
  raise ::Google::Cloud::Error.from_error(e)
@@ -1762,7 +1777,6 @@ module Google
1762
1777
 
1763
1778
  @auto_ml_stub.get_model_evaluation request, options do |result, operation|
1764
1779
  yield result, operation if block_given?
1765
- return result
1766
1780
  end
1767
1781
  rescue ::Gapic::Rest::Error => e
1768
1782
  raise ::Google::Cloud::Error.from_error(e)
@@ -1867,7 +1881,7 @@ module Google
1867
1881
  @auto_ml_stub.list_model_evaluations request, options do |result, operation|
1868
1882
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, "model_evaluation", request, result, options
1869
1883
  yield result, operation if block_given?
1870
- return result
1884
+ throw :response, result
1871
1885
  end
1872
1886
  rescue ::Gapic::Rest::Error => e
1873
1887
  raise ::Google::Cloud::Error.from_error(e)
@@ -1947,6 +1961,11 @@ module Google
1947
1961
  # default endpoint URL. The default value of nil uses the environment
1948
1962
  # universe (usually the default "googleapis.com" universe).
1949
1963
  # @return [::String,nil]
1964
+ # @!attribute [rw] logger
1965
+ # A custom logger to use for request/response debug logging, or the value
1966
+ # `:default` (the default) to construct a default logger, or `nil` to
1967
+ # explicitly disable logging.
1968
+ # @return [::Logger,:default,nil]
1950
1969
  #
1951
1970
  class Configuration
1952
1971
  extend ::Gapic::Config
@@ -1968,6 +1987,7 @@ module Google
1968
1987
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1969
1988
  config_attr :quota_project, nil, ::String, nil
1970
1989
  config_attr :universe_domain, nil, ::String, nil
1990
+ config_attr :logger, :default, ::Logger, nil, :default
1971
1991
 
1972
1992
  # @private
1973
1993
  def initialize parent_config = nil