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.
@@ -45,6 +45,9 @@ module Google
45
45
  # snake_case or kebab-case, either of those cases is accepted.
46
46
  #
47
47
  class Client
48
+ # @private
49
+ API_VERSION = ""
50
+
48
51
  # @private
49
52
  DEFAULT_ENDPOINT_TEMPLATE = "automl.$UNIVERSE_DOMAIN$"
50
53
 
@@ -251,8 +254,19 @@ module Google
251
254
  endpoint: @config.endpoint,
252
255
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
253
256
  universe_domain: @config.universe_domain,
254
- credentials: credentials
257
+ credentials: credentials,
258
+ logger: @config.logger
255
259
  )
260
+
261
+ @auto_ml_stub.logger(stub: true)&.info do |entry|
262
+ entry.set_system_name
263
+ entry.set_service
264
+ entry.message = "Created client for #{entry.service}"
265
+ entry.set_credentials_fields credentials
266
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
267
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
268
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
269
+ end
256
270
  end
257
271
 
258
272
  ##
@@ -262,6 +276,15 @@ module Google
262
276
  #
263
277
  attr_reader :operations_client
264
278
 
279
+ ##
280
+ # The logger used for request/response debug logging.
281
+ #
282
+ # @return [Logger]
283
+ #
284
+ def logger
285
+ @auto_ml_stub.logger
286
+ end
287
+
265
288
  # Service calls
266
289
 
267
290
  ##
@@ -320,12 +343,13 @@ module Google
320
343
  # Customize the options with defaults
321
344
  call_metadata = @config.rpcs.create_dataset.metadata.to_h
322
345
 
323
- # Set x-goog-api-client and x-goog-user-project headers
346
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
324
347
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
325
348
  lib_name: @config.lib_name, lib_version: @config.lib_version,
326
349
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
327
350
  transports_version_send: [:rest]
328
351
 
352
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
329
353
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
330
354
 
331
355
  options.apply_defaults timeout: @config.rpcs.create_dataset.timeout,
@@ -338,7 +362,6 @@ module Google
338
362
 
339
363
  @auto_ml_stub.create_dataset request, options do |result, operation|
340
364
  yield result, operation if block_given?
341
- return result
342
365
  end
343
366
  rescue ::Gapic::Rest::Error => e
344
367
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,12 +421,13 @@ module Google
398
421
  # Customize the options with defaults
399
422
  call_metadata = @config.rpcs.get_dataset.metadata.to_h
400
423
 
401
- # Set x-goog-api-client and x-goog-user-project headers
424
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
402
425
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
403
426
  lib_name: @config.lib_name, lib_version: @config.lib_version,
404
427
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
405
428
  transports_version_send: [:rest]
406
429
 
430
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
407
431
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
408
432
 
409
433
  options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
@@ -416,7 +440,6 @@ module Google
416
440
 
417
441
  @auto_ml_stub.get_dataset request, options do |result, operation|
418
442
  yield result, operation if block_given?
419
- return result
420
443
  end
421
444
  rescue ::Gapic::Rest::Error => e
422
445
  raise ::Google::Cloud::Error.from_error(e)
@@ -497,12 +520,13 @@ module Google
497
520
  # Customize the options with defaults
498
521
  call_metadata = @config.rpcs.list_datasets.metadata.to_h
499
522
 
500
- # Set x-goog-api-client and x-goog-user-project headers
523
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
501
524
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
502
525
  lib_name: @config.lib_name, lib_version: @config.lib_version,
503
526
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
504
527
  transports_version_send: [:rest]
505
528
 
529
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
506
530
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
507
531
 
508
532
  options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
@@ -516,7 +540,7 @@ module Google
516
540
  @auto_ml_stub.list_datasets request, options do |result, operation|
517
541
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_datasets, "datasets", request, result, options
518
542
  yield result, operation if block_given?
519
- return result
543
+ throw :response, result
520
544
  end
521
545
  rescue ::Gapic::Rest::Error => e
522
546
  raise ::Google::Cloud::Error.from_error(e)
@@ -578,12 +602,13 @@ module Google
578
602
  # Customize the options with defaults
579
603
  call_metadata = @config.rpcs.update_dataset.metadata.to_h
580
604
 
