google-cloud-bare_metal_solution-v2 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,6 +41,9 @@ module Google
41
41
  # upon specific servers in your Bare Metal Solution environment.
42
42
  #
43
43
  class Client
44
+ # @private
45
+ API_VERSION = ""
46
+
44
47
  # @private
45
48
  DEFAULT_ENDPOINT_TEMPLATE = "baremetalsolution.$UNIVERSE_DOMAIN$"
46
49
 
@@ -165,15 +168,27 @@ module Google
165
168
  endpoint: @config.endpoint,
166
169
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
167
170
  universe_domain: @config.universe_domain,
168
- credentials: credentials
171
+ credentials: credentials,
172
+ logger: @config.logger
169
173
  )
170
174
 
175
+ @bare_metal_solution_stub.logger(stub: true)&.info do |entry|
176
+ entry.set_system_name
177
+ entry.set_service
178
+ entry.message = "Created client for #{entry.service}"
179
+ entry.set_credentials_fields credentials
180
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
181
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
182
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
183
+ end
184
+
171
185
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
172
186
  config.credentials = credentials
173
187
  config.quota_project = @quota_project_id
174
188
  config.endpoint = @bare_metal_solution_stub.endpoint
175
189
  config.universe_domain = @bare_metal_solution_stub.universe_domain
176
190
  config.bindings_override = @config.bindings_override
191
+ config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
177
192
  end
178
193
 
179
194
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -181,6 +196,7 @@ module Google
181
196
  config.quota_project = @quota_project_id
182
197
  config.endpoint = @bare_metal_solution_stub.endpoint
183
198
  config.universe_domain = @bare_metal_solution_stub.universe_domain
199
+ config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
184
200
  end
185
201
  end
186
202
 
@@ -205,6 +221,15 @@ module Google
205
221
  #
206
222
  attr_reader :iam_policy_client
207
223
 
224
+ ##
225
+ # The logger used for request/response debug logging.
226
+ #
227
+ # @return [Logger]
228
+ #
229
+ def logger
230
+ @bare_metal_solution_stub.logger
231
+ end
232
+
208
233
  # Service calls
209
234
 
210
235
  ##
@@ -272,12 +297,13 @@ module Google
272
297
  # Customize the options with defaults
273
298
  call_metadata = @config.rpcs.list_instances.metadata.to_h
274
299
 
275
- # Set x-goog-api-client and x-goog-user-project headers
300
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
276
301
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
302
  lib_name: @config.lib_name, lib_version: @config.lib_version,
278
303
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
279
304
  transports_version_send: [:rest]
280
305
 
306
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
281
307
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
282
308
 
283
309
  options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
@@ -290,7 +316,6 @@ module Google
290
316
 
291
317
  @bare_metal_solution_stub.list_instances request, options do |result, operation|
292
318
  yield result, operation if block_given?
293
- return result
294
319
  end
295
320
  rescue ::Gapic::Rest::Error => e
296
321
  raise ::Google::Cloud::Error.from_error(e)
@@ -350,12 +375,13 @@ module Google
350
375
  # Customize the options with defaults
351
376
  call_metadata = @config.rpcs.get_instance.metadata.to_h
352
377
 
353
- # Set x-goog-api-client and x-goog-user-project headers
378
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
354
379
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
355
380
  lib_name: @config.lib_name, lib_version: @config.lib_version,
356
381
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
357
382
  transports_version_send: [:rest]
358
383
 
384
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
359
385
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
360
386
 
361
387
  options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
@@ -368,7 +394,6 @@ module Google
368
394
 
369
395
  @bare_metal_solution_stub.get_instance request, options do |result, operation|
370
396
  yield result, operation if block_given?
371
- return result
372
397
  end
373
398
  rescue ::Gapic::Rest::Error => e
374
399
  raise ::Google::Cloud::Error.from_error(e)
@@ -444,12 +469,13 @@ module Google
444
469
  # Customize the options with defaults
445
470
  call_metadata = @config.rpcs.update_instance.metadata.to_h
446
471
 
447
- # Set x-goog-api-client and x-goog-user-project headers
472
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
448
473
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
449
474
  lib_name: @config.lib_name, lib_version: @config.lib_version,
450
475
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
451
476
  transports_version_send: [:rest]
452
477
 
478
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
453
479
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
454
480
 
455
481
  options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
@@ -463,7 +489,7 @@ module Google
463
489
  @bare_metal_solution_stub.update_instance request, options do |result, operation|
464
490
  result = ::Gapic::Operation.new result, @operations_client, options: options
465
491
  yield result, operation if block_given?
466
- return result
492
+ throw :response, result
467
493
  end
468
494
  rescue ::Gapic::Rest::Error => e
469
495
  raise ::Google::Cloud::Error.from_error(e)
@@ -527,12 +553,13 @@ module Google
527
553
  # Customize the options with defaults
528
554
  call_metadata = @config.rpcs.rename_instance.metadata.to_h
529
555
 
530
- # Set x-goog-api-client and x-goog-user-project headers
556
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
531
557
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
532
558
  lib_name: @config.lib_name, lib_version: @config.lib_version,
533
559
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
534
560
  transports_version_send: [:rest]
535
561
 
562
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
536
563
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
537
564
 
538
565
  options.apply_defaults timeout: @config.rpcs.rename_instance.timeout,
@@ -545,7 +572,6 @@ module Google
545
572
 
546
573
  @bare_metal_solution_stub.rename_instance request, options do |result, operation|
547
574
  yield result, operation if block_given?
548
- return result
549
575
  end
550
576
  rescue ::Gapic::Rest::Error => e
551
577
  raise ::Google::Cloud::Error.from_error(e)
@@ -613,12 +639,13 @@ module Google
613
639
  # Customize the options with defaults
