google-cloud-automl-v1beta1 0.11.0 → 0.12.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: 1bce9cb9912a846e93f72a7ecef180fc0a36745ffb6a1b1314575d20cffa6879
4
- data.tar.gz: f988debefd526430b387cef0d762d1cfb04f3f59062c958c9ece336ee4045553
3
+ metadata.gz: f2d49f8670a69eb9aeb207c838d57b1c2de21e55980f0a4755404824ef9976e5
4
+ data.tar.gz: a34775ff7db0af650c61b921e36f8c1e50401f4876e3d7a6262e5852dcffc865
5
5
  SHA512:
6
- metadata.gz: c516d680c0c1d3fdc680b6f52177848f32aa7ca44eaf24ed2b398033987db9bb6b4bb17135aea428fd463ffd8c6b8cd6ccf8a26614e53784c5a4b5f7f20c9b7f
7
- data.tar.gz: 1ba4fa82b235e788308ddb0a27cfe3e4d2ec35141ebfa95f83d20f5a68aa4e1e945e3470641d58e672ff7a723c007d19bf262239216a106622d0a2a68744cb13
6
+ metadata.gz: 7e4cfacfbdf5891a29ddc1442374a06608b237a4aeb6ec12963bbe56a83c82f4d6656e308fcc4d8724f8b3743d2ccf545ca329e1e1dc84dc86a0bb1c0b7b5571
7
+ data.tar.gz: 0c2144b9a7eacab1ad88ce27d193de6a1cf6bacf68ba3430302f4c391973ed7c2a5fa65a3030aa622dd45aad2e60bdfb2956713fdbe7b138cc4b0460113f4cf8
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/v1beta1"
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::V1beta1::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).
@@ -43,6 +43,9 @@ module Google
43
43
  # snake_case or kebab-case, either of those cases is accepted.
44
44
  #
45
45
  class Client
46
+ # @private
47
+ API_VERSION = ""
48
+
46
49
  # @private
47
50
  DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$"
48
51
 
@@ -258,8 +261,19 @@ module Google
258
261
  universe_domain: @config.universe_domain,
259
262
  channel_args: @config.channel_args,
260
263
  interceptors: @config.interceptors,
261
- channel_pool_config: @config.channel_pool
264
+ channel_pool_config: @config.channel_pool,
265
+ logger: @config.logger
262
266
  )
267
+
268
+ @auto_ml_stub.stub_logger&.info do |entry|
269
+ entry.set_system_name
270
+ entry.set_service
271
+ entry.message = "Created client for #{entry.service}"
272
+ entry.set_credentials_fields credentials
273
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
274
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
275
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
276
+ end
263
277
  end
264
278
 
265
279
  ##
@@ -269,6 +283,15 @@ module Google
269
283
  #
270
284
  attr_reader :operations_client
271
285
 
286
+ ##
287
+ # The logger used for request/response debug logging.
288
+ #
289
+ # @return [Logger]
290
+ #
291
+ def logger
292
+ @auto_ml_stub.logger
293
+ end
294
+
272
295
  # Service calls
273
296
 
274
297
  ##
@@ -328,10 +351,11 @@ module Google
328
351
  # Customize the options with defaults
329
352
  metadata = @config.rpcs.create_dataset.metadata.to_h
330
353
 
331
- # Set x-goog-api-client and x-goog-user-project headers
354
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
332
355
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
333
356
  lib_name: @config.lib_name, lib_version: @config.lib_version,
334
357
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
358
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
335
359
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
336
360
 
337
361
  header_params = {}
@@ -352,7 +376,6 @@ module Google
352
376
 
353
377
  @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
354
378
  yield response, operation if block_given?
355
- return response
356
379
  end
357
380
  rescue ::GRPC::BadStatus => e
358
381
  raise ::Google::Cloud::Error.from_error(e)
@@ -413,10 +436,11 @@ module Google
413
436
  # Customize the options with defaults
