google-cloud-edge_container-v1 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d848ad458afddcc4f5236d6522fae53fc6f6dd900e73abe1695970ae02536e35
4
- data.tar.gz: 7e2d8fa50da0bb3d11cd2906b2dc5fb593f807df09efa03d212341183da88741
3
+ metadata.gz: 7983eee36d27f5669d033d8f443cd64c6fb95c0e24f78632dd6f3a62e1287af4
4
+ data.tar.gz: 33d44530ade3aa197c9733866fed8994ea7f36dcacd2e49d537cd83fbd095dda
5
5
  SHA512:
6
- metadata.gz: 95928b6a7af7a8d72bfcb5a0c5140823babdc18d296eb7c984018ec9c761de8a2f396e48a3c2e3b5b5a6fc2a514efcf40a321c3d63fc686a5baa2020a4355a3b
7
- data.tar.gz: fb19faf714667e3697065f7e2b8c427113cdab565622ee5d259829660ceeabc3b20d0dd8466f3380c57ed934ede67e9cc874efd96ab1006f7afd060fd607eeca
6
+ metadata.gz: f258ddc48afdc6404fcf0ec70e2310ed3940096e5e4940c9b3d02148d58a51bd5009ce07a7eeb26e60ad60f1f38af259b88ab436416534e4a68a6e30ed66f173
7
+ data.tar.gz: d47fdabae5701987a8c7cd1e007d40f051a88b3daede94a4b5ee3d1bc94e3b70c7d6bb8f86be34a33839884684c05336a098728f7c15bb8f29acfc6178b2004c
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/overview)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/edge_container/v1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -239,14 +239,26 @@ module Google
239
239
  universe_domain: @config.universe_domain,
240
240
  channel_args: @config.channel_args,
241
241
  interceptors: @config.interceptors,
242
- channel_pool_config: @config.channel_pool
242
+ channel_pool_config: @config.channel_pool,
243
+ logger: @config.logger
243
244
  )
244
245
 
246
+ @edge_container_stub.stub_logger&.info do |entry|
247
+ entry.set_system_name
248
+ entry.set_service
249
+ entry.message = "Created client for #{entry.service}"
250
+ entry.set_credentials_fields credentials
251
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
252
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
253
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
254
+ end
255
+
245
256
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
246
257
  config.credentials = credentials
247
258
  config.quota_project = @quota_project_id
248
259
  config.endpoint = @edge_container_stub.endpoint
249
260
  config.universe_domain = @edge_container_stub.universe_domain
261
+ config.logger = @edge_container_stub.logger if config.respond_to? :logger=
250
262
  end
251
263
  end
252
264
 
@@ -264,6 +276,15 @@ module Google
264
276
  #
265
277
  attr_reader :location_client
266
278
 
279
+ ##
280
+ # The logger used for request/response debug logging.
281
+ #
282
+ # @return [Logger]
283
+ #
284
+ def logger
285
+ @edge_container_stub.logger
286
+ end
287
+
267
288
  # Service calls
268
289
 
269
290
  ##
@@ -360,7 +381,7 @@ module Google
360
381
  @edge_container_stub.call_rpc :list_clusters, request, options: options do |response, operation|
361
382
  response = ::Gapic::PagedEnumerable.new @edge_container_stub, :list_clusters, request, response, operation, options
362
383
  yield response, operation if block_given?
363
- return response
384
+ throw :response, response
364
385
  end
365
386
  rescue ::GRPC::BadStatus => e
366
387
  raise ::Google::Cloud::Error.from_error(e)
@@ -446,7 +467,6 @@ module Google
446
467
 
447
468
  @edge_container_stub.call_rpc :get_cluster, request, options: options do |response, operation|
448
469
  yield response, operation if block_given?
449
- return response
450
470
  end
451
471
  rescue ::GRPC::BadStatus => e
452
472
  raise ::Google::Cloud::Error.from_error(e)
@@ -548,7 +568,7 @@ module Google
548
568
  @edge_container_stub.call_rpc :create_cluster, request, options: options do |response, operation|