581
- # Set x-goog-api-client and x-goog-user-project headers
605
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
582
606
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
583
607
  lib_name: @config.lib_name, lib_version: @config.lib_version,
584
608
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
585
609
  transports_version_send: [:rest]
586
610
 
611
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
587
612
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
588
613
 
589
614
  options.apply_defaults timeout: @config.rpcs.update_dataset.timeout,
@@ -596,7 +621,6 @@ module Google
596
621
 
597
622
  @auto_ml_stub.update_dataset request, options do |result, operation|
598
623
  yield result, operation if block_given?
599
- return result
600
624
  end
601
625
  rescue ::Gapic::Rest::Error => e
602
626
  raise ::Google::Cloud::Error.from_error(e)
@@ -667,12 +691,13 @@ module Google
667
691
  # Customize the options with defaults
668
692
  call_metadata = @config.rpcs.delete_dataset.metadata.to_h
669
693
 
670
- # Set x-goog-api-client and x-goog-user-project headers
694
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
671
695
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
672
696
  lib_name: @config.lib_name, lib_version: @config.lib_version,
673
697
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
674
698
  transports_version_send: [:rest]
675
699
 
700
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
676
701
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
677
702
 
678
703
  options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout,
@@ -686,7 +711,7 @@ module Google
686
711
  @auto_ml_stub.delete_dataset request, options do |result, operation|
687
712
  result = ::Gapic::Operation.new result, @operations_client, options: options
688
713
  yield result, operation if block_given?
689
- return result
714
+ throw :response, result
690
715
  end
691
716
  rescue ::Gapic::Rest::Error => e
692
717
  raise ::Google::Cloud::Error.from_error(e)
@@ -765,12 +790,13 @@ module Google
765
790
  # Customize the options with defaults
766
791
  call_metadata = @config.rpcs.import_data.metadata.to_h
767
792
 
768
- # Set x-goog-api-client and x-goog-user-project headers
793
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
769
794
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
770
795
  lib_name: @config.lib_name, lib_version: @config.lib_version,
771
796
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
772
797
  transports_version_send: [:rest]
773
798
 
799
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
774
800
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
775
801
 
776
802
  options.apply_defaults timeout: @config.rpcs.import_data.timeout,
@@ -784,7 +810,7 @@ module Google
784
810
  @auto_ml_stub.import_data request, options do |result, operation|
785
811
  result = ::Gapic::Operation.new result, @operations_client, options: options
786
812
  yield result, operation if block_given?
787
- return result
813
+ throw :response, result
788
814
  end
789
815
  rescue ::Gapic::Rest::Error => e
790
816
  raise ::Google::Cloud::Error.from_error(e)
@@ -855,12 +881,13 @@ module Google
855
881
  # Customize the options with defaults
856
882
  call_metadata = @config.rpcs.export_data.metadata.to_h
857
883
 
858
- # Set x-goog-api-client and x-goog-user-project headers
884
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
859
885
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
860
886
  lib_name: @config.lib_name, lib_version: @config.lib_version,
861
887
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
862
888
  transports_version_send: [:rest]
863
889
 
890
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
864
891
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
865
892
 
866
893
  options.apply_defaults timeout: @config.rpcs.export_data.timeout,
@@ -874,7 +901,7 @@ module Google
874
901
  @auto_ml_stub.export_data request, options do |result, operation|
875
902
  result = ::Gapic::Operation.new result, @operations_client, options: options
876
903
  yield result, operation if block_given?
877
- return result
904
+ throw :response, result
878
905
  end
879
906
  rescue ::Gapic::Rest::Error => e
880
907
  raise ::Google::Cloud::Error.from_error(e)
@@ -934,12 +961,13 @@ module Google
934
961
  # Customize the options with defaults
935
962
  call_metadata = @config.rpcs.get_annotation_spec.metadata.to_h
936
963
 
937
- # Set x-goog-api-client and x-goog-user-project headers
964
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
938
965
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
939
966
  lib_name: @config.lib_name, lib_version: @config.lib_version,
940
967
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
941
968
  transports_version_send: [:rest]
942
969
 
970
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
943
971
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
944
972
 
945
973
  options.apply_defaults timeout: @config.rpcs.get_annotation_spec.timeout,
@@ -952,7 +980,6 @@ module Google
952
980
 
953
981
  @auto_ml_stub.get_annotation_spec request, options do |result, operation|