614
640
  call_metadata = @config.rpcs.reset_instance.metadata.to_h
615
641
 
616
- # Set x-goog-api-client and x-goog-user-project headers
642
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
617
643
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
618
644
  lib_name: @config.lib_name, lib_version: @config.lib_version,
619
645
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
620
646
  transports_version_send: [:rest]
621
647
 
648
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
622
649
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
623
650
 
624
651
  options.apply_defaults timeout: @config.rpcs.reset_instance.timeout,
@@ -632,7 +659,7 @@ module Google
632
659
  @bare_metal_solution_stub.reset_instance request, options do |result, operation|
633
660
  result = ::Gapic::Operation.new result, @operations_client, options: options
634
661
  yield result, operation if block_given?
635
- return result
662
+ throw :response, result
636
663
  end
637
664
  rescue ::Gapic::Rest::Error => e
638
665
  raise ::Google::Cloud::Error.from_error(e)
@@ -699,12 +726,13 @@ module Google
699
726
  # Customize the options with defaults
700
727
  call_metadata = @config.rpcs.start_instance.metadata.to_h
701
728
 
702
- # Set x-goog-api-client and x-goog-user-project headers
729
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
703
730
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
704
731
  lib_name: @config.lib_name, lib_version: @config.lib_version,
705
732
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
706
733
  transports_version_send: [:rest]
707
734
 
735
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
708
736
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
709
737
 
710
738
  options.apply_defaults timeout: @config.rpcs.start_instance.timeout,
@@ -718,7 +746,7 @@ module Google
718
746
  @bare_metal_solution_stub.start_instance request, options do |result, operation|
719
747
  result = ::Gapic::Operation.new result, @operations_client, options: options
720
748
  yield result, operation if block_given?
721
- return result
749
+ throw :response, result
722
750
  end
723
751
  rescue ::Gapic::Rest::Error => e
724
752
  raise ::Google::Cloud::Error.from_error(e)
@@ -785,12 +813,13 @@ module Google
785
813
  # Customize the options with defaults
786
814
  call_metadata = @config.rpcs.stop_instance.metadata.to_h
787
815
 
788
- # Set x-goog-api-client and x-goog-user-project headers
816
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
789
817
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
790
818
  lib_name: @config.lib_name, lib_version: @config.lib_version,
791
819
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
792
820
  transports_version_send: [:rest]
793
821
 
822
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
794
823
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
795
824
 
796
825
  options.apply_defaults timeout: @config.rpcs.stop_instance.timeout,
@@ -804,7 +833,7 @@ module Google
804
833
  @bare_metal_solution_stub.stop_instance request, options do |result, operation|
805
834
  result = ::Gapic::Operation.new result, @operations_client, options: options
806
835
  yield result, operation if block_given?
807
- return result
836
+ throw :response, result
808
837
  end
809
838
  rescue ::Gapic::Rest::Error => e
810
839
  raise ::Google::Cloud::Error.from_error(e)
@@ -871,12 +900,13 @@ module Google
871
900
  # Customize the options with defaults
872
901
  call_metadata = @config.rpcs.enable_interactive_serial_console.metadata.to_h
873
902
 
874
- # Set x-goog-api-client and x-goog-user-project headers
903
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
875
904
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
876
905
  lib_name: @config.lib_name, lib_version: @config.lib_version,
877
906
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
878
907
  transports_version_send: [:rest]
879
908
 
909
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
880
910
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
881
911
 
882
912
  options.apply_defaults timeout: @config.rpcs.enable_interactive_serial_console.timeout,
@@ -890,7 +920,7 @@ module Google
890
920
  @bare_metal_solution_stub.enable_interactive_serial_console request, options do |result, operation|
891
921
  result = ::Gapic::Operation.new result, @operations_client, options: options
892
922
  yield result, operation if block_given?
893
- return result
923
+ throw :response, result
894
924
  end
895
925
  rescue ::Gapic::Rest::Error => e
896
926
  raise ::Google::Cloud::Error.from_error(e)
@@ -957,12 +987,13 @@ module Google
957
987
  # Customize the options with defaults
958
988
  call_metadata = @config.rpcs.disable_interactive_serial_console.metadata.to_h
959
989
 
960
- # Set x-goog-api-client and x-goog-user-project headers
990
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
961
991
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
962
992
  lib_name: @config.lib_name, lib_version: @config.lib_version,
963
993
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
964
994
  transports_version_send: [:rest]
965
995
 
996
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
966
997
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
967
998
 
968
999
  options.apply_defaults timeout: @config.rpcs.disable_interactive_serial_console.timeout,
@@ -976,7 +1007,7 @@ module Google
976
1007
  @bare_metal_solution_stub.disable_interactive_serial_console request, options do |result, operation|
977
1008
  result = ::Gapic::Operation.new result, @operations_client, options: options
978
1009
  yield result, operation if block_given?
979
- return result
1010
+ throw :response, result
980
1011
  end
981
1012
  rescue ::Gapic::Rest::Error => e
982
1013
  raise ::Google::Cloud::Error.from_error(e)
@@ -1047,12 +1078,13 @@ module Google
1047
1078
  # Customize the options with defaults
1048
1079
  call_metadata = @config.rpcs.detach_lun.metadata.to_h
1049
1080
 
1050
- # Set x-goog-api-client and x-goog-user-project headers
1081
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1051
1082
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1052
1083
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1053
1084
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1054
1085
  transports_version_send: [:rest]
1055
1086
 
1087
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1056
1088
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1057
1089
 
1058
1090
  options.apply_defaults timeout: @config.rpcs.detach_lun.timeout,
@@ -1066,7 +1098,7 @@ module Google
1066
1098
  @bare_metal_solution_stub.detach_lun request, options do |result, operation|
1067
1099
  result = ::Gapic::Operation.new result, @operations_client, options: options