414
437
  metadata = @config.rpcs.get_dataset.metadata.to_h
415
438
 
416
- # Set x-goog-api-client and x-goog-user-project headers
439
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
417
440
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
418
441
  lib_name: @config.lib_name, lib_version: @config.lib_version,
419
442
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
443
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
420
444
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
421
445
 
422
446
  header_params = {}
@@ -437,7 +461,6 @@ module Google
437
461
 
438
462
  @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
439
463
  yield response, operation if block_given?
440
- return response
441
464
  end
442
465
  rescue ::GRPC::BadStatus => e
443
466
  raise ::Google::Cloud::Error.from_error(e)
@@ -519,10 +542,11 @@ module Google
519
542
  # Customize the options with defaults
520
543
  metadata = @config.rpcs.list_datasets.metadata.to_h
521
544
 
522
- # Set x-goog-api-client and x-goog-user-project headers
545
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
523
546
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
524
547
  lib_name: @config.lib_name, lib_version: @config.lib_version,
525
548
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
549
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
526
550
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
527
551
 
528
552
  header_params = {}
@@ -544,7 +568,7 @@ module Google
544
568
  @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
545
569
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options
546
570
  yield response, operation if block_given?
547
- return response
571
+ throw :response, response
548
572
  end
549
573
  rescue ::GRPC::BadStatus => e
550
574
  raise ::Google::Cloud::Error.from_error(e)
@@ -607,10 +631,11 @@ module Google
607
631
  # Customize the options with defaults
608
632
  metadata = @config.rpcs.update_dataset.metadata.to_h
609
633
 
610
- # Set x-goog-api-client and x-goog-user-project headers
634
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
611
635
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
612
636
  lib_name: @config.lib_name, lib_version: @config.lib_version,
613
637
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
638
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
614
639
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
615
640
 
616
641
  header_params = {}
@@ -631,7 +656,6 @@ module Google
631
656
 
632
657
  @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
633
658
  yield response, operation if block_given?
634
- return response
635
659
  end
636
660
  rescue ::GRPC::BadStatus => e
637
661
  raise ::Google::Cloud::Error.from_error(e)
@@ -703,10 +727,11 @@ module Google
703
727
  # Customize the options with defaults
704
728
  metadata = @config.rpcs.delete_dataset.metadata.to_h
705
729
 
706
- # Set x-goog-api-client and x-goog-user-project headers
730
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
707
731
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
708
732
  lib_name: @config.lib_name, lib_version: @config.lib_version,
709
733
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
734
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
710
735
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
711
736
 
712
737
  header_params = {}
@@ -728,7 +753,7 @@ module Google
728
753
  @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
729
754
  response = ::Gapic::Operation.new response, @operations_client, options: options
730
755
  yield response, operation if block_given?
731
- return response
756
+ throw :response, response
732
757
  end
733
758
  rescue ::GRPC::BadStatus => e
734
759
  raise ::Google::Cloud::Error.from_error(e)
@@ -808,10 +833,11 @@ module Google
808
833
  # Customize the options with defaults
809
834
  metadata = @config.rpcs.import_data.metadata.to_h
810
835
 
811
- # Set x-goog-api-client and x-goog-user-project headers
836
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
812
837
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
813
838
  lib_name: @config.lib_name, lib_version: @config.lib_version,
814
839
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
840
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
815
841
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
816
842
 
817
843
  header_params = {}
@@ -833,7 +859,7 @@ module Google
833
859
  @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
834
860
  response = ::Gapic::Operation.new response, @operations_client, options: options
835
861
  yield response, operation if block_given?
836
- return response
862
+ throw :response, response
837
863
  end
838
864
  rescue ::GRPC::BadStatus => e
839
865
  raise ::Google::Cloud::Error.from_error(e)
@@ -905,10 +931,11 @@ module Google
905
931
  # Customize the options with defaults
906
932
  metadata = @config.rpcs.export_data.metadata.to_h
907
933
 