954
982
  yield result, operation if block_given?
955
- return result
956
983
  end
957
984
  rescue ::Gapic::Rest::Error => e
958
985
  raise ::Google::Cloud::Error.from_error(e)
@@ -1014,12 +1041,13 @@ module Google
1014
1041
  # Customize the options with defaults
1015
1042
  call_metadata = @config.rpcs.get_table_spec.metadata.to_h
1016
1043
 
1017
- # Set x-goog-api-client and x-goog-user-project headers
1044
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1018
1045
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1019
1046
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1020
1047
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1021
1048
  transports_version_send: [:rest]
1022
1049
 
1050
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1023
1051
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1024
1052
 
1025
1053
  options.apply_defaults timeout: @config.rpcs.get_table_spec.timeout,
@@ -1032,7 +1060,6 @@ module Google
1032
1060
 
1033
1061
  @auto_ml_stub.get_table_spec request, options do |result, operation|
1034
1062
  yield result, operation if block_given?
1035
- return result
1036
1063
  end
1037
1064
  rescue ::Gapic::Rest::Error => e
1038
1065
  raise ::Google::Cloud::Error.from_error(e)
@@ -1108,12 +1135,13 @@ module Google
1108
1135
  # Customize the options with defaults
1109
1136
  call_metadata = @config.rpcs.list_table_specs.metadata.to_h
1110
1137
 
1111
- # Set x-goog-api-client and x-goog-user-project headers
1138
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1112
1139
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1113
1140
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1114
1141
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1115
1142
  transports_version_send: [:rest]
1116
1143
 
1144
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1117
1145
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1118
1146
 
1119
1147
  options.apply_defaults timeout: @config.rpcs.list_table_specs.timeout,
@@ -1127,7 +1155,7 @@ module Google
1127
1155
  @auto_ml_stub.list_table_specs request, options do |result, operation|
1128
1156
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_table_specs, "table_specs", request, result, options
1129
1157
  yield result, operation if block_given?
1130
- return result
1158
+ throw :response, result
1131
1159
  end
1132
1160
  rescue ::Gapic::Rest::Error => e
1133
1161
  raise ::Google::Cloud::Error.from_error(e)
@@ -1189,12 +1217,13 @@ module Google
1189
1217
  # Customize the options with defaults
1190
1218
  call_metadata = @config.rpcs.update_table_spec.metadata.to_h
1191
1219
 
1192
- # Set x-goog-api-client and x-goog-user-project headers
1220
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1193
1221
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1194
1222
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1195
1223
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1196
1224
  transports_version_send: [:rest]
1197
1225
 
1226
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1198
1227
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1199
1228
 
1200
1229
  options.apply_defaults timeout: @config.rpcs.update_table_spec.timeout,
@@ -1207,7 +1236,6 @@ module Google
1207
1236
 
1208
1237
  @auto_ml_stub.update_table_spec request, options do |result, operation|
1209
1238
  yield result, operation if block_given?
1210
- return result
1211
1239
  end
1212
1240
  rescue ::Gapic::Rest::Error => e
1213
1241
  raise ::Google::Cloud::Error.from_error(e)
@@ -1269,12 +1297,13 @@ module Google
1269
1297
  # Customize the options with defaults
1270
1298
  call_metadata = @config.rpcs.get_column_spec.metadata.to_h
1271
1299
 
1272
- # Set x-goog-api-client and x-goog-user-project headers
1300
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1273
1301
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1274
1302
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1275
1303
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1276
1304
  transports_version_send: [:rest]
1277
1305
 
1306
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1278
1307
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1279
1308
 
1280
1309
  options.apply_defaults timeout: @config.rpcs.get_column_spec.timeout,
@@ -1287,7 +1316,6 @@ module Google
1287
1316
 
1288
1317
  @auto_ml_stub.get_column_spec request, options do |result, operation|
1289
1318
  yield result, operation if block_given?
1290
- return result
1291
1319
  end
1292
1320
  rescue ::Gapic::Rest::Error => e
1293
1321
  raise ::Google::Cloud::Error.from_error(e)
@@ -1363,12 +1391,13 @@ module Google
1363
1391
  # Customize the options with defaults
1364
1392
  call_metadata = @config.rpcs.list_column_specs.metadata.to_h
1365
1393
 