1068
1100
  yield result, operation if block_given?
1069
- return result
1101
+ throw :response, result
1070
1102
  end
1071
1103
  rescue ::Gapic::Rest::Error => e
1072
1104
  raise ::Google::Cloud::Error.from_error(e)
@@ -1136,12 +1168,13 @@ module Google
1136
1168
  # Customize the options with defaults
1137
1169
  call_metadata = @config.rpcs.list_ssh_keys.metadata.to_h
1138
1170
 
1139
- # Set x-goog-api-client and x-goog-user-project headers
1171
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1140
1172
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1141
1173
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1142
1174
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1143
1175
  transports_version_send: [:rest]
1144
1176
 
1177
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1145
1178
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1146
1179
 
1147
1180
  options.apply_defaults timeout: @config.rpcs.list_ssh_keys.timeout,
@@ -1155,7 +1188,7 @@ module Google
1155
1188
  @bare_metal_solution_stub.list_ssh_keys request, options do |result, operation|
1156
1189
  result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_ssh_keys, "ssh_keys", request, result, options
1157
1190
  yield result, operation if block_given?
1158
- return result
1191
+ throw :response, result
1159
1192
  end
1160
1193
  rescue ::Gapic::Rest::Error => e
1161
1194
  raise ::Google::Cloud::Error.from_error(e)
@@ -1224,12 +1257,13 @@ module Google
1224
1257
  # Customize the options with defaults
1225
1258
  call_metadata = @config.rpcs.create_ssh_key.metadata.to_h
1226
1259
 
1227
- # Set x-goog-api-client and x-goog-user-project headers
1260
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1228
1261
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1229
1262
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1230
1263
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1231
1264
  transports_version_send: [:rest]
1232
1265
 
1266
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1233
1267
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1234
1268
 
1235
1269
  options.apply_defaults timeout: @config.rpcs.create_ssh_key.timeout,
@@ -1242,7 +1276,6 @@ module Google
1242
1276
 
1243
1277
  @bare_metal_solution_stub.create_ssh_key request, options do |result, operation|
1244
1278
  yield result, operation if block_given?
1245
- return result
1246
1279
  end
1247
1280
  rescue ::Gapic::Rest::Error => e
1248
1281
  raise ::Google::Cloud::Error.from_error(e)
@@ -1303,12 +1336,13 @@ module Google
1303
1336
  # Customize the options with defaults
1304
1337
  call_metadata = @config.rpcs.delete_ssh_key.metadata.to_h
1305
1338
 
1306
- # Set x-goog-api-client and x-goog-user-project headers
1339
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1307
1340
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1308
1341
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1309
1342
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1310
1343
  transports_version_send: [:rest]
1311
1344
 
1345
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1312
1346
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1313
1347
 
1314
1348
  options.apply_defaults timeout: @config.rpcs.delete_ssh_key.timeout,
@@ -1321,7 +1355,6 @@ module Google
1321
1355
 
1322
1356
  @bare_metal_solution_stub.delete_ssh_key request, options do |result, operation|
1323
1357
  yield result, operation if block_given?
1324
- return result
1325
1358
  end
1326
1359
  rescue ::Gapic::Rest::Error => e
1327
1360
  raise ::Google::Cloud::Error.from_error(e)
@@ -1392,12 +1425,13 @@ module Google
1392
1425
  # Customize the options with defaults
1393
1426
  call_metadata = @config.rpcs.list_volumes.metadata.to_h
1394
1427
 
1395
- # Set x-goog-api-client and x-goog-user-project headers
1428
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1396
1429
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1397
1430
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1398
1431
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1399
1432
  transports_version_send: [:rest]
1400
1433
 
1434
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1401
1435
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1402
1436
 
1403
1437
  options.apply_defaults timeout: @config.rpcs.list_volumes.timeout,
@@ -1410,7 +1444,6 @@ module Google
1410
1444
 
1411
1445
  @bare_metal_solution_stub.list_volumes request, options do |result, operation|
1412
1446
  yield result, operation if block_given?
1413
- return result
1414
1447
  end
1415
1448
  rescue ::Gapic::Rest::Error => e
1416
1449
  raise ::Google::Cloud::Error.from_error(e)
@@ -1470,12 +1503,13 @@ module Google
1470
1503
  # Customize the options with defaults
1471
1504
  call_metadata = @config.rpcs.get_volume.metadata.to_h
1472
1505
 
1473
- # Set x-goog-api-client and x-goog-user-project headers
1506
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1474
1507
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1475
1508
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1476
1509
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1477
1510
  transports_version_send: [:rest]
1478
1511
 
1512
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1479
1513
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1480
1514
 
1481
1515
  options.apply_defaults timeout: @config.rpcs.get_volume.timeout,
@@ -1488,7 +1522,6 @@ module Google
1488
1522
 
1489
1523
  @bare_metal_solution_stub.get_volume request, options do |result, operation|
1490
1524
  yield result, operation if block_given?
1491
- return result
1492
1525
  end
1493
1526
  rescue ::Gapic::Rest::Error => e
1494
1527
  raise ::Google::Cloud::Error.from_error(e)
@@ -1562,12 +1595,13 @@ module Google
1562
1595
  # Customize the options with defaults
1563
1596
  call_metadata = @config.rpcs.update_volume.metadata.to_h
1564
1597
 
1565
- # Set x-goog-api-client and x-goog-user-project headers
1598
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1566
1599
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1567
1600
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1568
1601
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1569
1602
  transports_version_send: [:rest]
1570
1603
 
1604
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1571
1605
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1572
1606
 
1573
1607
  options.apply_defaults timeout: @config.rpcs.update_volume.timeout,
@@ -1581,7 +1615,7 @@ module Google
1581
1615
  @bare_metal_solution_stub.update_volume request, options do |result, operation|