908
- # Set x-goog-api-client and x-goog-user-project headers
934
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
909
935
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
910
936
  lib_name: @config.lib_name, lib_version: @config.lib_version,
911
937
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
938
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
912
939
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
913
940
 
914
941
  header_params = {}
@@ -930,7 +957,7 @@ module Google
930
957
  @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
931
958
  response = ::Gapic::Operation.new response, @operations_client, options: options
932
959
  yield response, operation if block_given?
933
- return response
960
+ throw :response, response
934
961
  end
935
962
  rescue ::GRPC::BadStatus => e
936
963
  raise ::Google::Cloud::Error.from_error(e)
@@ -991,10 +1018,11 @@ module Google
991
1018
  # Customize the options with defaults
992
1019
  metadata = @config.rpcs.get_annotation_spec.metadata.to_h
993
1020
 
994
- # Set x-goog-api-client and x-goog-user-project headers
1021
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
995
1022
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
996
1023
  lib_name: @config.lib_name, lib_version: @config.lib_version,
997
1024
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1025
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
998
1026
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
999
1027
 
1000
1028
  header_params = {}
@@ -1015,7 +1043,6 @@ module Google
1015
1043
 
1016
1044
  @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
1017
1045
  yield response, operation if block_given?
1018
- return response
1019
1046
  end
1020
1047
  rescue ::GRPC::BadStatus => e
1021
1048
  raise ::Google::Cloud::Error.from_error(e)
@@ -1078,10 +1105,11 @@ module Google
1078
1105
  # Customize the options with defaults
1079
1106
  metadata = @config.rpcs.get_table_spec.metadata.to_h
1080
1107
 
1081
- # Set x-goog-api-client and x-goog-user-project headers
1108
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1082
1109
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1083
1110
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1084
1111
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1112
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1085
1113
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1086
1114
 
1087
1115
  header_params = {}
@@ -1102,7 +1130,6 @@ module Google
1102
1130
 
1103
1131
  @auto_ml_stub.call_rpc :get_table_spec, request, options: options do |response, operation|
1104
1132
  yield response, operation if block_given?
1105
- return response
1106
1133
  end
1107
1134
  rescue ::GRPC::BadStatus => e
1108
1135
  raise ::Google::Cloud::Error.from_error(e)
@@ -1179,10 +1206,11 @@ module Google
1179
1206
  # Customize the options with defaults
1180
1207
  metadata = @config.rpcs.list_table_specs.metadata.to_h
1181
1208
 
1182
- # Set x-goog-api-client and x-goog-user-project headers
1209
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1183
1210
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1184
1211
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1185
1212
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1213
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1186
1214
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1187
1215
 
1188
1216
  header_params = {}
@@ -1204,7 +1232,7 @@ module Google
1204
1232
  @auto_ml_stub.call_rpc :list_table_specs, request, options: options do |response, operation|
1205
1233
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_table_specs, request, response, operation, options
1206
1234
  yield response, operation if block_given?
1207
- return response
1235
+ throw :response, response
1208
1236
  end
1209
1237
  rescue ::GRPC::BadStatus => e
1210
1238
  raise ::Google::Cloud::Error.from_error(e)
@@ -1267,10 +1295,11 @@ module Google
1267
1295
  # Customize the options with defaults
1268
1296
  metadata = @config.rpcs.update_table_spec.metadata.to_h
1269
1297
 
1270
- # Set x-goog-api-client and x-goog-user-project headers
1298
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1271
1299
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1272
1300
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1273
1301
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1302
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1274
1303
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1275
1304
 
1276
1305
  header_params = {}
@@ -1291,7 +1320,6 @@ module Google
1291
1320
 
1292
1321
  @auto_ml_stub.call_rpc :update_table_spec, request, options: options do |response, operation|
1293
1322
  yield response, operation if block_given?
1294
- return response
1295
1323
  end
1296
1324
  rescue ::GRPC::BadStatus => e
