google-cloud-app_hub-v1 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,9 @@ module Google
32
32
  # The App Hub API allows you to manage App Hub resources.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "apphub.$UNIVERSE_DOMAIN$"
37
40
 
@@ -262,14 +265,26 @@ module Google
262
265
  universe_domain: @config.universe_domain,
263
266
  channel_args: @config.channel_args,
264
267
  interceptors: @config.interceptors,
265
- channel_pool_config: @config.channel_pool
268
+ channel_pool_config: @config.channel_pool,
269
+ logger: @config.logger
266
270
  )
267
271
 
272
+ @app_hub_stub.stub_logger&.info do |entry|
273
+ entry.set_system_name
274
+ entry.set_service
275
+ entry.message = "Created client for #{entry.service}"
276
+ entry.set_credentials_fields credentials
277
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
278
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
279
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
280
+ end
281
+
268
282
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
269
283
  config.credentials = credentials
270
284
  config.quota_project = @quota_project_id
271
285
  config.endpoint = @app_hub_stub.endpoint
272
286
  config.universe_domain = @app_hub_stub.universe_domain
287
+ config.logger = @app_hub_stub.logger if config.respond_to? :logger=
273
288
  end
274
289
 
275
290
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -277,6 +292,7 @@ module Google
277
292
  config.quota_project = @quota_project_id
278
293
  config.endpoint = @app_hub_stub.endpoint
279
294
  config.universe_domain = @app_hub_stub.universe_domain
295
+ config.logger = @app_hub_stub.logger if config.respond_to? :logger=
280
296
  end
281
297
  end
282
298
 
@@ -301,6 +317,15 @@ module Google
301
317
  #
302
318
  attr_reader :iam_policy_client
303
319
 
320
+ ##
321
+ # The logger used for request/response debug logging.
322
+ #
323
+ # @return [Logger]
324
+ #
325
+ def logger
326
+ @app_hub_stub.logger
327
+ end
328
+
304
329
  # Service calls
305
330
 
306
331
  ##
@@ -361,10 +386,11 @@ module Google
361
386
  # Customize the options with defaults
362
387
  metadata = @config.rpcs.lookup_service_project_attachment.metadata.to_h
363
388
 
364
- # Set x-goog-api-client and x-goog-user-project headers
389
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
365
390
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
366
391
  lib_name: @config.lib_name, lib_version: @config.lib_version,
367
392
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
393
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
368
394
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
369
395
 
370
396
  header_params = {}
@@ -385,7 +411,6 @@ module Google
385
411
 
386
412
  @app_hub_stub.call_rpc :lookup_service_project_attachment, request, options: options do |response, operation|
387
413
  yield response, operation if block_given?
388
- return response
389
414
  end
390
415
  rescue ::GRPC::BadStatus => e
391
416
  raise ::Google::Cloud::Error.from_error(e)
@@ -461,10 +486,11 @@ module Google
461
486
  # Customize the options with defaults
462
487
  metadata = @config.rpcs.list_service_project_attachments.metadata.to_h
463
488
 
464
- # Set x-goog-api-client and x-goog-user-project headers
489
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
465
490
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
466
491
  lib_name: @config.lib_name, lib_version: @config.lib_version,
467
492
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
493
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
468
494
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
469
495
 
470
496
  header_params = {}
@@ -486,7 +512,7 @@ module Google
486
512
  @app_hub_stub.call_rpc :list_service_project_attachments, request, options: options do |response, operation|
487
513
  response = ::Gapic::PagedEnumerable.new @app_hub_stub, :list_service_project_attachments, request, response, operation, options
488
514
  yield response, operation if block_given?
489
- return response
515
+ throw :response, response
490
516
  end
491
517
  rescue ::GRPC::BadStatus => e
492
518
  raise ::Google::Cloud::Error.from_error(e)
@@ -576,10 +602,11 @@ module Google
576
602
  # Customize the options with defaults
577
603
  metadata = @config.rpcs.create_service_project_attachment.metadata.to_h
578
604
 
579
- # 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
580
606
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
581
607
  lib_name: @config.lib_name, lib_version: @config.lib_version,
582
608
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
609
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
583
610
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
584
611
 
585
612
  header_params = {}
@@ -601,7 +628,7 @@ module Google
601
628
  @app_hub_stub.call_rpc :create_service_project_attachment, request, options: options do |response, operation|
602
629
  response = ::Gapic::Operation.new response, @operations_client, options: options
603
630
  yield response, operation if block_given?