549
569
  response = ::Gapic::Operation.new response, @operations_client, options: options
550
570
  yield response, operation if block_given?
551
- return response
571
+ throw :response, response
552
572
  end
553
573
  rescue ::GRPC::BadStatus => e
554
574
  raise ::Google::Cloud::Error.from_error(e)
@@ -652,7 +672,7 @@ module Google
652
672
  @edge_container_stub.call_rpc :update_cluster, request, options: options do |response, operation|
653
673
  response = ::Gapic::Operation.new response, @operations_client, options: options
654
674
  yield response, operation if block_given?
655
- return response
675
+ throw :response, response
656
676
  end
657
677
  rescue ::GRPC::BadStatus => e
658
678
  raise ::Google::Cloud::Error.from_error(e)
@@ -754,7 +774,7 @@ module Google
754
774
  @edge_container_stub.call_rpc :upgrade_cluster, request, options: options do |response, operation|
755
775
  response = ::Gapic::Operation.new response, @operations_client, options: options
756
776
  yield response, operation if block_given?
757
- return response
777
+ throw :response, response
758
778
  end
759
779
  rescue ::GRPC::BadStatus => e
760
780
  raise ::Google::Cloud::Error.from_error(e)
@@ -852,7 +872,7 @@ module Google
852
872
  @edge_container_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
853
873
  response = ::Gapic::Operation.new response, @operations_client, options: options
854
874
  yield response, operation if block_given?
855
- return response
875
+ throw :response, response
856
876
  end
857
877
  rescue ::GRPC::BadStatus => e
858
878
  raise ::Google::Cloud::Error.from_error(e)
@@ -938,7 +958,6 @@ module Google
938
958
 
939
959
  @edge_container_stub.call_rpc :generate_access_token, request, options: options do |response, operation|
940
960
  yield response, operation if block_given?
941
- return response
942
961
  end
943
962
  rescue ::GRPC::BadStatus => e
944
963
  raise ::Google::Cloud::Error.from_error(e)
@@ -1024,7 +1043,6 @@ module Google
1024
1043
 
1025
1044
  @edge_container_stub.call_rpc :generate_offline_credential, request, options: options do |response, operation|
1026
1045
  yield response, operation if block_given?
1027
- return response
1028
1046
  end
1029
1047
  rescue ::GRPC::BadStatus => e
1030
1048
  raise ::Google::Cloud::Error.from_error(e)
@@ -1123,7 +1141,7 @@ module Google
1123
1141
  @edge_container_stub.call_rpc :list_node_pools, request, options: options do |response, operation|
1124
1142
  response = ::Gapic::PagedEnumerable.new @edge_container_stub, :list_node_pools, request, response, operation, options
1125
1143
  yield response, operation if block_given?
1126
- return response
1144
+ throw :response, response
1127
1145
  end
1128
1146
  rescue ::GRPC::BadStatus => e
1129
1147
  raise ::Google::Cloud::Error.from_error(e)
@@ -1209,7 +1227,6 @@ module Google
1209
1227
 
1210
1228
  @edge_container_stub.call_rpc :get_node_pool, request, options: options do |response, operation|
1211
1229
  yield response, operation if block_given?
1212
- return response
1213
1230
  end
1214
1231
  rescue ::GRPC::BadStatus => e
1215
1232
  raise ::Google::Cloud::Error.from_error(e)
@@ -1311,7 +1328,7 @@ module Google
1311
1328
  @edge_container_stub.call_rpc :create_node_pool, request, options: options do |response, operation|
1312
1329
  response = ::Gapic::Operation.new response, @operations_client, options: options
1313
1330
  yield response, operation if block_given?
1314
- return response
1331
+ throw :response, response
1315
1332
  end
1316
1333
  rescue ::GRPC::BadStatus => e
1317
1334
  raise ::Google::Cloud::Error.from_error(e)
@@ -1415,7 +1432,7 @@ module Google
1415
1432
  @edge_container_stub.call_rpc :update_node_pool, request, options: options do |response, operation|
