google-cloud-bare_metal_solution-v2 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -168,15 +168,27 @@ module Google
168
168
  endpoint: @config.endpoint,
169
169
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
170
  universe_domain: @config.universe_domain,
171
- credentials: credentials
171
+ credentials: credentials,
172
+ logger: @config.logger
172
173
  )
173
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
+
174
185
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
175
186
  config.credentials = credentials
176
187
  config.quota_project = @quota_project_id
177
188
  config.endpoint = @bare_metal_solution_stub.endpoint
178
189
  config.universe_domain = @bare_metal_solution_stub.universe_domain
179
190
  config.bindings_override = @config.bindings_override
191
+ config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
180
192
  end
181
193
 
182
194
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -184,6 +196,7 @@ module Google
184
196
  config.quota_project = @quota_project_id
185
197
  config.endpoint = @bare_metal_solution_stub.endpoint
186
198
  config.universe_domain = @bare_metal_solution_stub.universe_domain
199
+ config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
187
200
  end
188
201
  end
189
202
 
@@ -208,6 +221,15 @@ module Google
208
221
  #
209
222
  attr_reader :iam_policy_client
210
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
+
211
233
  # Service calls
212
234
 
213
235
  ##
@@ -294,7 +316,6 @@ module Google
294
316
 
295
317
  @bare_metal_solution_stub.list_instances request, options do |result, operation|
296
318
  yield result, operation if block_given?
297
- return result
298
319
  end
299
320
  rescue ::Gapic::Rest::Error => e
300
321
  raise ::Google::Cloud::Error.from_error(e)
@@ -373,7 +394,6 @@ module Google
373
394
 
374
395
  @bare_metal_solution_stub.get_instance request, options do |result, operation|
375
396
  yield result, operation if block_given?
376
- return result
377
397
  end
378
398
  rescue ::Gapic::Rest::Error => e
379
399
  raise ::Google::Cloud::Error.from_error(e)
@@ -469,7 +489,7 @@ module Google
469
489
  @bare_metal_solution_stub.update_instance request, options do |result, operation|
470
490
  result = ::Gapic::Operation.new result, @operations_client, options: options
471
491
  yield result, operation if block_given?
472
- return result
492
+ throw :response, result
473
493
  end
474
494
  rescue ::Gapic::Rest::Error => e
475
495
  raise ::Google::Cloud::Error.from_error(e)
@@ -552,7 +572,6 @@ module Google
552
572
 
553
573
  @bare_metal_solution_stub.rename_instance request, options do |result, operation|
554
574
  yield result, operation if block_given?
555
- return result
556
575
  end
557
576
  rescue ::Gapic::Rest::Error => e
558
577
  raise ::Google::Cloud::Error.from_error(e)
@@ -640,7 +659,7 @@ module Google
640
659
  @bare_metal_solution_stub.reset_instance request, options do |result, operation|
641
660
  result = ::Gapic::Operation.new result, @operations_client, options: options
642
661
  yield result, operation if block_given?
643
- return result
662
+ throw :response, result
644
663
  end
645
664
  rescue ::Gapic::Rest::Error => e
646
665
  raise ::Google::Cloud::Error.from_error(e)
@@ -727,7 +746,7 @@ module Google
727
746
  @bare_metal_solution_stub.start_instance request, options do |result, operation|
728
747
  result = ::Gapic::Operation.new result, @operations_client, options: options
729
748
  yield result, operation if block_given?
730
- return result
749
+ throw :response, result
731
750
  end
732
751
  rescue ::Gapic::Rest::Error => e
733
752
  raise ::Google::Cloud::Error.from_error(e)
@@ -814,7 +833,7 @@ module Google
814
833
  @bare_metal_solution_stub.stop_instance request, options do |result, operation|
815
834
  result = ::Gapic::Operation.new result, @operations_client, options: options
816
835
  yield result, operation if block_given?
817
- return result
836
+ throw :response, result
818
837
  end
819
838
  rescue ::Gapic::Rest::Error => e
820
839
  raise ::Google::Cloud::Error.from_error(e)
@@ -901,7 +920,7 @@ module Google
901
920
  @bare_metal_solution_stub.enable_interactive_serial_console request, options do |result, operation|
902
921
  result = ::Gapic::Operation.new result, @operations_client, options: options
903
922
  yield result, operation if block_given?
904
- return result
923
+ throw :response, result
905
924
  end
906
925
  rescue ::Gapic::Rest::Error => e