1582
1616
  result = ::Gapic::Operation.new result, @operations_client, options: options
1583
1617
  yield result, operation if block_given?
1584
- return result
1618
+ throw :response, result
1585
1619
  end
1586
1620
  rescue ::Gapic::Rest::Error => e
1587
1621
  raise ::Google::Cloud::Error.from_error(e)
@@ -1645,12 +1679,13 @@ module Google
1645
1679
  # Customize the options with defaults
1646
1680
  call_metadata = @config.rpcs.rename_volume.metadata.to_h
1647
1681
 
1648
- # Set x-goog-api-client and x-goog-user-project headers
1682
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1649
1683
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1650
1684
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1651
1685
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1652
1686
  transports_version_send: [:rest]
1653
1687
 
1688
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1654
1689
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1655
1690
 
1656
1691
  options.apply_defaults timeout: @config.rpcs.rename_volume.timeout,
@@ -1663,7 +1698,6 @@ module Google
1663
1698
 
1664
1699
  @bare_metal_solution_stub.rename_volume request, options do |result, operation|
1665
1700
  yield result, operation if block_given?
1666
- return result
1667
1701
  end
1668
1702
  rescue ::Gapic::Rest::Error => e
1669
1703
  raise ::Google::Cloud::Error.from_error(e)
@@ -1731,12 +1765,13 @@ module Google
1731
1765
  # Customize the options with defaults
1732
1766
  call_metadata = @config.rpcs.evict_volume.metadata.to_h
1733
1767
 
1734
- # Set x-goog-api-client and x-goog-user-project headers
1768
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1735
1769
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1736
1770
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1737
1771
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1738
1772
  transports_version_send: [:rest]
1739
1773
 
1774
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1740
1775
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1741
1776
 
1742
1777
  options.apply_defaults timeout: @config.rpcs.evict_volume.timeout,
@@ -1750,7 +1785,7 @@ module Google
1750
1785
  @bare_metal_solution_stub.evict_volume request, options do |result, operation|
1751
1786
  result = ::Gapic::Operation.new result, @operations_client, options: options
1752
1787
  yield result, operation if block_given?
1753
- return result
1788
+ throw :response, result
1754
1789
  end
1755
1790
  rescue ::Gapic::Rest::Error => e
1756
1791
  raise ::Google::Cloud::Error.from_error(e)
@@ -1819,12 +1854,13 @@ module Google
1819
1854
  # Customize the options with defaults
1820
1855
  call_metadata = @config.rpcs.resize_volume.metadata.to_h
1821
1856
 
1822
- # Set x-goog-api-client and x-goog-user-project headers
1857
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1823
1858
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1824
1859
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1825
1860
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1826
1861
  transports_version_send: [:rest]
1827
1862
 
1863
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1828
1864
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1829
1865
 
1830
1866
  options.apply_defaults timeout: @config.rpcs.resize_volume.timeout,
@@ -1838,7 +1874,7 @@ module Google
1838
1874
  @bare_metal_solution_stub.resize_volume request, options do |result, operation|
1839
1875
  result = ::Gapic::Operation.new result, @operations_client, options: options
1840
1876
  yield result, operation if block_given?
1841
- return result
1877
+ throw :response, result
1842
1878
  end
1843
1879
  rescue ::Gapic::Rest::Error => e
1844
1880
  raise ::Google::Cloud::Error.from_error(e)
@@ -1909,12 +1945,13 @@ module Google
1909
1945
  # Customize the options with defaults
1910
1946
  call_metadata = @config.rpcs.list_networks.metadata.to_h
1911
1947
 
1912
- # Set x-goog-api-client and x-goog-user-project headers
1948
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1913
1949
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1914
1950
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1915
1951
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1916
1952
  transports_version_send: [:rest]
1917
1953
 
1954
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1918
1955
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1919
1956
 
1920
1957
  options.apply_defaults timeout: @config.rpcs.list_networks.timeout,
@@ -1927,7 +1964,6 @@ module Google
1927
1964
 
1928
1965
  @bare_metal_solution_stub.list_networks request, options do |result, operation|
1929
1966
  yield result, operation if block_given?
1930
- return result
1931
1967
  end
1932
1968
  rescue ::Gapic::Rest::Error => e
1933
1969
  raise ::Google::Cloud::Error.from_error(e)
@@ -1988,12 +2024,13 @@ module Google
1988
2024
  # Customize the options with defaults
1989
2025
  call_metadata = @config.rpcs.list_network_usage.metadata.to_h
1990
2026
 
1991
- # Set x-goog-api-client and x-goog-user-project headers
2027
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1992
2028
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1993
2029
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1994
2030
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
1995
2031
  transports_version_send: [:rest]
1996
2032
 
2033
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1997
2034
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1998
2035
 
1999
2036
  options.apply_defaults timeout: @config.rpcs.list_network_usage.timeout,
@@ -2006,7 +2043,6 @@ module Google
2006
2043
 
2007
2044
  @bare_metal_solution_stub.list_network_usage request, options do |result, operation|
2008
2045
  yield result, operation if block_given?
2009
- return result
2010
2046
  end
2011
2047
  rescue ::Gapic::Rest::Error => e
2012
2048
  raise ::Google::Cloud::Error.from_error(e)
@@ -2066,12 +2102,13 @@ module Google
2066
2102
  # Customize the options with defaults
2067
2103
  call_metadata = @config.rpcs.get_network.metadata.to_h
2068
2104
 
2069
- # Set x-goog-api-client and x-goog-user-project headers
2105
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2070
2106
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2071
2107
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2072
2108
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2073
2109
  transports_version_send: [:rest]
2074
2110
 
2111
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2075
2112
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2076
2113
 
2077
2114
  options.apply_defaults timeout: @config.rpcs.get_network.timeout,