1416
1433
  response = ::Gapic::Operation.new response, @operations_client, options: options
1417
1434
  yield response, operation if block_given?
1418
- return response
1435
+ throw :response, response
1419
1436
  end
1420
1437
  rescue ::GRPC::BadStatus => e
1421
1438
  raise ::Google::Cloud::Error.from_error(e)
@@ -1513,7 +1530,7 @@ module Google
1513
1530
  @edge_container_stub.call_rpc :delete_node_pool, request, options: options do |response, operation|
1514
1531
  response = ::Gapic::Operation.new response, @operations_client, options: options
1515
1532
  yield response, operation if block_given?
1516
- return response
1533
+ throw :response, response
1517
1534
  end
1518
1535
  rescue ::GRPC::BadStatus => e
1519
1536
  raise ::Google::Cloud::Error.from_error(e)
@@ -1612,7 +1629,7 @@ module Google
1612
1629
  @edge_container_stub.call_rpc :list_machines, request, options: options do |response, operation|
1613
1630
  response = ::Gapic::PagedEnumerable.new @edge_container_stub, :list_machines, request, response, operation, options
1614
1631
  yield response, operation if block_given?
1615
- return response
1632
+ throw :response, response
1616
1633
  end
1617
1634
  rescue ::GRPC::BadStatus => e
1618
1635
  raise ::Google::Cloud::Error.from_error(e)
@@ -1698,7 +1715,6 @@ module Google
1698
1715
 
1699
1716
  @edge_container_stub.call_rpc :get_machine, request, options: options do |response, operation|
1700
1717
  yield response, operation if block_given?
1701
- return response
1702
1718
  end
1703
1719
  rescue ::GRPC::BadStatus => e
1704
1720
  raise ::Google::Cloud::Error.from_error(e)
@@ -1798,7 +1814,7 @@ module Google
1798
1814
  @edge_container_stub.call_rpc :list_vpn_connections, request, options: options do |response, operation|
1799
1815
  response = ::Gapic::PagedEnumerable.new @edge_container_stub, :list_vpn_connections, request, response, operation, options
1800
1816
  yield response, operation if block_given?
1801
- return response
1817
+ throw :response, response
1802
1818
  end
1803
1819
  rescue ::GRPC::BadStatus => e
1804
1820
  raise ::Google::Cloud::Error.from_error(e)
@@ -1884,7 +1900,6 @@ module Google
1884
1900
 
1885
1901
  @edge_container_stub.call_rpc :get_vpn_connection, request, options: options do |response, operation|
1886
1902
  yield response, operation if block_given?
1887
- return response
1888
1903
  end
1889
1904
  rescue ::GRPC::BadStatus => e
1890
1905
  raise ::Google::Cloud::Error.from_error(e)
@@ -1986,7 +2001,7 @@ module Google
1986
2001
  @edge_container_stub.call_rpc :create_vpn_connection, request, options: options do |response, operation|
1987
2002
  response = ::Gapic::Operation.new response, @operations_client, options: options
1988
2003
  yield response, operation if block_given?
1989
- return response
2004
+ throw :response, response
1990
2005
  end
1991
2006
  rescue ::GRPC::BadStatus => e
1992
2007
  raise ::Google::Cloud::Error.from_error(e)
@@ -2084,7 +2099,7 @@ module Google
2084
2099
  @edge_container_stub.call_rpc :delete_vpn_connection, request, options: options do |response, operation|
2085
2100
  response = ::Gapic::Operation.new response, @operations_client, options: options
2086
2101
  yield response, operation if block_given?
2087
- return response
2102
+ throw :response, response
2088
2103
  end
2089
2104
  rescue ::GRPC::BadStatus => e
2090
2105
  raise ::Google::Cloud::Error.from_error(e)
@@ -2171,7 +2186,6 @@ module Google
2171
2186
 
2172
2187
  @edge_container_stub.call_rpc :get_server_config, request, options: options do |response, operation|
2173
2188
  yield response, operation if block_given?
2174
- return response
2175
2189
  end
2176
2190
  rescue ::GRPC::BadStatus => e