907
926
  raise ::Google::Cloud::Error.from_error(e)
@@ -988,7 +1007,7 @@ module Google
988
1007
  @bare_metal_solution_stub.disable_interactive_serial_console request, options do |result, operation|
989
1008
  result = ::Gapic::Operation.new result, @operations_client, options: options
990
1009
  yield result, operation if block_given?
991
- return result
1010
+ throw :response, result
992
1011
  end
993
1012
  rescue ::Gapic::Rest::Error => e
994
1013
  raise ::Google::Cloud::Error.from_error(e)
@@ -1079,7 +1098,7 @@ module Google
1079
1098
  @bare_metal_solution_stub.detach_lun request, options do |result, operation|
1080
1099
  result = ::Gapic::Operation.new result, @operations_client, options: options
1081
1100
  yield result, operation if block_given?
1082
- return result
1101
+ throw :response, result
1083
1102
  end
1084
1103
  rescue ::Gapic::Rest::Error => e
1085
1104
  raise ::Google::Cloud::Error.from_error(e)
@@ -1169,7 +1188,7 @@ module Google
1169
1188
  @bare_metal_solution_stub.list_ssh_keys request, options do |result, operation|
1170
1189
  result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_ssh_keys, "ssh_keys", request, result, options
1171
1190
  yield result, operation if block_given?
1172
- return result
1191
+ throw :response, result
1173
1192
  end
1174
1193
  rescue ::Gapic::Rest::Error => e
1175
1194
  raise ::Google::Cloud::Error.from_error(e)
@@ -1257,7 +1276,6 @@ module Google
1257
1276
 
1258
1277
  @bare_metal_solution_stub.create_ssh_key request, options do |result, operation|
1259
1278
  yield result, operation if block_given?
1260
- return result
1261
1279
  end
1262
1280
  rescue ::Gapic::Rest::Error => e
1263
1281
  raise ::Google::Cloud::Error.from_error(e)
@@ -1337,7 +1355,6 @@ module Google
1337
1355
 
1338
1356
  @bare_metal_solution_stub.delete_ssh_key request, options do |result, operation|
1339
1357
  yield result, operation if block_given?
1340
- return result
1341
1358
  end
1342
1359
  rescue ::Gapic::Rest::Error => e
1343
1360
  raise ::Google::Cloud::Error.from_error(e)
@@ -1427,7 +1444,6 @@ module Google
1427
1444
 
1428
1445
  @bare_metal_solution_stub.list_volumes request, options do |result, operation|
1429
1446
  yield result, operation if block_given?
1430
- return result
1431
1447
  end
1432
1448
  rescue ::Gapic::Rest::Error => e
1433
1449
  raise ::Google::Cloud::Error.from_error(e)
@@ -1506,7 +1522,6 @@ module Google
1506
1522
 
1507
1523
  @bare_metal_solution_stub.get_volume request, options do |result, operation|
1508
1524
  yield result, operation if block_given?
1509
- return result
1510
1525
  end
1511
1526
  rescue ::Gapic::Rest::Error => e
1512
1527
  raise ::Google::Cloud::Error.from_error(e)
@@ -1600,7 +1615,7 @@ module Google
1600
1615
  @bare_metal_solution_stub.update_volume request, options do |result, operation|
1601
1616
  result = ::Gapic::Operation.new result, @operations_client, options: options
1602
1617
  yield result, operation if block_given?
1603
- return result
1618
+ throw :response, result
1604
1619
  end
1605
1620
  rescue ::Gapic::Rest::Error => e
1606
1621
  raise ::Google::Cloud::Error.from_error(e)
@@ -1683,7 +1698,6 @@ module Google
1683
1698
 
1684
1699
  @bare_metal_solution_stub.rename_volume request, options do |result, operation|
1685
1700
  yield result, operation if block_given?
1686
- return result
1687
1701
  end
1688
1702
  rescue ::Gapic::Rest::Error => e
1689
1703
  raise ::Google::Cloud::Error.from_error(e)
@@ -1771,7 +1785,7 @@ module Google
1771
1785
  @bare_metal_solution_stub.evict_volume request, options do |result, operation|
1772
1786
  result = ::Gapic::Operation.new result, @operations_client, options: options
1773
1787
  yield result, operation if block_given?
1774
- return result
1788
+ throw :response, result
1775
1789
  end
1776
1790
  rescue ::Gapic::Rest::Error => e