1366
- # Set x-goog-api-client and x-goog-user-project headers
1394
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1367
1395
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1368
1396
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1369
1397
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1370
1398
  transports_version_send: [:rest]
1371
1399
 
1400
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1372
1401
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1373
1402
 
1374
1403
  options.apply_defaults timeout: @config.rpcs.list_column_specs.timeout,
@@ -1382,7 +1411,7 @@ module Google
1382
1411
  @auto_ml_stub.list_column_specs request, options do |result, operation|
1383
1412
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_column_specs, "column_specs", request, result, options
1384
1413
  yield result, operation if block_given?
1385
- return result
1414
+ throw :response, result
1386
1415
  end
1387
1416
  rescue ::Gapic::Rest::Error => e
1388
1417
  raise ::Google::Cloud::Error.from_error(e)
@@ -1444,12 +1473,13 @@ module Google
1444
1473
  # Customize the options with defaults
1445
1474
  call_metadata = @config.rpcs.update_column_spec.metadata.to_h
1446
1475
 
1447
- # Set x-goog-api-client and x-goog-user-project headers
1476
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1448
1477
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1449
1478
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1450
1479
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1451
1480
  transports_version_send: [:rest]
1452
1481
 
1482
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1453
1483
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1454
1484
 
1455
1485
  options.apply_defaults timeout: @config.rpcs.update_column_spec.timeout,
@@ -1462,7 +1492,6 @@ module Google
1462
1492
 
1463
1493
  @auto_ml_stub.update_column_spec request, options do |result, operation|
1464
1494
  yield result, operation if block_given?
1465
- return result
1466
1495
  end
1467
1496
  rescue ::Gapic::Rest::Error => e
1468
1497
  raise ::Google::Cloud::Error.from_error(e)
@@ -1535,12 +1564,13 @@ module Google
1535
1564
  # Customize the options with defaults
1536
1565
  call_metadata = @config.rpcs.create_model.metadata.to_h
1537
1566
 
1538
- # Set x-goog-api-client and x-goog-user-project headers
1567
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1539
1568
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1540
1569
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1541
1570
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1542
1571
  transports_version_send: [:rest]
1543
1572
 
1573
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1544
1574
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1545
1575
 
1546
1576
  options.apply_defaults timeout: @config.rpcs.create_model.timeout,
@@ -1554,7 +1584,7 @@ module Google
1554
1584
  @auto_ml_stub.create_model request, options do |result, operation|
1555
1585
  result = ::Gapic::Operation.new result, @operations_client, options: options
1556
1586
  yield result, operation if block_given?
1557
- return result
1587
+ throw :response, result
1558
1588
  end
1559
1589
  rescue ::Gapic::Rest::Error => e
1560
1590
  raise ::Google::Cloud::Error.from_error(e)
@@ -1614,12 +1644,13 @@ module Google
1614
1644
  # Customize the options with defaults
1615
1645
  call_metadata = @config.rpcs.get_model.metadata.to_h
1616
1646
 
1617
- # Set x-goog-api-client and x-goog-user-project headers
1647
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1618
1648
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1619
1649
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1620
1650
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1621
1651
  transports_version_send: [:rest]
1622
1652
 
1653
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1623
1654
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1624
1655
 
1625
1656
  options.apply_defaults timeout: @config.rpcs.get_model.timeout,
@@ -1632,7 +1663,6 @@ module Google
1632
1663
 
1633
1664
  @auto_ml_stub.get_model request, options do |result, operation|
1634
1665
  yield result, operation if block_given?
1635
- return result
1636
1666
  end
1637
1667
  rescue ::Gapic::Rest::Error => e
1638
1668
  raise ::Google::Cloud::Error.from_error(e)
@@ -1713,12 +1743,13 @@ module Google
1713
1743
  # Customize the options with defaults
1714
1744
  call_metadata = @config.rpcs.list_models.metadata.to_h
1715
1745
 
1716
- # Set x-goog-api-client and x-goog-user-project headers
1746
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1717
1747
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1718
1748
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1719
1749
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1720
1750
  transports_version_send: [:rest]
1721
1751
 
1752
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1722
1753
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1723
1754
 
1724
1755
  options.apply_defaults timeout: @config.rpcs.list_models.timeout,