2177
2191
  raise ::Google::Cloud::Error.from_error(e)
@@ -2260,6 +2274,11 @@ module Google
2260
2274
  # default endpoint URL. The default value of nil uses the environment
2261
2275
  # universe (usually the default "googleapis.com" universe).
2262
2276
  # @return [::String,nil]
2277
+ # @!attribute [rw] logger
2278
+ # A custom logger to use for request/response debug logging, or the value
2279
+ # `:default` (the default) to construct a default logger, or `nil` to
2280
+ # explicitly disable logging.
2281
+ # @return [::Logger,:default,nil]
2263
2282
  #
2264
2283
  class Configuration
2265
2284
  extend ::Gapic::Config
@@ -2284,6 +2303,7 @@ module Google
2284
2303
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2285
2304
  config_attr :quota_project, nil, ::String, nil
2286
2305
  config_attr :universe_domain, nil, ::String, nil
2306
+ config_attr :logger, :default, ::Logger, nil, :default
2287
2307
 
2288
2308
  # @private
2289
2309
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,6 +679,11 @@ module Google
688
679
  # default endpoint URL. The default value of nil uses the environment
689
680
  # universe (usually the default "googleapis.com" universe).
690
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
691
687
  #
692
688
  class Configuration
693
689
  extend ::Gapic::Config
@@ -712,6 +708,7 @@ module Google
712
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
709
  config_attr :quota_project, nil, ::String, nil
714
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
715
712
 
716
713
  # @private
717
714
  def initialize parent_config = nil
@@ -232,15 +232,27 @@ module Google
232
232
  endpoint: @config.endpoint,
233
233
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
234
234
  universe_domain: @config.universe_domain,
235
- credentials: credentials
235
+ credentials: credentials,
236
+ logger: @config.logger
236
237
  )
237
238
 
239
+ @edge_container_stub.logger(stub: true)&.info do |entry|
240
+ entry.set_system_name
241
+ entry.set_service
242
+ entry.message = "Created client for #{entry.service}"
243
+ entry.set_credentials_fields credentials
244
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
245
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
246
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
247
+ end
248
+
238
249
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
239
250
  config.credentials = credentials
240
251
  config.quota_project = @quota_project_id
241
252
  config.endpoint = @edge_container_stub.endpoint
242
253
  config.universe_domain = @edge_container_stub.universe_domain
243
254
  config.bindings_override = @config.bindings_override
255
+ config.logger = @edge_container_stub.logger if config.respond_to? :logger=
244
256
  end
245
257
  end
246
258
 
@@ -258,6 +270,15 @@ module Google
258
270
  #
259
271
  attr_reader :location_client
260
272
 
273
+ ##
274
+ # The logger used for request/response debug logging.
275
+ #
276
+ # @return [Logger]
277
+ #
278
+ def logger
279
+ @edge_container_stub.logger
280
+ end
281
+
261
282
  # Service calls
262
283
 
263
284
  ##
@@ -346,7 +367,6 @@ module Google
346
367
 
347
368
  @edge_container_stub.list_clusters request, options do |result, operation|
348
369
  yield result, operation if block_given?
349
- return result
350
370
  end
351
371
  rescue ::Gapic::Rest::Error => e
352
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -425,7 +445,6 @@ module Google
425
445
 
426
446
  @edge_container_stub.get_cluster request, options do |result, operation|
427
447
  yield result, operation if block_given?
428
- return result
429
448
  end
430
449
  rescue ::Gapic::Rest::Error => e
431
450
  raise ::Google::Cloud::Error.from_error(e)
@@ -520,7 +539,7 @@ module Google
520
539
  @edge_container_stub.create_cluster request, options do |result, operation|
521
540
  result = ::Gapic::Operation.new result, @operations_client, options: options
522
541
  yield result, operation if block_given?
523
- return result
542
+ throw :response, result
524
543
  end
525
544
  rescue ::Gapic::Rest::Error => e
526
545
  raise ::Google::Cloud::Error.from_error(e)