@@ -2084,7 +2121,6 @@ module Google
2084
2121
 
2085
2122
  @bare_metal_solution_stub.get_network request, options do |result, operation|
2086
2123
  yield result, operation if block_given?
2087
- return result
2088
2124
  end
2089
2125
  rescue ::Gapic::Rest::Error => e
2090
2126
  raise ::Google::Cloud::Error.from_error(e)
@@ -2158,12 +2194,13 @@ module Google
2158
2194
  # Customize the options with defaults
2159
2195
  call_metadata = @config.rpcs.update_network.metadata.to_h
2160
2196
 
2161
- # Set x-goog-api-client and x-goog-user-project headers
2197
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2162
2198
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2163
2199
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2164
2200
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2165
2201
  transports_version_send: [:rest]
2166
2202
 
2203
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2167
2204
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2168
2205
 
2169
2206
  options.apply_defaults timeout: @config.rpcs.update_network.timeout,
@@ -2177,7 +2214,7 @@ module Google
2177
2214
  @bare_metal_solution_stub.update_network request, options do |result, operation|
2178
2215
  result = ::Gapic::Operation.new result, @operations_client, options: options
2179
2216
  yield result, operation if block_given?
2180
- return result
2217
+ throw :response, result
2181
2218
  end
2182
2219
  rescue ::Gapic::Rest::Error => e
2183
2220
  raise ::Google::Cloud::Error.from_error(e)
@@ -2240,12 +2277,13 @@ module Google
2240
2277
  # Customize the options with defaults
2241
2278
  call_metadata = @config.rpcs.create_volume_snapshot.metadata.to_h
2242
2279
 
2243
- # Set x-goog-api-client and x-goog-user-project headers
2280
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2244
2281
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2245
2282
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2246
2283
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2247
2284
  transports_version_send: [:rest]
2248
2285
 
2286
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2249
2287
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2250
2288
 
2251
2289
  options.apply_defaults timeout: @config.rpcs.create_volume_snapshot.timeout,
@@ -2258,7 +2296,6 @@ module Google
2258
2296
 
2259
2297
  @bare_metal_solution_stub.create_volume_snapshot request, options do |result, operation|
2260
2298
  yield result, operation if block_given?
2261
- return result
2262
2299
  end
2263
2300
  rescue ::Gapic::Rest::Error => e
2264
2301
  raise ::Google::Cloud::Error.from_error(e)
@@ -2327,12 +2364,13 @@ module Google
2327
2364
  # Customize the options with defaults
2328
2365
  call_metadata = @config.rpcs.restore_volume_snapshot.metadata.to_h
2329
2366
 
2330
- # Set x-goog-api-client and x-goog-user-project headers
2367
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2331
2368
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2332
2369
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2333
2370
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2334
2371
  transports_version_send: [:rest]
2335
2372
 
2373
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2336
2374
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2337
2375
 
2338
2376
  options.apply_defaults timeout: @config.rpcs.restore_volume_snapshot.timeout,
@@ -2346,7 +2384,7 @@ module Google
2346
2384
  @bare_metal_solution_stub.restore_volume_snapshot request, options do |result, operation|
2347
2385
  result = ::Gapic::Operation.new result, @operations_client, options: options
2348
2386
  yield result, operation if block_given?
2349
- return result
2387
+ throw :response, result
2350
2388
  end
2351
2389
  rescue ::Gapic::Rest::Error => e
2352
2390
  raise ::Google::Cloud::Error.from_error(e)
@@ -2407,12 +2445,13 @@ module Google
2407
2445
  # Customize the options with defaults
2408
2446
  call_metadata = @config.rpcs.delete_volume_snapshot.metadata.to_h
2409
2447
 
2410
- # Set x-goog-api-client and x-goog-user-project headers
2448
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2411
2449
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2412
2450
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2413
2451
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2414
2452
  transports_version_send: [:rest]
2415
2453
 
2454
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2416
2455
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2417
2456
 
2418
2457
  options.apply_defaults timeout: @config.rpcs.delete_volume_snapshot.timeout,
@@ -2425,7 +2464,6 @@ module Google
2425
2464
 
2426
2465
  @bare_metal_solution_stub.delete_volume_snapshot request, options do |result, operation|
2427
2466
  yield result, operation if block_given?
2428
- return result
2429
2467
  end
2430
2468
  rescue ::Gapic::Rest::Error => e
2431
2469
  raise ::Google::Cloud::Error.from_error(e)
@@ -2486,12 +2524,13 @@ module Google
2486
2524
  # Customize the options with defaults
2487
2525
  call_metadata = @config.rpcs.get_volume_snapshot.metadata.to_h
2488
2526
 
2489
- # Set x-goog-api-client and x-goog-user-project headers
2527
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2490
2528
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2491
2529
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2492
2530
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2493
2531
  transports_version_send: [:rest]
2494
2532
 
2533
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2495
2534
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2496
2535
 
2497
2536
  options.apply_defaults timeout: @config.rpcs.get_volume_snapshot.timeout,
@@ -2504,7 +2543,6 @@ module Google
2504
2543
 
2505
2544
  @bare_metal_solution_stub.get_volume_snapshot request, options do |result, operation|
2506
2545
  yield result, operation if block_given?
2507
- return result
2508
2546
  end
2509
2547
  rescue ::Gapic::Rest::Error => e
2510
2548
  raise ::Google::Cloud::Error.from_error(e)
@@ -2575,12 +2613,13 @@ module Google
2575
2613
  # Customize the options with defaults
2576
2614
  call_metadata = @config.rpcs.list_volume_snapshots.metadata.to_h
2577
2615
 
2578
- # Set x-goog-api-client and x-goog-user-project headers
2616
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2579
2617
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2580
2618
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2581
2619
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2582
2620
  transports_version_send: [:rest]