604
- return response
631
+ throw :response, response
605
632
  end
606
633
  rescue ::GRPC::BadStatus => e
607
634
  raise ::Google::Cloud::Error.from_error(e)
@@ -664,10 +691,11 @@ module Google
664
691
  # Customize the options with defaults
665
692
  metadata = @config.rpcs.get_service_project_attachment.metadata.to_h
666
693
 
667
- # 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
668
695
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
669
696
  lib_name: @config.lib_name, lib_version: @config.lib_version,
670
697
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
698
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
671
699
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
672
700
 
673
701
  header_params = {}
@@ -688,7 +716,6 @@ module Google
688
716
 
689
717
  @app_hub_stub.call_rpc :get_service_project_attachment, request, options: options do |response, operation|
690
718
  yield response, operation if block_given?
691
- return response
692
719
  end
693
720
  rescue ::GRPC::BadStatus => e
694
721
  raise ::Google::Cloud::Error.from_error(e)
@@ -772,10 +799,11 @@ module Google
772
799
  # Customize the options with defaults
773
800
  metadata = @config.rpcs.delete_service_project_attachment.metadata.to_h
774
801
 
775
- # Set x-goog-api-client and x-goog-user-project headers
802
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
776
803
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
777
804
  lib_name: @config.lib_name, lib_version: @config.lib_version,
778
805
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
806
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
779
807
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
780
808
 
781
809
  header_params = {}
@@ -797,7 +825,7 @@ module Google
797
825
  @app_hub_stub.call_rpc :delete_service_project_attachment, request, options: options do |response, operation|
798
826
  response = ::Gapic::Operation.new response, @operations_client, options: options
799
827
  yield response, operation if block_given?
800
- return response
828
+ throw :response, response
801
829
  end
802
830
  rescue ::GRPC::BadStatus => e
803
831
  raise ::Google::Cloud::Error.from_error(e)
@@ -862,10 +890,11 @@ module Google
862
890
  # Customize the options with defaults
863
891
  metadata = @config.rpcs.detach_service_project_attachment.metadata.to_h
864
892
 
865
- # Set x-goog-api-client and x-goog-user-project headers
893
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
866
894
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
867
895
  lib_name: @config.lib_name, lib_version: @config.lib_version,
868
896
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
897
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
869
898
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
870
899
 
871
900
  header_params = {}
@@ -886,7 +915,6 @@ module Google
886
915
 
887
916
  @app_hub_stub.call_rpc :detach_service_project_attachment, request, options: options do |response, operation|
888
917
  yield response, operation if block_given?
889
- return response
890
918
  end
891
919
  rescue ::GRPC::BadStatus => e
892
920
  raise ::Google::Cloud::Error.from_error(e)
@@ -962,10 +990,11 @@ module Google
962
990
  # Customize the options with defaults
963
991
  metadata = @config.rpcs.list_discovered_services.metadata.to_h
964
992
 
965
- # Set x-goog-api-client and x-goog-user-project headers
993
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
966
994
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
967
995
  lib_name: @config.lib_name, lib_version: @config.lib_version,
968
996
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
997
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
969
998
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
970
999
 
971
1000
  header_params = {}
@@ -987,7 +1016,7 @@ module Google
987
1016
  @app_hub_stub.call_rpc :list_discovered_services, request, options: options do |response, operation|
988
1017
  response = ::Gapic::PagedEnumerable.new @app_hub_stub, :list_discovered_services, request, response, operation, options
989
1018
  yield response, operation if block_given?
990
- return response
1019
+ throw :response, response
991
1020
  end
992
1021
  rescue ::GRPC::BadStatus => e
993
1022
  raise ::Google::Cloud::Error.from_error(e)
@@ -1050,10 +1079,11 @@ module Google
1050
1079
  # Customize the options with defaults
1051
1080
  metadata = @config.rpcs.get_discovered_service.metadata.to_h
1052
1081
 
1053
- # Set x-goog-api-client and x-goog-user-project headers
1082
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1054
1083
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1055
1084
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1056
1085
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1086
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1057
1087
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1058
1088
 
1059
1089
  header_params = {}
@@ -1074,7 +1104,6 @@ module Google
1074
1104
 
1075
1105
  @app_hub_stub.call_rpc :get_discovered_service, request, options: options do |response, operation|
1076
1106
  yield response, operation if block_given?
1077
- return response
1078
1107
  end
1079
1108
  rescue ::GRPC::BadStatus => e
1080
1109
  raise ::Google::Cloud::Error.from_error(e)