@@ -617,7 +636,7 @@ module Google
617
636
  @edge_container_stub.update_cluster request, options do |result, operation|
618
637
  result = ::Gapic::Operation.new result, @operations_client, options: options
619
638
  yield result, operation if block_given?
620
- return result
639
+ throw :response, result
621
640
  end
622
641
  rescue ::Gapic::Rest::Error => e
623
642
  raise ::Google::Cloud::Error.from_error(e)
@@ -712,7 +731,7 @@ module Google
712
731
  @edge_container_stub.upgrade_cluster request, options do |result, operation|
713
732
  result = ::Gapic::Operation.new result, @operations_client, options: options
714
733
  yield result, operation if block_given?
715
- return result
734
+ throw :response, result
716
735
  end
717
736
  rescue ::Gapic::Rest::Error => e
718
737
  raise ::Google::Cloud::Error.from_error(e)
@@ -803,7 +822,7 @@ module Google
803
822
  @edge_container_stub.delete_cluster request, options do |result, operation|
804
823
  result = ::Gapic::Operation.new result, @operations_client, options: options
805
824
  yield result, operation if block_given?
806
- return result
825
+ throw :response, result
807
826
  end
808
827
  rescue ::Gapic::Rest::Error => e
809
828
  raise ::Google::Cloud::Error.from_error(e)
@@ -882,7 +901,6 @@ module Google
882
901
 
883
902
  @edge_container_stub.generate_access_token request, options do |result, operation|
884
903
  yield result, operation if block_given?
885
- return result
886
904
  end
887
905
  rescue ::Gapic::Rest::Error => e
888
906
  raise ::Google::Cloud::Error.from_error(e)
@@ -961,7 +979,6 @@ module Google
961
979
 
962
980
  @edge_container_stub.generate_offline_credential request, options do |result, operation|
963
981
  yield result, operation if block_given?
964
- return result
965
982
  end
966
983
  rescue ::Gapic::Rest::Error => e
967
984
  raise ::Google::Cloud::Error.from_error(e)
@@ -1052,7 +1069,6 @@ module Google
1052
1069
 
1053
1070
  @edge_container_stub.list_node_pools request, options do |result, operation|
1054
1071
  yield result, operation if block_given?
1055
- return result
1056
1072
  end
1057
1073
  rescue ::Gapic::Rest::Error => e
1058
1074
  raise ::Google::Cloud::Error.from_error(e)
@@ -1131,7 +1147,6 @@ module Google
1131
1147
 
1132
1148
  @edge_container_stub.get_node_pool request, options do |result, operation|
1133
1149
  yield result, operation if block_given?
1134
- return result
1135
1150
  end
1136
1151
  rescue ::Gapic::Rest::Error => e
1137
1152
  raise ::Google::Cloud::Error.from_error(e)
@@ -1226,7 +1241,7 @@ module Google
1226
1241
  @edge_container_stub.create_node_pool request, options do |result, operation|
1227
1242
  result = ::Gapic::Operation.new result, @operations_client, options: options
1228
1243
  yield result, operation if block_given?
1229
- return result
1244
+ throw :response, result
1230
1245
  end
1231
1246
  rescue ::Gapic::Rest::Error => e
1232
1247
  raise ::Google::Cloud::Error.from_error(e)
@@ -1323,7 +1338,7 @@ module Google
1323
1338
  @edge_container_stub.update_node_pool request, options do |result, operation|
1324
1339
  result = ::Gapic::Operation.new result, @operations_client, options: options
1325
1340
  yield result, operation if block_given?
1326
- return result
1341
+ throw :response, result
1327
1342
  end
1328
1343
  rescue ::Gapic::Rest::Error => e
1329
1344
  raise ::Google::Cloud::Error.from_error(e)
@@ -1414,7 +1429,7 @@ module Google
1414
1429
  @edge_container_stub.delete_node_pool request, options do |result, operation|
1415
1430
  result = ::Gapic::Operation.new result, @operations_client, options: options
1416
1431
  yield result, operation if block_given?
1417
- return result
1432
+ throw :response, result
1418
1433
  end