1297
1325
  raise ::Google::Cloud::Error.from_error(e)
@@ -1354,10 +1382,11 @@ module Google
1354
1382
  # Customize the options with defaults
1355
1383
  metadata = @config.rpcs.get_column_spec.metadata.to_h
1356
1384
 
1357
- # Set x-goog-api-client and x-goog-user-project headers
1385
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1358
1386
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1359
1387
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1360
1388
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1389
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1361
1390
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1362
1391
 
1363
1392
  header_params = {}
@@ -1378,7 +1407,6 @@ module Google
1378
1407
 
1379
1408
  @auto_ml_stub.call_rpc :get_column_spec, request, options: options do |response, operation|
1380
1409
  yield response, operation if block_given?
1381
- return response
1382
1410
  end
1383
1411
  rescue ::GRPC::BadStatus => e
1384
1412
  raise ::Google::Cloud::Error.from_error(e)
@@ -1455,10 +1483,11 @@ module Google
1455
1483
  # Customize the options with defaults
1456
1484
  metadata = @config.rpcs.list_column_specs.metadata.to_h
1457
1485
 
1458
- # Set x-goog-api-client and x-goog-user-project headers
1486
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1459
1487
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1460
1488
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1461
1489
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1490
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1462
1491
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1463
1492
 
1464
1493
  header_params = {}
@@ -1480,7 +1509,7 @@ module Google
1480
1509
  @auto_ml_stub.call_rpc :list_column_specs, request, options: options do |response, operation|
1481
1510
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_column_specs, request, response, operation, options
1482
1511
  yield response, operation if block_given?
1483
- return response
1512
+ throw :response, response
1484
1513
  end
1485
1514
  rescue ::GRPC::BadStatus => e
1486
1515
  raise ::Google::Cloud::Error.from_error(e)
@@ -1543,10 +1572,11 @@ module Google
1543
1572
  # Customize the options with defaults
1544
1573
  metadata = @config.rpcs.update_column_spec.metadata.to_h
1545
1574
 
1546
- # Set x-goog-api-client and x-goog-user-project headers
1575
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1547
1576
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1548
1577
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1549
1578
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1579
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1550
1580
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1551
1581
 
1552
1582
  header_params = {}
@@ -1567,7 +1597,6 @@ module Google
1567
1597
 
1568
1598
  @auto_ml_stub.call_rpc :update_column_spec, request, options: options do |response, operation|
1569
1599
  yield response, operation if block_given?
1570
- return response
1571
1600
  end
1572
1601
  rescue ::GRPC::BadStatus => e
1573
1602
  raise ::Google::Cloud::Error.from_error(e)
@@ -1641,10 +1670,11 @@ module Google
1641
1670
  # Customize the options with defaults
1642
1671
  metadata = @config.rpcs.create_model.metadata.to_h
1643
1672
 
1644
- # Set x-goog-api-client and x-goog-user-project headers
1673
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1645
1674
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1646
1675
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1647
1676
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1677
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1648
1678
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1649
1679
 
1650
1680
  header_params = {}
@@ -1666,7 +1696,7 @@ module Google
1666
1696
  @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
1667
1697
  response = ::Gapic::Operation.new response, @operations_client, options: options
1668
1698
  yield response, operation if block_given?
1669
- return response
1699
+ throw :response, response
1670
1700
  end
1671
1701
  rescue ::GRPC::BadStatus => e
1672
1702
  raise ::Google::Cloud::Error.from_error(e)
@@ -1727,10 +1757,11 @@ module Google
1727
1757
  # Customize the options with defaults
1728
1758
  metadata = @config.rpcs.get_model.metadata.to_h
1729
1759
 
1730
- # Set x-goog-api-client and x-goog-user-project headers
1760
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1731
1761
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1732
1762
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1733
1763
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1764
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1734
1765
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1735
1766
 
1736
1767
  header_params = {}
@@ -1751,7 +1782,6 @@ module Google
1751
1782
 