@@ -1141,10 +1170,11 @@ module Google
1141
1170
  # Customize the options with defaults
1142
1171
  metadata = @config.rpcs.lookup_discovered_service.metadata.to_h
1143
1172
 
1144
- # Set x-goog-api-client and x-goog-user-project headers
1173
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1145
1174
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1146
1175
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1147
1176
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1177
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1148
1178
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1149
1179
 
1150
1180
  header_params = {}
@@ -1165,7 +1195,6 @@ module Google
1165
1195
 
1166
1196
  @app_hub_stub.call_rpc :lookup_discovered_service, request, options: options do |response, operation|
1167
1197
  yield response, operation if block_given?
1168
- return response
1169
1198
  end
1170
1199
  rescue ::GRPC::BadStatus => e
1171
1200
  raise ::Google::Cloud::Error.from_error(e)
@@ -1241,10 +1270,11 @@ module Google
1241
1270
  # Customize the options with defaults
1242
1271
  metadata = @config.rpcs.list_services.metadata.to_h
1243
1272
 
1244
- # Set x-goog-api-client and x-goog-user-project headers
1273
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1245
1274
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1246
1275
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1247
1276
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1277
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1248
1278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1249
1279
 
1250
1280
  header_params = {}
@@ -1266,7 +1296,7 @@ module Google
1266
1296
  @app_hub_stub.call_rpc :list_services, request, options: options do |response, operation|
1267
1297
  response = ::Gapic::PagedEnumerable.new @app_hub_stub, :list_services, request, response, operation, options
1268
1298
  yield response, operation if block_given?
1269
- return response
1299
+ throw :response, response
1270
1300
  end
1271
1301
  rescue ::GRPC::BadStatus => e
1272
1302
  raise ::Google::Cloud::Error.from_error(e)
@@ -1357,10 +1387,11 @@ module Google
1357
1387
  # Customize the options with defaults
1358
1388
  metadata = @config.rpcs.create_service.metadata.to_h
1359
1389
 
1360
- # Set x-goog-api-client and x-goog-user-project headers
1390
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1361
1391
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1362
1392
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1363
1393
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1394
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1364
1395
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1365
1396
 
1366
1397
  header_params = {}
@@ -1382,7 +1413,7 @@ module Google
1382
1413
  @app_hub_stub.call_rpc :create_service, request, options: options do |response, operation|
1383
1414
  response = ::Gapic::Operation.new response, @operations_client, options: options
1384
1415
  yield response, operation if block_given?
1385
- return response
1416
+ throw :response, response
1386
1417
  end
1387
1418
  rescue ::GRPC::BadStatus => e
1388
1419
  raise ::Google::Cloud::Error.from_error(e)
@@ -1445,10 +1476,11 @@ module Google
1445
1476
  # Customize the options with defaults
1446
1477
  metadata = @config.rpcs.get_service.metadata.to_h
1447
1478
 
1448
- # Set x-goog-api-client and x-goog-user-project headers
1479
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1449
1480
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1450
1481
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1451
1482
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1483
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1452
1484
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1453
1485
 
1454
1486
  header_params = {}
@@ -1469,7 +1501,6 @@ module Google
1469
1501
 
1470
1502
  @app_hub_stub.call_rpc :get_service, request, options: options do |response, operation|
1471
1503
  yield response, operation if block_given?
1472
- return response
1473
1504
  end
1474
1505
  rescue ::GRPC::BadStatus => e
1475
1506
  raise ::Google::Cloud::Error.from_error(e)
@@ -1561,10 +1592,11 @@ module Google
1561
1592
  # Customize the options with defaults
1562
1593
  metadata = @config.rpcs.update_service.metadata.to_h
1563
1594
 
1564
- # Set x-goog-api-client and x-goog-user-project headers
1595
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1565
1596
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1566
1597
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1567
1598
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1599
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1568
1600
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1569
1601
 
1570
1602
  header_params = {}
@@ -1586,7 +1618,7 @@ module Google
1586
1618
  @app_hub_stub.call_rpc :update_service, request, options: options do |response, operation|
1587
1619
  response = ::Gapic::Operation.new response, @operations_client, options: options
1588
1620
  yield response, operation if block_given?
1589
- return response
1621
+ throw :response, response
1590
1622
  end
1591
1623
  rescue ::GRPC::BadStatus => e
1592
1624
  raise ::Google::Cloud::Error.from_error(e)
@@ -1670,10 +1702,11 @@ module Google
1670
1702
  # Customize the options with defaults