@@ -1732,7 +1763,7 @@ module Google
1732
1763
  @auto_ml_stub.list_models request, options do |result, operation|
1733
1764
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_models, "model", request, result, options
1734
1765
  yield result, operation if block_given?
1735
- return result
1766
+ throw :response, result
1736
1767
  end
1737
1768
  rescue ::Gapic::Rest::Error => e
1738
1769
  raise ::Google::Cloud::Error.from_error(e)
@@ -1803,12 +1834,13 @@ module Google
1803
1834
  # Customize the options with defaults
1804
1835
  call_metadata = @config.rpcs.delete_model.metadata.to_h
1805
1836
 
1806
- # Set x-goog-api-client and x-goog-user-project headers
1837
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1807
1838
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1808
1839
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1809
1840
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1810
1841
  transports_version_send: [:rest]
1811
1842
 
1843
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1812
1844
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1813
1845
 
1814
1846
  options.apply_defaults timeout: @config.rpcs.delete_model.timeout,
@@ -1822,7 +1854,7 @@ module Google
1822
1854
  @auto_ml_stub.delete_model request, options do |result, operation|
1823
1855
  result = ::Gapic::Operation.new result, @operations_client, options: options
1824
1856
  yield result, operation if block_given?
1825
- return result
1857
+ throw :response, result
1826
1858
  end
1827
1859
  rescue ::Gapic::Rest::Error => e
1828
1860
  raise ::Google::Cloud::Error.from_error(e)
@@ -1904,12 +1936,13 @@ module Google
1904
1936
  # Customize the options with defaults
1905
1937
  call_metadata = @config.rpcs.deploy_model.metadata.to_h
1906
1938
 
1907
- # Set x-goog-api-client and x-goog-user-project headers
1939
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1908
1940
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1909
1941
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1910
1942
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
1911
1943
  transports_version_send: [:rest]
1912
1944
 
1945
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1913
1946
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1914
1947
 
1915
1948
  options.apply_defaults timeout: @config.rpcs.deploy_model.timeout,
@@ -1923,7 +1956,7 @@ module Google
1923
1956
  @auto_ml_stub.deploy_model request, options do |result, operation|
1924
1957
  result = ::Gapic::Operation.new result, @operations_client, options: options
1925
1958
  yield result, operation if block_given?
1926
- return result
1959
+ throw :response, result
1927
1960
  end
1928
1961
  rescue ::Gapic::Rest::Error => e
1929
1962
  raise ::Google::Cloud::Error.from_error(e)
@@ -1996,12 +2029,13 @@ module Google
1996
2029
  # Customize the options with defaults
1997
2030
  call_metadata = @config.rpcs.undeploy_model.metadata.to_h
1998
2031
 
1999
- # Set x-goog-api-client and x-goog-user-project headers
2032
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2000
2033
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2001
2034
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2002
2035
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
2003
2036
  transports_version_send: [:rest]
2004
2037
 
2038
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2005
2039
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2006
2040
 
2007
2041
  options.apply_defaults timeout: @config.rpcs.undeploy_model.timeout,
@@ -2015,7 +2049,7 @@ module Google
2015
2049
  @auto_ml_stub.undeploy_model request, options do |result, operation|
2016
2050
  result = ::Gapic::Operation.new result, @operations_client, options: options
2017
2051
  yield result, operation if block_given?
2018
- return result
2052
+ throw :response, result
2019
2053
  end
2020
2054
  rescue ::Gapic::Rest::Error => e
2021
2055
  raise ::Google::Cloud::Error.from_error(e)
@@ -2091,12 +2125,13 @@ module Google
2091
2125
  # Customize the options with defaults
2092
2126
  call_metadata = @config.rpcs.export_model.metadata.to_h
2093
2127
 
2094
- # Set x-goog-api-client and x-goog-user-project headers
2128
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2095
2129
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2096
2130
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2097
2131
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
2098
2132
  transports_version_send: [:rest]
2099
2133
 
2134
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2100
2135
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2101
2136
 
2102
2137
  options.apply_defaults timeout: @config.rpcs.export_model.timeout,
@@ -2110,7 +2145,7 @@ module Google
2110
2145
  @auto_ml_stub.export_model request, options do |result, operation|
2111
2146
  result = ::Gapic::Operation.new result, @operations_client, options: options
2112
2147
  yield result, operation if block_given?