1777
1791
  raise ::Google::Cloud::Error.from_error(e)
@@ -1860,7 +1874,7 @@ module Google
1860
1874
  @bare_metal_solution_stub.resize_volume request, options do |result, operation|
1861
1875
  result = ::Gapic::Operation.new result, @operations_client, options: options
1862
1876
  yield result, operation if block_given?
1863
- return result
1877
+ throw :response, result
1864
1878
  end
1865
1879
  rescue ::Gapic::Rest::Error => e
1866
1880
  raise ::Google::Cloud::Error.from_error(e)
@@ -1950,7 +1964,6 @@ module Google
1950
1964
 
1951
1965
  @bare_metal_solution_stub.list_networks request, options do |result, operation|
1952
1966
  yield result, operation if block_given?
1953
- return result
1954
1967
  end
1955
1968
  rescue ::Gapic::Rest::Error => e
1956
1969
  raise ::Google::Cloud::Error.from_error(e)
@@ -2030,7 +2043,6 @@ module Google
2030
2043
 
2031
2044
  @bare_metal_solution_stub.list_network_usage request, options do |result, operation|
2032
2045
  yield result, operation if block_given?
2033
- return result
2034
2046
  end
2035
2047
  rescue ::Gapic::Rest::Error => e
2036
2048
  raise ::Google::Cloud::Error.from_error(e)
@@ -2109,7 +2121,6 @@ module Google
2109
2121
 
2110
2122
  @bare_metal_solution_stub.get_network request, options do |result, operation|
2111
2123
  yield result, operation if block_given?
2112
- return result
2113
2124
  end
2114
2125
  rescue ::Gapic::Rest::Error => e
2115
2126
  raise ::Google::Cloud::Error.from_error(e)
@@ -2203,7 +2214,7 @@ module Google
2203
2214
  @bare_metal_solution_stub.update_network request, options do |result, operation|
2204
2215
  result = ::Gapic::Operation.new result, @operations_client, options: options
2205
2216
  yield result, operation if block_given?
2206
- return result
2217
+ throw :response, result
2207
2218
  end
2208
2219
  rescue ::Gapic::Rest::Error => e
2209
2220
  raise ::Google::Cloud::Error.from_error(e)
@@ -2285,7 +2296,6 @@ module Google
2285
2296
 
2286
2297
  @bare_metal_solution_stub.create_volume_snapshot request, options do |result, operation|
2287
2298
  yield result, operation if block_given?
2288
- return result
2289
2299
  end
2290
2300
  rescue ::Gapic::Rest::Error => e
2291
2301
  raise ::Google::Cloud::Error.from_error(e)
@@ -2374,7 +2384,7 @@ module Google
2374
2384
  @bare_metal_solution_stub.restore_volume_snapshot request, options do |result, operation|
2375
2385
  result = ::Gapic::Operation.new result, @operations_client, options: options
2376
2386
  yield result, operation if block_given?
2377
- return result
2387
+ throw :response, result
2378
2388
  end
2379
2389
  rescue ::Gapic::Rest::Error => e
2380
2390
  raise ::Google::Cloud::Error.from_error(e)
@@ -2454,7 +2464,6 @@ module Google
2454
2464
 
2455
2465
  @bare_metal_solution_stub.delete_volume_snapshot request, options do |result, operation|
2456
2466
  yield result, operation if block_given?
2457
- return result
2458
2467
  end
2459
2468
  rescue ::Gapic::Rest::Error => e
2460
2469
  raise ::Google::Cloud::Error.from_error(e)
@@ -2534,7 +2543,6 @@ module Google
2534
2543
 
2535
2544
  @bare_metal_solution_stub.get_volume_snapshot request, options do |result, operation|
2536
2545
  yield result, operation if block_given?
2537
- return result
2538
2546
  end
2539
2547
  rescue ::Gapic::Rest::Error => e
2540
2548
  raise ::Google::Cloud::Error.from_error(e)
@@ -2624,7 +2632,6 @@ module Google
2624
2632
 
2625
2633
  @bare_metal_solution_stub.list_volume_snapshots request, options do |result, operation|
2626
2634
  yield result, operation if block_given?
2627
- return result
2628
2635
  end
2629
2636
  rescue ::Gapic::Rest::Error => e
2630
2637
  raise ::Google::Cloud::Error.from_error(e)
@@ -2703,7 +2710,6 @@ module Google
2703
2710
 
2704
2711
  @bare_metal_solution_stub.get_lun request, options do |result, operation|