1752
1783
  @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
1753
1784
  yield response, operation if block_given?
1754
- return response
1755
1785
  end
1756
1786
  rescue ::GRPC::BadStatus => e
1757
1787
  raise ::Google::Cloud::Error.from_error(e)
@@ -1833,10 +1863,11 @@ module Google
1833
1863
  # Customize the options with defaults
1834
1864
  metadata = @config.rpcs.list_models.metadata.to_h
1835
1865
 
1836
- # Set x-goog-api-client and x-goog-user-project headers
1866
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1837
1867
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1838
1868
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1839
1869
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1870
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1840
1871
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1841
1872
 
1842
1873
  header_params = {}
@@ -1858,7 +1889,7 @@ module Google
1858
1889
  @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
1859
1890
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options
1860
1891
  yield response, operation if block_given?
1861
- return response
1892
+ throw :response, response
1862
1893
  end
1863
1894
  rescue ::GRPC::BadStatus => e
1864
1895
  raise ::Google::Cloud::Error.from_error(e)
@@ -1930,10 +1961,11 @@ module Google
1930
1961
  # Customize the options with defaults
1931
1962
  metadata = @config.rpcs.delete_model.metadata.to_h
1932
1963
 
1933
- # Set x-goog-api-client and x-goog-user-project headers
1964
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1934
1965
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1935
1966
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1936
1967
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1968
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1937
1969
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1938
1970
 
1939
1971
  header_params = {}
@@ -1955,7 +1987,7 @@ module Google
1955
1987
  @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
1956
1988
  response = ::Gapic::Operation.new response, @operations_client, options: options
1957
1989
  yield response, operation if block_given?
1958
- return response
1990
+ throw :response, response
1959
1991
  end
1960
1992
  rescue ::GRPC::BadStatus => e
1961
1993
  raise ::Google::Cloud::Error.from_error(e)
@@ -2038,10 +2070,11 @@ module Google
2038
2070
  # Customize the options with defaults
2039
2071
  metadata = @config.rpcs.deploy_model.metadata.to_h
2040
2072
 
2041
- # Set x-goog-api-client and x-goog-user-project headers
2073
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2042
2074
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2043
2075
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2044
2076
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
2077
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2045
2078
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2046
2079
 
2047
2080
  header_params = {}
@@ -2063,7 +2096,7 @@ module Google
2063
2096
  @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
2064
2097
  response = ::Gapic::Operation.new response, @operations_client, options: options
2065
2098
  yield response, operation if block_given?
2066
- return response
2099
+ throw :response, response
2067
2100
  end
2068
2101
  rescue ::GRPC::BadStatus => e
2069
2102
  raise ::Google::Cloud::Error.from_error(e)
@@ -2137,10 +2170,11 @@ module Google
2137
2170
  # Customize the options with defaults
2138
2171
  metadata = @config.rpcs.undeploy_model.metadata.to_h
2139
2172
 
2140
- # Set x-goog-api-client and x-goog-user-project headers
2173
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2141
2174
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2142
2175
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2143
2176
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
2177
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2144
2178
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2145
2179
 
2146
2180
  header_params = {}
@@ -2162,7 +2196,7 @@ module Google
2162
2196
  @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
2163
2197
  response = ::Gapic::Operation.new response, @operations_client, options: options
2164
2198
  yield response, operation if block_given?
2165
- return response
2199
+ throw :response, response
2166
2200
  end
2167
2201
  rescue ::GRPC::BadStatus => e
2168
2202
  raise ::Google::Cloud::Error.from_error(e)
@@ -2239,10 +2273,11 @@ module Google
2239
2273
  # Customize the options with defaults
2240
2274
  metadata = @config.rpcs.export_model.metadata.to_h
2241
2275
 
2242
- # Set x-goog-api-client and x-goog-user-project headers
2276
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2243
2277
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2244
2278
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2245
2279
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
2280
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2246
2281
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2247
2282
 