1419
1434
  rescue ::Gapic::Rest::Error => e
1420
1435
  raise ::Google::Cloud::Error.from_error(e)
@@ -1505,7 +1520,6 @@ module Google
1505
1520
 
1506
1521
  @edge_container_stub.list_machines request, options do |result, operation|
1507
1522
  yield result, operation if block_given?
1508
- return result
1509
1523
  end
1510
1524
  rescue ::Gapic::Rest::Error => e
1511
1525
  raise ::Google::Cloud::Error.from_error(e)
@@ -1584,7 +1598,6 @@ module Google
1584
1598
 
1585
1599
  @edge_container_stub.get_machine request, options do |result, operation|
1586
1600
  yield result, operation if block_given?
1587
- return result
1588
1601
  end
1589
1602
  rescue ::Gapic::Rest::Error => e
1590
1603
  raise ::Google::Cloud::Error.from_error(e)
@@ -1676,7 +1689,6 @@ module Google
1676
1689
 
1677
1690
  @edge_container_stub.list_vpn_connections request, options do |result, operation|
1678
1691
  yield result, operation if block_given?
1679
- return result
1680
1692
  end
1681
1693
  rescue ::Gapic::Rest::Error => e
1682
1694
  raise ::Google::Cloud::Error.from_error(e)
@@ -1755,7 +1767,6 @@ module Google
1755
1767
 
1756
1768
  @edge_container_stub.get_vpn_connection request, options do |result, operation|
1757
1769
  yield result, operation if block_given?
1758
- return result
1759
1770
  end
1760
1771
  rescue ::Gapic::Rest::Error => e
1761
1772
  raise ::Google::Cloud::Error.from_error(e)
@@ -1850,7 +1861,7 @@ module Google
1850
1861
  @edge_container_stub.create_vpn_connection request, options do |result, operation|
1851
1862
  result = ::Gapic::Operation.new result, @operations_client, options: options
1852
1863
  yield result, operation if block_given?
1853
- return result
1864
+ throw :response, result
1854
1865
  end
1855
1866
  rescue ::Gapic::Rest::Error => e
1856
1867
  raise ::Google::Cloud::Error.from_error(e)
@@ -1941,7 +1952,7 @@ module Google
1941
1952
  @edge_container_stub.delete_vpn_connection request, options do |result, operation|
1942
1953
  result = ::Gapic::Operation.new result, @operations_client, options: options
1943
1954
  yield result, operation if block_given?
1944
- return result
1955
+ throw :response, result
1945
1956
  end
1946
1957
  rescue ::Gapic::Rest::Error => e
1947
1958
  raise ::Google::Cloud::Error.from_error(e)
@@ -2021,7 +2032,6 @@ module Google
2021
2032
 
2022
2033
  @edge_container_stub.get_server_config request, options do |result, operation|
2023
2034
  yield result, operation if block_given?
2024
- return result
2025
2035
  end
2026
2036
  rescue ::Gapic::Rest::Error => e
2027
2037
  raise ::Google::Cloud::Error.from_error(e)
@@ -2101,6 +2111,11 @@ module Google
2101
2111
  # default endpoint URL. The default value of nil uses the environment
2102
2112
  # universe (usually the default "googleapis.com" universe).
2103
2113
  # @return [::String,nil]
2114
+ # @!attribute [rw] logger
2115
+ # A custom logger to use for request/response debug logging, or the value
2116
+ # `:default` (the default) to construct a default logger, or `nil` to
2117
+ # explicitly disable logging.
2118
+ # @return [::Logger,:default,nil]
2104
2119
  #
2105
2120
  class Configuration
2106
2121
  extend ::Gapic::Config
@@ -2129,6 +2144,7 @@ module Google
2129
2144
  # by the host service.
2130
2145
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2131
2146
  config_attr :bindings_override, {}, ::Hash, nil
2147
+ config_attr :logger, :default, ::Logger, nil, :default
2132
2148
 
2133
2149
  # @private
2134
2150
  def initialize parent_config = nil