2705
2712
  yield result, operation if block_given?
2706
- return result
2707
2713
  end
2708
2714
  rescue ::Gapic::Rest::Error => e
2709
2715
  raise ::Google::Cloud::Error.from_error(e)
@@ -2791,7 +2797,6 @@ module Google
2791
2797
 
2792
2798
  @bare_metal_solution_stub.list_luns request, options do |result, operation|
2793
2799
  yield result, operation if block_given?
2794
- return result
2795
2800
  end
2796
2801
  rescue ::Gapic::Rest::Error => e
2797
2802
  raise ::Google::Cloud::Error.from_error(e)
@@ -2879,7 +2884,7 @@ module Google
2879
2884
  @bare_metal_solution_stub.evict_lun request, options do |result, operation|
2880
2885
  result = ::Gapic::Operation.new result, @operations_client, options: options
2881
2886
  yield result, operation if block_given?
2882
- return result
2887
+ throw :response, result
2883
2888
  end
2884
2889
  rescue ::Gapic::Rest::Error => e
2885
2890
  raise ::Google::Cloud::Error.from_error(e)
@@ -2958,7 +2963,6 @@ module Google
2958
2963
 
2959
2964
  @bare_metal_solution_stub.get_nfs_share request, options do |result, operation|
2960
2965
  yield result, operation if block_given?
2961
- return result
2962
2966
  end
2963
2967
  rescue ::Gapic::Rest::Error => e
2964
2968
  raise ::Google::Cloud::Error.from_error(e)
@@ -3048,7 +3052,6 @@ module Google
3048
3052
 
3049
3053
  @bare_metal_solution_stub.list_nfs_shares request, options do |result, operation|
3050
3054
  yield result, operation if block_given?
3051
- return result
3052
3055
  end
3053
3056
  rescue ::Gapic::Rest::Error => e
3054
3057
  raise ::Google::Cloud::Error.from_error(e)
@@ -3143,7 +3146,7 @@ module Google
3143
3146
  @bare_metal_solution_stub.update_nfs_share request, options do |result, operation|
3144
3147
  result = ::Gapic::Operation.new result, @operations_client, options: options
3145
3148
  yield result, operation if block_given?
3146
- return result
3149
+ throw :response, result
3147
3150
  end
3148
3151
  rescue ::Gapic::Rest::Error => e
3149
3152
  raise ::Google::Cloud::Error.from_error(e)
@@ -3232,7 +3235,7 @@ module Google
3232
3235
  @bare_metal_solution_stub.create_nfs_share request, options do |result, operation|
3233
3236
  result = ::Gapic::Operation.new result, @operations_client, options: options
3234
3237
  yield result, operation if block_given?
3235
- return result
3238
+ throw :response, result
3236
3239
  end
3237
3240
  rescue ::Gapic::Rest::Error => e
3238
3241
  raise ::Google::Cloud::Error.from_error(e)
@@ -3315,7 +3318,6 @@ module Google
3315
3318
 
3316
3319
  @bare_metal_solution_stub.rename_nfs_share request, options do |result, operation|
3317
3320
  yield result, operation if block_given?
3318
- return result
3319
3321
  end
3320
3322
  rescue ::Gapic::Rest::Error => e
3321
3323
  raise ::Google::Cloud::Error.from_error(e)
@@ -3402,7 +3404,7 @@ module Google
3402
3404
  @bare_metal_solution_stub.delete_nfs_share request, options do |result, operation|
3403
3405
  result = ::Gapic::Operation.new result, @operations_client, options: options
3404
3406
  yield result, operation if block_given?
3405
- return result
3407
+ throw :response, result
3406
3408
  end
3407
3409
  rescue ::Gapic::Rest::Error => e
3408
3410
  raise ::Google::Cloud::Error.from_error(e)
@@ -3493,7 +3495,7 @@ module Google
3493
3495
  @bare_metal_solution_stub.list_provisioning_quotas request, options do |result, operation|
3494
3496
  result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_provisioning_quotas, "provisioning_quotas", request, result, options
3495
3497
  yield result, operation if block_given?
3496
- return result
3498
+ throw :response, result
3497
3499
  end
3498
3500
  rescue ::Gapic::Rest::Error => e
3499
3501
  raise ::Google::Cloud::Error.from_error(e)
@@ -3578,7 +3580,6 @@ module Google
3578
3580
 