1671
1703
  metadata = @config.rpcs.delete_service.metadata.to_h
1672
1704
 
1673
- # Set x-goog-api-client and x-goog-user-project headers
1705
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1674
1706
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1675
1707
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1676
1708
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1709
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1677
1710
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1678
1711
 
1679
1712
  header_params = {}
@@ -1695,7 +1728,7 @@ module Google
1695
1728
  @app_hub_stub.call_rpc :delete_service, request, options: options do |response, operation|
1696
1729
  response = ::Gapic::Operation.new response, @operations_client, options: options
1697
1730
  yield response, operation if block_given?
1698
- return response
1731
+ throw :response, response
1699
1732
  end
1700
1733
  rescue ::GRPC::BadStatus => e
1701
1734
  raise ::Google::Cloud::Error.from_error(e)
@@ -1771,10 +1804,11 @@ module Google
1771
1804
  # Customize the options with defaults
1772
1805
  metadata = @config.rpcs.list_discovered_workloads.metadata.to_h
1773
1806
 
1774
- # Set x-goog-api-client and x-goog-user-project headers
1807
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1775
1808
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1776
1809
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1777
1810
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1811
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1778
1812
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1779
1813
 
1780
1814
  header_params = {}
@@ -1796,7 +1830,7 @@ module Google
1796
1830
  @app_hub_stub.call_rpc :list_discovered_workloads, request, options: options do |response, operation|
1797
1831
  response = ::Gapic::PagedEnumerable.new @app_hub_stub, :list_discovered_workloads, request, response, operation, options
1798
1832
  yield response, operation if block_given?
1799
- return response
1833
+ throw :response, response
1800
1834
  end
1801
1835
  rescue ::GRPC::BadStatus => e
1802
1836
  raise ::Google::Cloud::Error.from_error(e)
@@ -1859,10 +1893,11 @@ module Google
1859
1893
  # Customize the options with defaults
1860
1894
  metadata = @config.rpcs.get_discovered_workload.metadata.to_h
1861
1895
 
1862
- # Set x-goog-api-client and x-goog-user-project headers
1896
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1863
1897
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1864
1898
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1865
1899
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1900
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1866
1901
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1867
1902
 
1868
1903
  header_params = {}
@@ -1883,7 +1918,6 @@ module Google
1883
1918
 
1884
1919
  @app_hub_stub.call_rpc :get_discovered_workload, request, options: options do |response, operation|
1885
1920
  yield response, operation if block_given?
1886
- return response
1887
1921
  end
1888
1922
  rescue ::GRPC::BadStatus => e
1889
1923
  raise ::Google::Cloud::Error.from_error(e)
@@ -1950,10 +1984,11 @@ module Google
1950
1984
  # Customize the options with defaults
1951
1985
  metadata = @config.rpcs.lookup_discovered_workload.metadata.to_h
1952
1986
 
1953
- # Set x-goog-api-client and x-goog-user-project headers
1987
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1954
1988
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1955
1989
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1956
1990
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
1991
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1957
1992
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1958
1993
 
1959
1994
  header_params = {}
@@ -1974,7 +2009,6 @@ module Google
1974
2009
 
1975
2010
  @app_hub_stub.call_rpc :lookup_discovered_workload, request, options: options do |response, operation|
1976
2011
  yield response, operation if block_given?
1977
- return response
1978
2012
  end
1979
2013
  rescue ::GRPC::BadStatus => e
1980
2014
  raise ::Google::Cloud::Error.from_error(e)
@@ -2050,10 +2084,11 @@ module Google
2050
2084
  # Customize the options with defaults
2051
2085
  metadata = @config.rpcs.list_workloads.metadata.to_h
2052
2086
 
2053
- # Set x-goog-api-client and x-goog-user-project headers
2087
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2054
2088
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2055
2089
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2056
2090
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2091
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2057
2092
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2058
2093
 
2059
2094
  header_params = {}
@@ -2075,7 +2110,7 @@ module Google
2075
2110
  @app_hub_stub.call_rpc :list_workloads, request, options: options do |response, operation|
2076
2111
  response = ::Gapic::PagedEnumerable.new @app_hub_stub, :list_workloads, request, response, operation, options
2077
2112
  yield response, operation if block_given?
2078
- return response
2113
+ throw :response, response
2079
2114
  end
2080
2115
  rescue ::GRPC::BadStatus => e
2081
2116
  raise ::Google::Cloud::Error.from_error(e)
@@ -2166,10 +2201,11 @@ module Google
2166
2201
  # Customize the options with defaults