2583
2621
 
2622
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2584
2623
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2585
2624
 
2586
2625
  options.apply_defaults timeout: @config.rpcs.list_volume_snapshots.timeout,
@@ -2593,7 +2632,6 @@ module Google
2593
2632
 
2594
2633
  @bare_metal_solution_stub.list_volume_snapshots request, options do |result, operation|
2595
2634
  yield result, operation if block_given?
2596
- return result
2597
2635
  end
2598
2636
  rescue ::Gapic::Rest::Error => e
2599
2637
  raise ::Google::Cloud::Error.from_error(e)
@@ -2653,12 +2691,13 @@ module Google
2653
2691
  # Customize the options with defaults
2654
2692
  call_metadata = @config.rpcs.get_lun.metadata.to_h
2655
2693
 
2656
- # Set x-goog-api-client and x-goog-user-project headers
2694
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2657
2695
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2658
2696
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2659
2697
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2660
2698
  transports_version_send: [:rest]
2661
2699
 
2700
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2662
2701
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2663
2702
 
2664
2703
  options.apply_defaults timeout: @config.rpcs.get_lun.timeout,
@@ -2671,7 +2710,6 @@ module Google
2671
2710
 
2672
2711
  @bare_metal_solution_stub.get_lun request, options do |result, operation|
2673
2712
  yield result, operation if block_given?
2674
- return result
2675
2713
  end
2676
2714
  rescue ::Gapic::Rest::Error => e
2677
2715
  raise ::Google::Cloud::Error.from_error(e)
@@ -2740,12 +2778,13 @@ module Google
2740
2778
  # Customize the options with defaults
2741
2779
  call_metadata = @config.rpcs.list_luns.metadata.to_h
2742
2780
 
2743
- # Set x-goog-api-client and x-goog-user-project headers
2781
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2744
2782
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2745
2783
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2746
2784
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2747
2785
  transports_version_send: [:rest]
2748
2786
 
2787
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2749
2788
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2750
2789
 
2751
2790
  options.apply_defaults timeout: @config.rpcs.list_luns.timeout,
@@ -2758,7 +2797,6 @@ module Google
2758
2797
 
2759
2798
  @bare_metal_solution_stub.list_luns request, options do |result, operation|
2760
2799
  yield result, operation if block_given?
2761
- return result
2762
2800
  end
2763
2801
  rescue ::Gapic::Rest::Error => e
2764
2802
  raise ::Google::Cloud::Error.from_error(e)
@@ -2826,12 +2864,13 @@ module Google
2826
2864
  # Customize the options with defaults
2827
2865
  call_metadata = @config.rpcs.evict_lun.metadata.to_h
2828
2866
 
2829
- # Set x-goog-api-client and x-goog-user-project headers
2867
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2830
2868
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2831
2869
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2832
2870
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2833
2871
  transports_version_send: [:rest]
2834
2872
 
2873
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2835
2874
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2836
2875
 
2837
2876
  options.apply_defaults timeout: @config.rpcs.evict_lun.timeout,
@@ -2845,7 +2884,7 @@ module Google
2845
2884
  @bare_metal_solution_stub.evict_lun request, options do |result, operation|
2846
2885
  result = ::Gapic::Operation.new result, @operations_client, options: options
2847
2886
  yield result, operation if block_given?
2848
- return result
2887
+ throw :response, result
2849
2888
  end
2850
2889
  rescue ::Gapic::Rest::Error => e
2851
2890
  raise ::Google::Cloud::Error.from_error(e)
@@ -2905,12 +2944,13 @@ module Google
2905
2944
  # Customize the options with defaults
2906
2945
  call_metadata = @config.rpcs.get_nfs_share.metadata.to_h
2907
2946
 
2908
- # Set x-goog-api-client and x-goog-user-project headers
2947
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2909
2948
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2910
2949
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2911
2950
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
2912
2951
  transports_version_send: [:rest]
2913
2952
 
2953
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2914
2954
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2915
2955
 
2916
2956
  options.apply_defaults timeout: @config.rpcs.get_nfs_share.timeout,
@@ -2923,7 +2963,6 @@ module Google
2923
2963
 
2924
2964
  @bare_metal_solution_stub.get_nfs_share request, options do |result, operation|
2925
2965
  yield result, operation if block_given?
2926
- return result
2927
2966
  end
2928
2967
  rescue ::Gapic::Rest::Error => e
2929
2968
  raise ::Google::Cloud::Error.from_error(e)
@@ -2994,12 +3033,13 @@ module Google
2994
3033
  # Customize the options with defaults
2995
3034
  call_metadata = @config.rpcs.list_nfs_shares.metadata.to_h
2996
3035
 
2997
- # Set x-goog-api-client and x-goog-user-project headers
3036
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2998
3037
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2999
3038
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3000
3039
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3001
3040
  transports_version_send: [:rest]
3002
3041
 
3042
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3003
3043
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3004
3044
 
3005
3045
  options.apply_defaults timeout: @config.rpcs.list_nfs_shares.timeout,
@@ -3012,7 +3052,6 @@ module Google
3012
3052
 
3013
3053
  @bare_metal_solution_stub.list_nfs_shares request, options do |result, operation|
3014
3054
  yield result, operation if block_given?
3015
- return result
3016
3055
  end
3017
3056
  rescue ::Gapic::Rest::Error => e
3018
3057
  raise ::Google::Cloud::Error.from_error(e)
@@ -3087,12 +3126,13 @@ module Google
3087
3126
  # Customize the options with defaults
3088
3127
  call_metadata = @config.rpcs.update_nfs_share.metadata.to_h
3089
3128
 
3090
- # Set x-goog-api-client and x-goog-user-project headers
3129
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3091
3130
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3092
3131
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3093
3132
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3094
3133
  transports_version_send: [:rest]