3579
3581
  @bare_metal_solution_stub.submit_provisioning_config request, options do |result, operation|
3580
3582
  yield result, operation if block_given?
3581
- return result
3582
3583
  end
3583
3584
  rescue ::Gapic::Rest::Error => e
3584
3585
  raise ::Google::Cloud::Error.from_error(e)
@@ -3657,7 +3658,6 @@ module Google
3657
3658
 
3658
3659
  @bare_metal_solution_stub.get_provisioning_config request, options do |result, operation|
3659
3660
  yield result, operation if block_given?
3660
- return result
3661
3661
  end
3662
3662
  rescue ::Gapic::Rest::Error => e
3663
3663
  raise ::Google::Cloud::Error.from_error(e)
@@ -3742,7 +3742,6 @@ module Google
3742
3742
 
3743
3743
  @bare_metal_solution_stub.create_provisioning_config request, options do |result, operation|
3744
3744
  yield result, operation if block_given?
3745
- return result
3746
3745
  end
3747
3746
  rescue ::Gapic::Rest::Error => e
3748
3747
  raise ::Google::Cloud::Error.from_error(e)
@@ -3826,7 +3825,6 @@ module Google
3826
3825
 
3827
3826
  @bare_metal_solution_stub.update_provisioning_config request, options do |result, operation|
3828
3827
  yield result, operation if block_given?
3829
- return result
3830
3828
  end
3831
3829
  rescue ::Gapic::Rest::Error => e
3832
3830
  raise ::Google::Cloud::Error.from_error(e)
@@ -3909,7 +3907,6 @@ module Google
3909
3907
 
3910
3908
  @bare_metal_solution_stub.rename_network request, options do |result, operation|
3911
3909
  yield result, operation if block_given?
3912
- return result
3913
3910
  end
3914
3911
  rescue ::Gapic::Rest::Error => e
3915
3912
  raise ::Google::Cloud::Error.from_error(e)
@@ -4000,7 +3997,7 @@ module Google
4000
3997
  @bare_metal_solution_stub.list_os_images request, options do |result, operation|
4001
3998
  result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_os_images, "os_images", request, result, options
4002
3999
  yield result, operation if block_given?
4003
- return result
4000
+ throw :response, result
4004
4001
  end
4005
4002
  rescue ::Gapic::Rest::Error => e
4006
4003
  raise ::Google::Cloud::Error.from_error(e)
@@ -4080,6 +4077,11 @@ module Google
4080
4077
  # default endpoint URL. The default value of nil uses the environment
4081
4078
  # universe (usually the default "googleapis.com" universe).
4082
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]
4083
4085
  #
4084
4086
  class Configuration
4085
4087
  extend ::Gapic::Config
@@ -4108,6 +4110,7 @@ module Google
4108
4110
  # by the host service.
4109
4111
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
4110
4112
  config_attr :bindings_override, {}, ::Hash, nil
4113
+ config_attr :logger, :default, ::Logger, nil, :default
4111
4114
 
4112
4115
  # @private
4113
4116
  def initialize parent_config = nil
@@ -115,14 +115,6 @@ module Google
115
115
  # Lists operations that match the specified filter in the request. If the
116
116
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
117
117
  #
118
- # NOTE: the `name` binding allows API services to override the binding
119
- # to use different resource name schemes, such as `users/*/operations`. To
120
- # override the binding, API services can add a binding such as
121
- # `"/v1/{name=users/*}/operations"` to their service configuration.
122
- # For backwards compatibility, the default name includes the operations
123
- # collection id, however overriding users must ensure the name binding
124
- # is the parent resource, without the operations collection id.
125
- #
126
118
  # @overload list_operations(request, options = nil)
127
119
  # Pass arguments to `list_operations` via a request object, either of type
128
120
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -204,7 +196,7 @@ module Google
204
196
  @operations_stub.list_operations request, options do |result, operation|
205
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
206
198
  yield result, operation if block_given?
207
- return result
199
+ throw :response, result
208
200
  end
209
201
  rescue ::Gapic::Rest::Error => e
210
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -293,7 +285,7 @@ module Google
293
285
  @operations_stub.get_operation request, options do |result, operation|
294
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
295
287
  yield result, operation if block_given?
296
- return result
288
+ throw :response, result
297
289
  end
298
290
  rescue ::Gapic::Rest::Error => e
299
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -375,7 +367,6 @@ module Google
375
367
 
376
368
  @operations_stub.delete_operation request, options do |result, operation|