2167
2202
  metadata = @config.rpcs.create_workload.metadata.to_h
2168
2203
 
2169
- # Set x-goog-api-client and x-goog-user-project headers
2204
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2170
2205
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2171
2206
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2172
2207
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2208
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2173
2209
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2174
2210
 
2175
2211
  header_params = {}
@@ -2191,7 +2227,7 @@ module Google
2191
2227
  @app_hub_stub.call_rpc :create_workload, request, options: options do |response, operation|
2192
2228
  response = ::Gapic::Operation.new response, @operations_client, options: options
2193
2229
  yield response, operation if block_given?
2194
- return response
2230
+ throw :response, response
2195
2231
  end
2196
2232
  rescue ::GRPC::BadStatus => e
2197
2233
  raise ::Google::Cloud::Error.from_error(e)
@@ -2254,10 +2290,11 @@ module Google
2254
2290
  # Customize the options with defaults
2255
2291
  metadata = @config.rpcs.get_workload.metadata.to_h
2256
2292
 
2257
- # Set x-goog-api-client and x-goog-user-project headers
2293
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2258
2294
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2259
2295
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2260
2296
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2297
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2261
2298
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2262
2299
 
2263
2300
  header_params = {}
@@ -2278,7 +2315,6 @@ module Google
2278
2315
 
2279
2316
  @app_hub_stub.call_rpc :get_workload, request, options: options do |response, operation|
2280
2317
  yield response, operation if block_given?
2281
- return response
2282
2318
  end
2283
2319
  rescue ::GRPC::BadStatus => e
2284
2320
  raise ::Google::Cloud::Error.from_error(e)
@@ -2370,10 +2406,11 @@ module Google
2370
2406
  # Customize the options with defaults
2371
2407
  metadata = @config.rpcs.update_workload.metadata.to_h
2372
2408
 
2373
- # Set x-goog-api-client and x-goog-user-project headers
2409
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2374
2410
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2375
2411
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2376
2412
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2413
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2377
2414
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2378
2415
 
2379
2416
  header_params = {}
@@ -2395,7 +2432,7 @@ module Google
2395
2432
  @app_hub_stub.call_rpc :update_workload, request, options: options do |response, operation|
2396
2433
  response = ::Gapic::Operation.new response, @operations_client, options: options
2397
2434
  yield response, operation if block_given?
2398
- return response
2435
+ throw :response, response
2399
2436
  end
2400
2437
  rescue ::GRPC::BadStatus => e
2401
2438
  raise ::Google::Cloud::Error.from_error(e)
@@ -2479,10 +2516,11 @@ module Google
2479
2516
  # Customize the options with defaults
2480
2517
  metadata = @config.rpcs.delete_workload.metadata.to_h
2481
2518
 
2482
- # Set x-goog-api-client and x-goog-user-project headers
2519
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2483
2520
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2484
2521
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2485
2522
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2523
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2486
2524
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2487
2525
 
2488
2526
  header_params = {}
@@ -2504,7 +2542,7 @@ module Google
2504
2542
  @app_hub_stub.call_rpc :delete_workload, request, options: options do |response, operation|
2505
2543
  response = ::Gapic::Operation.new response, @operations_client, options: options
2506
2544
  yield response, operation if block_given?
2507
- return response
2545
+ throw :response, response
2508
2546
  end
2509
2547
  rescue ::GRPC::BadStatus => e
2510
2548
  raise ::Google::Cloud::Error.from_error(e)
@@ -2579,10 +2617,11 @@ module Google
2579
2617
  # Customize the options with defaults
2580
2618
  metadata = @config.rpcs.list_applications.metadata.to_h
2581
2619
 
2582
- # Set x-goog-api-client and x-goog-user-project headers
2620
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2583
2621
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2584
2622
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2585
2623
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2624
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2586
2625
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2587
2626
 
2588
2627
  header_params = {}
@@ -2604,7 +2643,7 @@ module Google
2604
2643
  @app_hub_stub.call_rpc :list_applications, request, options: options do |response, operation|
2605
2644
  response = ::Gapic::PagedEnumerable.new @app_hub_stub, :list_applications, request, response, operation, options
2606
2645
  yield response, operation if block_given?
2607
- return response
2646
+ throw :response, response
2608
2647
  end
2609
2648
  rescue ::GRPC::BadStatus => e
2610
2649
  raise ::Google::Cloud::Error.from_error(e)
@@ -2694,10 +2733,11 @@ module Google
2694
2733
  # Customize the options with defaults