3095
3134
 
3135
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3096
3136
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3097
3137
 
3098
3138
  options.apply_defaults timeout: @config.rpcs.update_nfs_share.timeout,
@@ -3106,7 +3146,7 @@ module Google
3106
3146
  @bare_metal_solution_stub.update_nfs_share request, options do |result, operation|
3107
3147
  result = ::Gapic::Operation.new result, @operations_client, options: options
3108
3148
  yield result, operation if block_given?
3109
- return result
3149
+ throw :response, result
3110
3150
  end
3111
3151
  rescue ::Gapic::Rest::Error => e
3112
3152
  raise ::Google::Cloud::Error.from_error(e)
@@ -3175,12 +3215,13 @@ module Google
3175
3215
  # Customize the options with defaults
3176
3216
  call_metadata = @config.rpcs.create_nfs_share.metadata.to_h
3177
3217
 
3178
- # Set x-goog-api-client and x-goog-user-project headers
3218
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3179
3219
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3180
3220
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3181
3221
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3182
3222
  transports_version_send: [:rest]
3183
3223
 
3224
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3184
3225
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3185
3226
 
3186
3227
  options.apply_defaults timeout: @config.rpcs.create_nfs_share.timeout,
@@ -3194,7 +3235,7 @@ module Google
3194
3235
  @bare_metal_solution_stub.create_nfs_share request, options do |result, operation|
3195
3236
  result = ::Gapic::Operation.new result, @operations_client, options: options
3196
3237
  yield result, operation if block_given?
3197
- return result
3238
+ throw :response, result
3198
3239
  end
3199
3240
  rescue ::Gapic::Rest::Error => e
3200
3241
  raise ::Google::Cloud::Error.from_error(e)
@@ -3258,12 +3299,13 @@ module Google
3258
3299
  # Customize the options with defaults
3259
3300
  call_metadata = @config.rpcs.rename_nfs_share.metadata.to_h
3260
3301
 
3261
- # Set x-goog-api-client and x-goog-user-project headers
3302
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3262
3303
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3263
3304
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3264
3305
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3265
3306
  transports_version_send: [:rest]
3266
3307
 
3308
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3267
3309
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3268
3310
 
3269
3311
  options.apply_defaults timeout: @config.rpcs.rename_nfs_share.timeout,
@@ -3276,7 +3318,6 @@ module Google
3276
3318
 
3277
3319
  @bare_metal_solution_stub.rename_nfs_share request, options do |result, operation|
3278
3320
  yield result, operation if block_given?
3279
- return result
3280
3321
  end
3281
3322
  rescue ::Gapic::Rest::Error => e
3282
3323
  raise ::Google::Cloud::Error.from_error(e)
@@ -3343,12 +3384,13 @@ module Google
3343
3384
  # Customize the options with defaults
3344
3385
  call_metadata = @config.rpcs.delete_nfs_share.metadata.to_h
3345
3386
 
3346
- # Set x-goog-api-client and x-goog-user-project headers
3387
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3347
3388
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3348
3389
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3349
3390
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3350
3391
  transports_version_send: [:rest]
3351
3392
 
3393
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3352
3394
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3353
3395
 
3354
3396
  options.apply_defaults timeout: @config.rpcs.delete_nfs_share.timeout,
@@ -3362,7 +3404,7 @@ module Google
3362
3404
  @bare_metal_solution_stub.delete_nfs_share request, options do |result, operation|
3363
3405
  result = ::Gapic::Operation.new result, @operations_client, options: options
3364
3406
  yield result, operation if block_given?
3365
- return result
3407
+ throw :response, result
3366
3408
  end
3367
3409
  rescue ::Gapic::Rest::Error => e
3368
3410
  raise ::Google::Cloud::Error.from_error(e)
@@ -3433,12 +3475,13 @@ module Google
3433
3475
  # Customize the options with defaults
3434
3476
  call_metadata = @config.rpcs.list_provisioning_quotas.metadata.to_h
3435
3477
 
3436
- # Set x-goog-api-client and x-goog-user-project headers
3478
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3437
3479
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3438
3480
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3439
3481
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3440
3482
  transports_version_send: [:rest]
3441
3483
 
3484
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3442
3485
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3443
3486
 
3444
3487
  options.apply_defaults timeout: @config.rpcs.list_provisioning_quotas.timeout,
@@ -3452,7 +3495,7 @@ module Google
3452
3495
  @bare_metal_solution_stub.list_provisioning_quotas request, options do |result, operation|
3453
3496
  result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_provisioning_quotas, "provisioning_quotas", request, result, options
3454
3497
  yield result, operation if block_given?
3455
- return result
3498
+ throw :response, result
3456
3499
  end
3457
3500
  rescue ::Gapic::Rest::Error => e
3458
3501
  raise ::Google::Cloud::Error.from_error(e)
@@ -3518,12 +3561,13 @@ module Google
3518
3561
  # Customize the options with defaults
3519
3562
  call_metadata = @config.rpcs.submit_provisioning_config.metadata.to_h
3520
3563
 
3521
- # Set x-goog-api-client and x-goog-user-project headers
3564
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3522
3565
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3523
3566
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3524
3567
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3525
3568
  transports_version_send: [:rest]
3526
3569
 
3570
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3527
3571
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3528
3572
 
3529
3573
  options.apply_defaults timeout: @config.rpcs.submit_provisioning_config.timeout,
@@ -3536,7 +3580,6 @@ module Google
3536
3580
 
3537
3581
  @bare_metal_solution_stub.submit_provisioning_config request, options do |result, operation|
3538
3582
  yield result, operation if block_given?
3539
- return result
3540
3583
  end
3541
3584
  rescue ::Gapic::Rest::Error => e
3542
3585
  raise ::Google::Cloud::Error.from_error(e)