377
369
  yield result, operation if block_given?
378
- return result
379
370
  end
380
371
  rescue ::Gapic::Rest::Error => e
381
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -390,8 +381,9 @@ module Google
390
381
  # other methods to check whether the cancellation succeeded or whether the
391
382
  # operation completed despite cancellation. On successful cancellation,
392
383
  # the operation is not deleted; instead, it becomes an operation with
393
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
394
- # corresponding to `Code.CANCELLED`.
384
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
385
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
386
+ # `Code.CANCELLED`.
395
387
  #
396
388
  # @overload cancel_operation(request, options = nil)
397
389
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -463,7 +455,6 @@ module Google
463
455
 
464
456
  @operations_stub.cancel_operation request, options do |result, operation|
465
457
  yield result, operation if block_given?
466
- return result
467
458
  end
468
459
  rescue ::Gapic::Rest::Error => e
469
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -543,6 +534,11 @@ module Google
543
534
  # default endpoint URL. The default value of nil uses the environment
544
535
  # universe (usually the default "googleapis.com" universe).
545
536
  # @return [::String,nil]
537
+ # @!attribute [rw] logger
538
+ # A custom logger to use for request/response debug logging, or the value
539
+ # `:default` (the default) to construct a default logger, or `nil` to
540
+ # explicitly disable logging.
541
+ # @return [::Logger,:default,nil]
546
542
  #
547
543
  class Configuration
548
544
  extend ::Gapic::Config
@@ -564,6 +560,7 @@ module Google
564
560
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
565
561
  config_attr :quota_project, nil, ::String, nil
566
562
  config_attr :universe_domain, nil, ::String, nil
563
+ config_attr :logger, :default, ::Logger, nil, :default
567
564
 
568
565
  # @private
569
566
  def initialize parent_config = nil
@@ -683,16 +680,18 @@ module Google
683
680
 
684
681
  response = @client_stub.make_http_request(
685
682
  verb,
686
- uri: uri,
687
- body: body || "",
688
- params: query_string_params,
683
+ uri: uri,
684
+ body: body || "",
685
+ params: query_string_params,
686
+ method_name: "list_operations",
689
687
  options: options
690
688
  )
691
689
  operation = ::Gapic::Rest::TransportOperation.new response
692
690
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
693
-
694
- yield result, operation if block_given?
695
- result
691
+ catch :response do
692
+ yield result, operation if block_given?
693
+ result
694
+ end
696
695
  end
697
696
 
698
697
  ##
@@ -721,16 +720,18 @@ module Google
721
720
 
722
721
  response = @client_stub.make_http_request(
723
722
  verb,
724
- uri: uri,
725
- body: body || "",
726
- params: query_string_params,
723
+ uri: uri,
724
+ body: body || "",
725
+ params: query_string_params,
726
+ method_name: "get_operation",
727
727
  options: options
728
728
  )
729
729
  operation = ::Gapic::Rest::TransportOperation.new response
730
730
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
731
-
732
- yield result, operation if block_given?
733
- result
731
+ catch :response do
732
+ yield result, operation if block_given?
733
+ result
734
+ end
734
735
  end
735
736
 
736
737
  ##
@@ -759,16 +760,18 @@ module Google
759
760
 
760
761
  response = @client_stub.make_http_request(
761
762
  verb,
762
- uri: uri,
763
- body: body || "",
764
- params: query_string_params,
763
+ uri: uri,
764
+ body: body || "",
765
+ params: query_string_params,
766
+ method_name: "delete_operation",
765
767
  options: options
766
768
  )
767
769
  operation = ::Gapic::Rest::TransportOperation.new response
768
770
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
769
-
770
- yield result, operation if block_given?
771
- result
771
+ catch :response do
772
+ yield result, operation if block_given?
773
+ result
774
+ end
772
775
  end
773
776
 
774
777
  ##
@@ -797,16 +800,18 @@ module Google
797
800
 
798
801
  response = @client_stub.make_http_request(
799
802
  verb,
800
- uri: uri,
801
- body: body || "",
802
- params: query_string_params,
803
+ uri: uri,
804
+ body: body || "",
805
+ params: query_string_params,
806
+ method_name: "cancel_operation",
803
807
  options: options
804
808
  )
805
809
  operation = ::Gapic::Rest::TransportOperation.new response
806
810
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
807
-
808
- yield result, operation if block_given?
809
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
810
815
  end
811
816
 
812
817
  ##