2113
- return result
2148
+ throw :response, result
2114
2149
  end
2115
2150
  rescue ::Gapic::Rest::Error => e
2116
2151
  raise ::Google::Cloud::Error.from_error(e)
@@ -2193,12 +2228,13 @@ module Google
2193
2228
  # Customize the options with defaults
2194
2229
  call_metadata = @config.rpcs.export_evaluated_examples.metadata.to_h
2195
2230
 
2196
- # Set x-goog-api-client and x-goog-user-project headers
2231
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2197
2232
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2198
2233
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2199
2234
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
2200
2235
  transports_version_send: [:rest]
2201
2236
 
2237
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2202
2238
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2203
2239
 
2204
2240
  options.apply_defaults timeout: @config.rpcs.export_evaluated_examples.timeout,
@@ -2212,7 +2248,7 @@ module Google
2212
2248
  @auto_ml_stub.export_evaluated_examples request, options do |result, operation|
2213
2249
  result = ::Gapic::Operation.new result, @operations_client, options: options
2214
2250
  yield result, operation if block_given?
2215
- return result
2251
+ throw :response, result
2216
2252
  end
2217
2253
  rescue ::Gapic::Rest::Error => e
2218
2254
  raise ::Google::Cloud::Error.from_error(e)
@@ -2272,12 +2308,13 @@ module Google
2272
2308
  # Customize the options with defaults
2273
2309
  call_metadata = @config.rpcs.get_model_evaluation.metadata.to_h
2274
2310
 
2275
- # Set x-goog-api-client and x-goog-user-project headers
2311
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2276
2312
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2277
2313
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2278
2314
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
2279
2315
  transports_version_send: [:rest]
2280
2316
 
2317
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2281
2318
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2282
2319
 
2283
2320
  options.apply_defaults timeout: @config.rpcs.get_model_evaluation.timeout,
@@ -2290,7 +2327,6 @@ module Google
2290
2327
 
2291
2328
  @auto_ml_stub.get_model_evaluation request, options do |result, operation|
2292
2329
  yield result, operation if block_given?
2293
- return result
2294
2330
  end
2295
2331
  rescue ::Gapic::Rest::Error => e
2296
2332
  raise ::Google::Cloud::Error.from_error(e)
@@ -2375,12 +2411,13 @@ module Google
2375
2411
  # Customize the options with defaults
2376
2412
  call_metadata = @config.rpcs.list_model_evaluations.metadata.to_h
2377
2413
 
2378
- # Set x-goog-api-client and x-goog-user-project headers
2414
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2379
2415
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2380
2416
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2381
2417
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION,
2382
2418
  transports_version_send: [:rest]
2383
2419
 
2420
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2384
2421
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2385
2422
 
2386
2423
  options.apply_defaults timeout: @config.rpcs.list_model_evaluations.timeout,
@@ -2394,7 +2431,7 @@ module Google
2394
2431
  @auto_ml_stub.list_model_evaluations request, options do |result, operation|
2395
2432
  result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, "model_evaluation", request, result, options
2396
2433
  yield result, operation if block_given?
2397
- return result
2434
+ throw :response, result
2398
2435
  end
2399
2436
  rescue ::Gapic::Rest::Error => e
2400
2437
  raise ::Google::Cloud::Error.from_error(e)
@@ -2474,6 +2511,11 @@ module Google
2474
2511
  # default endpoint URL. The default value of nil uses the environment
2475
2512
  # universe (usually the default "googleapis.com" universe).
2476
2513
  # @return [::String,nil]
2514
+ # @!attribute [rw] logger
2515
+ # A custom logger to use for request/response debug logging, or the value
2516
+ # `:default` (the default) to construct a default logger, or `nil` to
2517
+ # explicitly disable logging.
2518
+ # @return [::Logger,:default,nil]
2477
2519
  #
2478
2520
  class Configuration
2479
2521
  extend ::Gapic::Config
@@ -2495,6 +2537,7 @@ module Google
2495
2537
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2496
2538
  config_attr :quota_project, nil, ::String, nil
2497
2539
  config_attr :universe_domain, nil, ::String, nil
2540
+ config_attr :logger, :default, ::Logger, nil, :default
2498
2541
 
2499
2542
  # @private
2500
2543
  def initialize parent_config = nil