@@ -3596,12 +3639,13 @@ module Google
3596
3639
  # Customize the options with defaults
3597
3640
  call_metadata = @config.rpcs.get_provisioning_config.metadata.to_h
3598
3641
 
3599
- # Set x-goog-api-client and x-goog-user-project headers
3642
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3600
3643
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3601
3644
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3602
3645
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3603
3646
  transports_version_send: [:rest]
3604
3647
 
3648
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3605
3649
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3606
3650
 
3607
3651
  options.apply_defaults timeout: @config.rpcs.get_provisioning_config.timeout,
@@ -3614,7 +3658,6 @@ module Google
3614
3658
 
3615
3659
  @bare_metal_solution_stub.get_provisioning_config request, options do |result, operation|
3616
3660
  yield result, operation if block_given?
3617
- return result
3618
3661
  end
3619
3662
  rescue ::Gapic::Rest::Error => e
3620
3663
  raise ::Google::Cloud::Error.from_error(e)
@@ -3680,12 +3723,13 @@ module Google
3680
3723
  # Customize the options with defaults
3681
3724
  call_metadata = @config.rpcs.create_provisioning_config.metadata.to_h
3682
3725
 
3683
- # Set x-goog-api-client and x-goog-user-project headers
3726
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3684
3727
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3685
3728
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3686
3729
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3687
3730
  transports_version_send: [:rest]
3688
3731
 
3732
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3689
3733
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3690
3734
 
3691
3735
  options.apply_defaults timeout: @config.rpcs.create_provisioning_config.timeout,
@@ -3698,7 +3742,6 @@ module Google
3698
3742
 
3699
3743
  @bare_metal_solution_stub.create_provisioning_config request, options do |result, operation|
3700
3744
  yield result, operation if block_given?
3701
- return result
3702
3745
  end
3703
3746
  rescue ::Gapic::Rest::Error => e
3704
3747
  raise ::Google::Cloud::Error.from_error(e)
@@ -3763,12 +3806,13 @@ module Google
3763
3806
  # Customize the options with defaults
3764
3807
  call_metadata = @config.rpcs.update_provisioning_config.metadata.to_h
3765
3808
 
3766
- # Set x-goog-api-client and x-goog-user-project headers
3809
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3767
3810
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3768
3811
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3769
3812
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3770
3813
  transports_version_send: [:rest]
3771
3814
 
3815
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3772
3816
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3773
3817
 
3774
3818
  options.apply_defaults timeout: @config.rpcs.update_provisioning_config.timeout,
@@ -3781,7 +3825,6 @@ module Google
3781
3825
 
3782
3826
  @bare_metal_solution_stub.update_provisioning_config request, options do |result, operation|
3783
3827
  yield result, operation if block_given?
3784
- return result
3785
3828
  end
3786
3829
  rescue ::Gapic::Rest::Error => e
3787
3830
  raise ::Google::Cloud::Error.from_error(e)
@@ -3845,12 +3888,13 @@ module Google
3845
3888
  # Customize the options with defaults
3846
3889
  call_metadata = @config.rpcs.rename_network.metadata.to_h
3847
3890
 
3848
- # Set x-goog-api-client and x-goog-user-project headers
3891
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3849
3892
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3850
3893
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3851
3894
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3852
3895
  transports_version_send: [:rest]
3853
3896
 
3897
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3854
3898
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3855
3899
 
3856
3900
  options.apply_defaults timeout: @config.rpcs.rename_network.timeout,
@@ -3863,7 +3907,6 @@ module Google
3863
3907
 
3864
3908
  @bare_metal_solution_stub.rename_network request, options do |result, operation|
3865
3909
  yield result, operation if block_given?
3866
- return result
3867
3910
  end
3868
3911
  rescue ::Gapic::Rest::Error => e
3869
3912
  raise ::Google::Cloud::Error.from_error(e)
@@ -3934,12 +3977,13 @@ module Google
3934
3977
  # Customize the options with defaults
3935
3978
  call_metadata = @config.rpcs.list_os_images.metadata.to_h
3936
3979
 
3937
- # Set x-goog-api-client and x-goog-user-project headers
3980
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3938
3981
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3939
3982
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3940
3983
  gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
3941
3984
  transports_version_send: [:rest]
3942
3985
 
3986
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3943
3987
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3944
3988
 
3945
3989
  options.apply_defaults timeout: @config.rpcs.list_os_images.timeout,
@@ -3953,7 +3997,7 @@ module Google
3953
3997
  @bare_metal_solution_stub.list_os_images request, options do |result, operation|
3954
3998
  result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_os_images, "os_images", request, result, options
3955
3999
  yield result, operation if block_given?
3956
- return result
4000
+ throw :response, result
3957
4001
  end
3958
4002
  rescue ::Gapic::Rest::Error => e
3959
4003
  raise ::Google::Cloud::Error.from_error(e)
@@ -4033,6 +4077,11 @@ module Google
4033
4077
  # default endpoint URL. The default value of nil uses the environment
4034
4078
  # universe (usually the default "googleapis.com" universe).
4035
4079
  # @return [::String,nil]
4080
+ # @!attribute [rw] logger
4081
+ # A custom logger to use for request/response debug logging, or the value
4082
+ # `:default` (the default) to construct a default logger, or `nil` to
4083
+ # explicitly disable logging.
4084
+ # @return [::Logger,:default,nil]
4036
4085
  #
4037
4086
  class Configuration
4038
4087
  extend ::Gapic::Config
@@ -4061,6 +4110,7 @@ module Google
4061
4110
  # by the host service.
4062
4111
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
4063
4112
  config_attr :bindings_override, {}, ::Hash, nil
4113
+ config_attr :logger, :default, ::Logger, nil, :default
4064
4114
 
4065
4115
  # @private
4066
4116
  def initialize parent_config = nil