2248
2283
  header_params = {}
@@ -2264,7 +2299,7 @@ module Google
2264
2299
  @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
2265
2300
  response = ::Gapic::Operation.new response, @operations_client, options: options
2266
2301
  yield response, operation if block_given?
2267
- return response
2302
+ throw :response, response
2268
2303
  end
2269
2304
  rescue ::GRPC::BadStatus => e
2270
2305
  raise ::Google::Cloud::Error.from_error(e)
@@ -2348,10 +2383,11 @@ module Google
2348
2383
  # Customize the options with defaults
2349
2384
  metadata = @config.rpcs.export_evaluated_examples.metadata.to_h
2350
2385
 
2351
- # Set x-goog-api-client and x-goog-user-project headers
2386
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2352
2387
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2353
2388
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2354
2389
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
2390
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2355
2391
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2356
2392
 
2357
2393
  header_params = {}
@@ -2373,7 +2409,7 @@ module Google
2373
2409
  @auto_ml_stub.call_rpc :export_evaluated_examples, request, options: options do |response, operation|
2374
2410
  response = ::Gapic::Operation.new response, @operations_client, options: options
2375
2411
  yield response, operation if block_given?
2376
- return response
2412
+ throw :response, response
2377
2413
  end
2378
2414
  rescue ::GRPC::BadStatus => e
2379
2415
  raise ::Google::Cloud::Error.from_error(e)
@@ -2434,10 +2470,11 @@ module Google
2434
2470
  # Customize the options with defaults
2435
2471
  metadata = @config.rpcs.get_model_evaluation.metadata.to_h
2436
2472
 
2437
- # Set x-goog-api-client and x-goog-user-project headers
2473
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2438
2474
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2439
2475
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2440
2476
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
2477
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2441
2478
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2442
2479
 
2443
2480
  header_params = {}
@@ -2458,7 +2495,6 @@ module Google
2458
2495
 
2459
2496
  @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
2460
2497
  yield response, operation if block_given?
2461
- return response
2462
2498
  end
2463
2499
  rescue ::GRPC::BadStatus => e
2464
2500
  raise ::Google::Cloud::Error.from_error(e)
@@ -2544,10 +2580,11 @@ module Google
2544
2580
  # Customize the options with defaults
2545
2581
  metadata = @config.rpcs.list_model_evaluations.metadata.to_h
2546
2582
 
2547
- # Set x-goog-api-client and x-goog-user-project headers
2583
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2548
2584
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2549
2585
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2550
2586
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
2587
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2551
2588
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2552
2589
 
2553
2590
  header_params = {}
@@ -2569,7 +2606,7 @@ module Google
2569
2606
  @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
2570
2607
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options
2571
2608
  yield response, operation if block_given?
2572
- return response
2609
+ throw :response, response
2573
2610
  end
2574
2611
  rescue ::GRPC::BadStatus => e
2575
2612
  raise ::Google::Cloud::Error.from_error(e)
@@ -2658,6 +2695,11 @@ module Google
2658
2695
  # default endpoint URL. The default value of nil uses the environment
2659
2696
  # universe (usually the default "googleapis.com" universe).
2660
2697
  # @return [::String,nil]
2698
+ # @!attribute [rw] logger
2699
+ # A custom logger to use for request/response debug logging, or the value
2700
+ # `:default` (the default) to construct a default logger, or `nil` to
2701
+ # explicitly disable logging.
2702
+ # @return [::Logger,:default,nil]
2661
2703
  #
2662
2704
  class Configuration
2663
2705
  extend ::Gapic::Config
@@ -2682,6 +2724,7 @@ module Google
2682
2724
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2683
2725
  config_attr :quota_project, nil, ::String, nil
2684
2726
  config_attr :universe_domain, nil, ::String, nil
2727
+ config_attr :logger, :default, ::Logger, nil, :default
2685
2728
 
2686
2729
  # @private
2687
2730
  def initialize parent_config = nil