2695
2734
  metadata = @config.rpcs.create_application.metadata.to_h
2696
2735
 
2697
- # Set x-goog-api-client and x-goog-user-project headers
2736
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2698
2737
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2699
2738
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2700
2739
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2740
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2701
2741
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2702
2742
 
2703
2743
  header_params = {}
@@ -2719,7 +2759,7 @@ module Google
2719
2759
  @app_hub_stub.call_rpc :create_application, request, options: options do |response, operation|
2720
2760
  response = ::Gapic::Operation.new response, @operations_client, options: options
2721
2761
  yield response, operation if block_given?
2722
- return response
2762
+ throw :response, response
2723
2763
  end
2724
2764
  rescue ::GRPC::BadStatus => e
2725
2765
  raise ::Google::Cloud::Error.from_error(e)
@@ -2782,10 +2822,11 @@ module Google
2782
2822
  # Customize the options with defaults
2783
2823
  metadata = @config.rpcs.get_application.metadata.to_h
2784
2824
 
2785
- # Set x-goog-api-client and x-goog-user-project headers
2825
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2786
2826
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2787
2827
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2788
2828
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2829
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2789
2830
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2790
2831
 
2791
2832
  header_params = {}
@@ -2806,7 +2847,6 @@ module Google
2806
2847
 
2807
2848
  @app_hub_stub.call_rpc :get_application, request, options: options do |response, operation|
2808
2849
  yield response, operation if block_given?
2809
- return response
2810
2850
  end
2811
2851
  rescue ::GRPC::BadStatus => e
2812
2852
  raise ::Google::Cloud::Error.from_error(e)
@@ -2898,10 +2938,11 @@ module Google
2898
2938
  # Customize the options with defaults
2899
2939
  metadata = @config.rpcs.update_application.metadata.to_h
2900
2940
 
2901
- # Set x-goog-api-client and x-goog-user-project headers
2941
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2902
2942
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2903
2943
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2904
2944
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
2945
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2905
2946
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2906
2947
 
2907
2948
  header_params = {}
@@ -2923,7 +2964,7 @@ module Google
2923
2964
  @app_hub_stub.call_rpc :update_application, request, options: options do |response, operation|
2924
2965
  response = ::Gapic::Operation.new response, @operations_client, options: options
2925
2966
  yield response, operation if block_given?
2926
- return response
2967
+ throw :response, response
2927
2968
  end
2928
2969
  rescue ::GRPC::BadStatus => e
2929
2970
  raise ::Google::Cloud::Error.from_error(e)
@@ -3007,10 +3048,11 @@ module Google
3007
3048
  # Customize the options with defaults
3008
3049
  metadata = @config.rpcs.delete_application.metadata.to_h
3009
3050
 
3010
- # Set x-goog-api-client and x-goog-user-project headers
3051
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3011
3052
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3012
3053
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3013
3054
  gapic_version: ::Google::Cloud::AppHub::V1::VERSION
3055
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3014
3056
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3015
3057
 
3016
3058
  header_params = {}
@@ -3032,7 +3074,7 @@ module Google
3032
3074
  @app_hub_stub.call_rpc :delete_application, request, options: options do |response, operation|
3033
3075
  response = ::Gapic::Operation.new response, @operations_client, options: options
3034
3076
  yield response, operation if block_given?
3035
- return response
3077
+ throw :response, response
3036
3078
  end
3037
3079
  rescue ::GRPC::BadStatus => e
3038
3080
  raise ::Google::Cloud::Error.from_error(e)
@@ -3121,6 +3163,11 @@ module Google
3121
3163
  # default endpoint URL. The default value of nil uses the environment
3122
3164
  # universe (usually the default "googleapis.com" universe).
3123
3165
  # @return [::String,nil]
3166
+ # @!attribute [rw] logger
3167
+ # A custom logger to use for request/response debug logging, or the value
3168
+ # `:default` (the default) to construct a default logger, or `nil` to
3169
+ # explicitly disable logging.
3170
+ # @return [::Logger,:default,nil]
3124
3171
  #
3125
3172
  class Configuration
3126
3173
  extend ::Gapic::Config
@@ -3145,6 +3192,7 @@ module Google
3145
3192
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3146
3193
  config_attr :quota_project, nil, ::String, nil
3147
3194
  config_attr :universe_domain, nil, ::String, nil
3195
+ config_attr :logger, :default, ::Logger, nil, :default
3148
3196
 
3149
3197
  # @private
3150
3198
  def initialize parent_config = nil