google-cloud-workstations-v1beta 0.1.2 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 370e00d14b9c24b49c318e4bb15bf6763b8627bcd5c89df09acea1a68644a7a8
4
- data.tar.gz: eaa8e7b970fbb4df698787669ce0a5a887d014926118593bad53e486201e7d60
3
+ metadata.gz: fcb27c84156d16dea0ae2c9de0bb4212a5dc472b696a9d4ae48e2b8b7a3438c9
4
+ data.tar.gz: d62f0d50eef05876da24e44a2941c64f2359b8ea5df1099e0d0b58158964a893
5
5
  SHA512:
6
- metadata.gz: 17834b4ddcd89a2b5d47eb86aee2e6bcfd2a45ece5bf96562d717aab7d52fb395342e0cb5c28b3fbda08860ed2d273a9921c58748a9479a7001d4096f30b9559
7
- data.tar.gz: 0272e55701ba621400943ce4f5d24b95793be085f78aa915e0c2413bf8a703353f1dce885daa52f6dae23a50c2bd5a26579a240ae5e8908006c2e2ef3f62bac3
6
+ metadata.gz: 9da51ff6f138106fe176e754b1de95864a12afd79c4d23d18a1ea3788af0c39b6722b871f15ae0bd54d25f3abd2eb6dc123f1b7802b4a9fe8f4d6e61e0215a76
7
+ data.tar.gz: aeea738d2cb9211aa8adc32cf68acd305dca4fc60e2d88db8ff86102a25b1e4aef3918eef333504e1916d211ddc73d465d9e19b3496fbf80c74db6d7e0faa3ab
data/README.md CHANGED
@@ -42,33 +42,43 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://cloud.google.com/workstations/docs)
43
43
  for general usage information.
44
44
 
45
- ## Enabling Logging
46
-
47
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
48
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
49
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
50
- 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)
51
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
52
-
53
- Configuring a Ruby stdlib logger:
45
+ ## Debug Logging
46
+
47
+ This library comes with opt-in Debug Logging that can help you troubleshoot
48
+ your application's integration with the API. When logging is activated, key
49
+ events such as requests and responses, along with data payloads and metadata
50
+ such as headers and client configuration, are logged to the standard error
51
+ stream.
52
+
53
+ **WARNING:** Client Library Debug Logging includes your data payloads in
54
+ plaintext, which could include sensitive data such as PII for yourself or your
55
+ customers, private keys, or other security data that could be compromising if
56
+ leaked. Always practice good data hygiene with your application logs, and follow
57
+ the principle of least access. Google also recommends that Client Library Debug
58
+ Logging be enabled only temporarily during active debugging, and not used
59
+ permanently in production.
60
+
61
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
62
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
63
+ list of client library gem names. This will select the default logging behavior,
64
+ which writes logs to the standard error stream. On a local workstation, this may
65
+ result in logs appearing on the console. When running on a Google Cloud hosting
66
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
67
+ results in logs appearing alongside your application logs in the
68
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
69
+
70
+ You can customize logging by modifying the `logger` configuration when
71
+ constructing a client object. For example:
54
72
 
55
73
  ```ruby
74
+ require "google/cloud/workstations/v1beta"
56
75
  require "logger"
57
76
 
58
- module MyLogger
59
- LOGGER = Logger.new $stderr, level: Logger::WARN
60
- def logger
61
- LOGGER
62
- end
63
- end
64
-
65
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
66
- module GRPC
67
- extend MyLogger
77
+ client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config|
78
+ config.logger = Logger.new "my-app.log"
68
79
  end
69
80
  ```
70
81
 
71
-
72
82
  ## Google Cloud Samples
73
83
 
74
84
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Workstations
23
23
  module V1beta
24
- VERSION = "0.1.2"
24
+ VERSION = "0.2.0"
25
25
  end
26
26
  end
27
27
  end
@@ -233,14 +233,26 @@ module Google
233
233
  universe_domain: @config.universe_domain,
234
234
  channel_args: @config.channel_args,
235
235
  interceptors: @config.interceptors,
236
- channel_pool_config: @config.channel_pool
236
+ channel_pool_config: @config.channel_pool,
237
+ logger: @config.logger
237
238
  )
238
239
 
240
+ @workstations_stub.stub_logger&.info do |entry|
241
+ entry.set_system_name
242
+ entry.set_service
243
+ entry.message = "Created client for #{entry.service}"
244
+ entry.set_credentials_fields credentials
245
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
246
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
247
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
248
+ end
249
+
239
250
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
240
251
  config.credentials = credentials
241
252
  config.quota_project = @quota_project_id
242
253
  config.endpoint = @workstations_stub.endpoint
243
254
  config.universe_domain = @workstations_stub.universe_domain
255
+ config.logger = @workstations_stub.logger if config.respond_to? :logger=
244
256
  end
245
257
 
246
258
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -248,6 +260,7 @@ module Google
248
260
  config.quota_project = @quota_project_id
249
261
  config.endpoint = @workstations_stub.endpoint
250
262
  config.universe_domain = @workstations_stub.universe_domain
263
+ config.logger = @workstations_stub.logger if config.respond_to? :logger=
251
264
  end
252
265
  end
253
266
 
@@ -272,6 +285,15 @@ module Google
272
285
  #
273
286
  attr_reader :iam_policy_client
274
287
 
288
+ ##
289
+ # The logger used for request/response debug logging.
290
+ #
291
+ # @return [Logger]
292
+ #
293
+ def logger
294
+ @workstations_stub.logger
295
+ end
296
+
275
297
  # Service calls
276
298
 
277
299
  ##
@@ -354,7 +376,6 @@ module Google
354
376
 
355
377
  @workstations_stub.call_rpc :get_workstation_cluster, request, options: options do |response, operation|
356
378
  yield response, operation if block_given?
357
- return response
358
379
  end
359
380
  rescue ::GRPC::BadStatus => e
360
381
  raise ::Google::Cloud::Error.from_error(e)
@@ -450,7 +471,7 @@ module Google
450
471
  @workstations_stub.call_rpc :list_workstation_clusters, request, options: options do |response, operation|
451
472
  response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, request, response, operation, options
452
473
  yield response, operation if block_given?
453
- return response
474
+ throw :response, response
454
475
  end
455
476
  rescue ::GRPC::BadStatus => e
456
477
  raise ::Google::Cloud::Error.from_error(e)
@@ -551,7 +572,7 @@ module Google
551
572
  @workstations_stub.call_rpc :create_workstation_cluster, request, options: options do |response, operation|
552
573
  response = ::Gapic::Operation.new response, @operations_client, options: options
553
574
  yield response, operation if block_given?
554
- return response
575
+ throw :response, response
555
576
  end
556
577
  rescue ::GRPC::BadStatus => e
557
578
  raise ::Google::Cloud::Error.from_error(e)
@@ -655,7 +676,7 @@ module Google
655
676
  @workstations_stub.call_rpc :update_workstation_cluster, request, options: options do |response, operation|
656
677
  response = ::Gapic::Operation.new response, @operations_client, options: options
657
678
  yield response, operation if block_given?
658
- return response
679
+ throw :response, response
659
680
  end
660
681
  rescue ::GRPC::BadStatus => e
661
682
  raise ::Google::Cloud::Error.from_error(e)
@@ -759,7 +780,7 @@ module Google
759
780
  @workstations_stub.call_rpc :delete_workstation_cluster, request, options: options do |response, operation|
760
781
  response = ::Gapic::Operation.new response, @operations_client, options: options
761
782
  yield response, operation if block_given?
762
- return response
783
+ throw :response, response
763
784
  end
764
785
  rescue ::GRPC::BadStatus => e
765
786
  raise ::Google::Cloud::Error.from_error(e)
@@ -845,7 +866,6 @@ module Google
845
866
 
846
867
  @workstations_stub.call_rpc :get_workstation_config, request, options: options do |response, operation|
847
868
  yield response, operation if block_given?
848
- return response
849
869
  end
850
870
  rescue ::GRPC::BadStatus => e
851
871
  raise ::Google::Cloud::Error.from_error(e)
@@ -941,7 +961,7 @@ module Google
941
961
  @workstations_stub.call_rpc :list_workstation_configs, request, options: options do |response, operation|
942
962
  response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_configs, request, response, operation, options
943
963
  yield response, operation if block_given?
944
- return response
964
+ throw :response, response
945
965
  end
946
966
  rescue ::GRPC::BadStatus => e
947
967
  raise ::Google::Cloud::Error.from_error(e)
@@ -1038,7 +1058,7 @@ module Google
1038
1058
  @workstations_stub.call_rpc :list_usable_workstation_configs, request, options: options do |response, operation|
1039
1059
  response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, request, response, operation, options
1040
1060
  yield response, operation if block_given?
1041
- return response
1061
+ throw :response, response
1042
1062
  end
1043
1063
  rescue ::GRPC::BadStatus => e
1044
1064
  raise ::Google::Cloud::Error.from_error(e)
@@ -1139,7 +1159,7 @@ module Google
1139
1159
  @workstations_stub.call_rpc :create_workstation_config, request, options: options do |response, operation|
1140
1160
  response = ::Gapic::Operation.new response, @operations_client, options: options
1141
1161
  yield response, operation if block_given?
1142
- return response
1162
+ throw :response, response
1143
1163
  end
1144
1164
  rescue ::GRPC::BadStatus => e
1145
1165
  raise ::Google::Cloud::Error.from_error(e)
@@ -1243,7 +1263,7 @@ module Google
1243
1263
  @workstations_stub.call_rpc :update_workstation_config, request, options: options do |response, operation|
1244
1264
  response = ::Gapic::Operation.new response, @operations_client, options: options
1245
1265
  yield response, operation if block_given?
1246
- return response
1266
+ throw :response, response
1247
1267
  end
1248
1268
  rescue ::GRPC::BadStatus => e
1249
1269
  raise ::Google::Cloud::Error.from_error(e)
@@ -1347,7 +1367,7 @@ module Google
1347
1367
  @workstations_stub.call_rpc :delete_workstation_config, request, options: options do |response, operation|
1348
1368
  response = ::Gapic::Operation.new response, @operations_client, options: options
1349
1369
  yield response, operation if block_given?
1350
- return response
1370
+ throw :response, response
1351
1371
  end
1352
1372
  rescue ::GRPC::BadStatus => e
1353
1373
  raise ::Google::Cloud::Error.from_error(e)
@@ -1433,7 +1453,6 @@ module Google
1433
1453
 
1434
1454
  @workstations_stub.call_rpc :get_workstation, request, options: options do |response, operation|
1435
1455
  yield response, operation if block_given?
1436
- return response
1437
1456
  end
1438
1457
  rescue ::GRPC::BadStatus => e
1439
1458
  raise ::Google::Cloud::Error.from_error(e)
@@ -1529,7 +1548,7 @@ module Google
1529
1548
  @workstations_stub.call_rpc :list_workstations, request, options: options do |response, operation|
1530
1549
  response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstations, request, response, operation, options
1531
1550
  yield response, operation if block_given?
1532
- return response
1551
+ throw :response, response
1533
1552
  end
1534
1553
  rescue ::GRPC::BadStatus => e
1535
1554
  raise ::Google::Cloud::Error.from_error(e)
@@ -1626,7 +1645,7 @@ module Google
1626
1645
  @workstations_stub.call_rpc :list_usable_workstations, request, options: options do |response, operation|
1627
1646
  response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstations, request, response, operation, options
1628
1647
  yield response, operation if block_given?
1629
- return response
1648
+ throw :response, response
1630
1649
  end
1631
1650
  rescue ::GRPC::BadStatus => e
1632
1651
  raise ::Google::Cloud::Error.from_error(e)
@@ -1727,7 +1746,7 @@ module Google
1727
1746
  @workstations_stub.call_rpc :create_workstation, request, options: options do |response, operation|
1728
1747
  response = ::Gapic::Operation.new response, @operations_client, options: options
1729
1748
  yield response, operation if block_given?
1730
- return response
1749
+ throw :response, response
1731
1750
  end
1732
1751
  rescue ::GRPC::BadStatus => e
1733
1752
  raise ::Google::Cloud::Error.from_error(e)
@@ -1831,7 +1850,7 @@ module Google
1831
1850
  @workstations_stub.call_rpc :update_workstation, request, options: options do |response, operation|
1832
1851
  response = ::Gapic::Operation.new response, @operations_client, options: options
1833
1852
  yield response, operation if block_given?
1834
- return response
1853
+ throw :response, response
1835
1854
  end
1836
1855
  rescue ::GRPC::BadStatus => e
1837
1856
  raise ::Google::Cloud::Error.from_error(e)
@@ -1931,7 +1950,7 @@ module Google
1931
1950
  @workstations_stub.call_rpc :delete_workstation, request, options: options do |response, operation|
1932
1951
  response = ::Gapic::Operation.new response, @operations_client, options: options
1933
1952
  yield response, operation if block_given?
1934
- return response
1953
+ throw :response, response
1935
1954
  end
1936
1955
  rescue ::GRPC::BadStatus => e
1937
1956
  raise ::Google::Cloud::Error.from_error(e)
@@ -2031,7 +2050,7 @@ module Google
2031
2050
  @workstations_stub.call_rpc :start_workstation, request, options: options do |response, operation|
2032
2051
  response = ::Gapic::Operation.new response, @operations_client, options: options
2033
2052
  yield response, operation if block_given?
2034
- return response
2053
+ throw :response, response
2035
2054
  end
2036
2055
  rescue ::GRPC::BadStatus => e
2037
2056
  raise ::Google::Cloud::Error.from_error(e)
@@ -2131,7 +2150,7 @@ module Google
2131
2150
  @workstations_stub.call_rpc :stop_workstation, request, options: options do |response, operation|
2132
2151
  response = ::Gapic::Operation.new response, @operations_client, options: options
2133
2152
  yield response, operation if block_given?
2134
- return response
2153
+ throw :response, response
2135
2154
  end
2136
2155
  rescue ::GRPC::BadStatus => e
2137
2156
  raise ::Google::Cloud::Error.from_error(e)
@@ -2228,7 +2247,6 @@ module Google
2228
2247
 
2229
2248
  @workstations_stub.call_rpc :generate_access_token, request, options: options do |response, operation|
2230
2249
  yield response, operation if block_given?
2231
- return response
2232
2250
  end
2233
2251
  rescue ::GRPC::BadStatus => e
2234
2252
  raise ::Google::Cloud::Error.from_error(e)
@@ -2317,6 +2335,11 @@ module Google
2317
2335
  # default endpoint URL. The default value of nil uses the environment
2318
2336
  # universe (usually the default "googleapis.com" universe).
2319
2337
  # @return [::String,nil]
2338
+ # @!attribute [rw] logger
2339
+ # A custom logger to use for request/response debug logging, or the value
2340
+ # `:default` (the default) to construct a default logger, or `nil` to
2341
+ # explicitly disable logging.
2342
+ # @return [::Logger,:default,nil]
2320
2343
  #
2321
2344
  class Configuration
2322
2345
  extend ::Gapic::Config
@@ -2341,6 +2364,7 @@ module Google
2341
2364
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2342
2365
  config_attr :quota_project, nil, ::String, nil
2343
2366
  config_attr :universe_domain, nil, ::String, nil
2367
+ config_attr :logger, :default, ::Logger, nil, :default
2344
2368
 
2345
2369
  # @private
2346
2370
  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
@@ -226,14 +226,26 @@ module Google
226
226
  endpoint: @config.endpoint,
227
227
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
228
228
  universe_domain: @config.universe_domain,
229
- credentials: credentials
229
+ credentials: credentials,
230
+ logger: @config.logger
230
231
  )
231
232
 
233
+ @workstations_stub.logger(stub: true)&.info do |entry|
234
+ entry.set_system_name
235
+ entry.set_service
236
+ entry.message = "Created client for #{entry.service}"
237
+ entry.set_credentials_fields credentials
238
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
239
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
240
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
241
+ end
242
+
232
243
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
233
244
  config.credentials = credentials
234
245
  config.quota_project = @quota_project_id
235
246
  config.endpoint = @workstations_stub.endpoint
236
247
  config.universe_domain = @workstations_stub.universe_domain
248
+ config.logger = @workstations_stub.logger if config.respond_to? :logger=
237
249
  end
238
250
 
239
251
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -242,6 +254,7 @@ module Google
242
254
  config.endpoint = @workstations_stub.endpoint
243
255
  config.universe_domain = @workstations_stub.universe_domain
244
256
  config.bindings_override = @config.bindings_override
257
+ config.logger = @workstations_stub.logger if config.respond_to? :logger=
245
258
  end
246
259
  end
247
260
 
@@ -266,6 +279,15 @@ module Google
266
279
  #
267
280
  attr_reader :iam_policy_client
268
281
 
282
+ ##
283
+ # The logger used for request/response debug logging.
284
+ #
285
+ # @return [Logger]
286
+ #
287
+ def logger
288
+ @workstations_stub.logger
289
+ end
290
+
269
291
  # Service calls
270
292
 
271
293
  ##
@@ -341,7 +363,6 @@ module Google
341
363
 
342
364
  @workstations_stub.get_workstation_cluster request, options do |result, operation|
343
365
  yield result, operation if block_given?
344
- return result
345
366
  end
346
367
  rescue ::Gapic::Rest::Error => e
347
368
  raise ::Google::Cloud::Error.from_error(e)
@@ -429,7 +450,6 @@ module Google
429
450
 
430
451
  @workstations_stub.list_workstation_clusters request, options do |result, operation|
431
452
  yield result, operation if block_given?
432
- return result
433
453
  end
434
454
  rescue ::Gapic::Rest::Error => e
435
455
  raise ::Google::Cloud::Error.from_error(e)
@@ -523,7 +543,7 @@ module Google
523
543
  @workstations_stub.create_workstation_cluster request, options do |result, operation|
524
544
  result = ::Gapic::Operation.new result, @operations_client, options: options
525
545
  yield result, operation if block_given?
526
- return result
546
+ throw :response, result
527
547
  end
528
548
  rescue ::Gapic::Rest::Error => e
529
549
  raise ::Google::Cloud::Error.from_error(e)
@@ -620,7 +640,7 @@ module Google
620
640
  @workstations_stub.update_workstation_cluster request, options do |result, operation|
621
641
  result = ::Gapic::Operation.new result, @operations_client, options: options
622
642
  yield result, operation if block_given?
623
- return result
643
+ throw :response, result
624
644
  end
625
645
  rescue ::Gapic::Rest::Error => e
626
646
  raise ::Google::Cloud::Error.from_error(e)
@@ -717,7 +737,7 @@ module Google
717
737
  @workstations_stub.delete_workstation_cluster request, options do |result, operation|
718
738
  result = ::Gapic::Operation.new result, @operations_client, options: options
719
739
  yield result, operation if block_given?
720
- return result
740
+ throw :response, result
721
741
  end
722
742
  rescue ::Gapic::Rest::Error => e
723
743
  raise ::Google::Cloud::Error.from_error(e)
@@ -796,7 +816,6 @@ module Google
796
816
 
797
817
  @workstations_stub.get_workstation_config request, options do |result, operation|
798
818
  yield result, operation if block_given?
799
- return result
800
819
  end
801
820
  rescue ::Gapic::Rest::Error => e
802
821
  raise ::Google::Cloud::Error.from_error(e)
@@ -884,7 +903,6 @@ module Google
884
903
 
885
904
  @workstations_stub.list_workstation_configs request, options do |result, operation|
886
905
  yield result, operation if block_given?
887
- return result
888
906
  end
889
907
  rescue ::Gapic::Rest::Error => e
890
908
  raise ::Google::Cloud::Error.from_error(e)
@@ -973,7 +991,6 @@ module Google
973
991
 
974
992
  @workstations_stub.list_usable_workstation_configs request, options do |result, operation|
975
993
  yield result, operation if block_given?
976
- return result
977
994
  end
978
995
  rescue ::Gapic::Rest::Error => e
979
996
  raise ::Google::Cloud::Error.from_error(e)
@@ -1067,7 +1084,7 @@ module Google
1067
1084
  @workstations_stub.create_workstation_config request, options do |result, operation|
1068
1085
  result = ::Gapic::Operation.new result, @operations_client, options: options
1069
1086
  yield result, operation if block_given?
1070
- return result
1087
+ throw :response, result
1071
1088
  end
1072
1089
  rescue ::Gapic::Rest::Error => e
1073
1090
  raise ::Google::Cloud::Error.from_error(e)
@@ -1164,7 +1181,7 @@ module Google
1164
1181
  @workstations_stub.update_workstation_config request, options do |result, operation|
1165
1182
  result = ::Gapic::Operation.new result, @operations_client, options: options
1166
1183
  yield result, operation if block_given?
1167
- return result
1184
+ throw :response, result
1168
1185
  end
1169
1186
  rescue ::Gapic::Rest::Error => e
1170
1187
  raise ::Google::Cloud::Error.from_error(e)
@@ -1261,7 +1278,7 @@ module Google
1261
1278
  @workstations_stub.delete_workstation_config request, options do |result, operation|
1262
1279
  result = ::Gapic::Operation.new result, @operations_client, options: options
1263
1280
  yield result, operation if block_given?
1264
- return result
1281
+ throw :response, result
1265
1282
  end
1266
1283
  rescue ::Gapic::Rest::Error => e
1267
1284
  raise ::Google::Cloud::Error.from_error(e)
@@ -1340,7 +1357,6 @@ module Google
1340
1357
 
1341
1358
  @workstations_stub.get_workstation request, options do |result, operation|
1342
1359
  yield result, operation if block_given?
1343
- return result
1344
1360
  end
1345
1361
  rescue ::Gapic::Rest::Error => e
1346
1362
  raise ::Google::Cloud::Error.from_error(e)
@@ -1428,7 +1444,6 @@ module Google
1428
1444
 
1429
1445
  @workstations_stub.list_workstations request, options do |result, operation|
1430
1446
  yield result, operation if block_given?
1431
- return result
1432
1447
  end
1433
1448
  rescue ::Gapic::Rest::Error => e
1434
1449
  raise ::Google::Cloud::Error.from_error(e)
@@ -1517,7 +1532,6 @@ module Google
1517
1532
 
1518
1533
  @workstations_stub.list_usable_workstations request, options do |result, operation|
1519
1534
  yield result, operation if block_given?
1520
- return result
1521
1535
  end
1522
1536
  rescue ::Gapic::Rest::Error => e
1523
1537
  raise ::Google::Cloud::Error.from_error(e)
@@ -1611,7 +1625,7 @@ module Google
1611
1625
  @workstations_stub.create_workstation request, options do |result, operation|
1612
1626
  result = ::Gapic::Operation.new result, @operations_client, options: options
1613
1627
  yield result, operation if block_given?
1614
- return result
1628
+ throw :response, result
1615
1629
  end
1616
1630
  rescue ::Gapic::Rest::Error => e
1617
1631
  raise ::Google::Cloud::Error.from_error(e)
@@ -1708,7 +1722,7 @@ module Google
1708
1722
  @workstations_stub.update_workstation request, options do |result, operation|
1709
1723
  result = ::Gapic::Operation.new result, @operations_client, options: options
1710
1724
  yield result, operation if block_given?
1711
- return result
1725
+ throw :response, result
1712
1726
  end
1713
1727
  rescue ::Gapic::Rest::Error => e
1714
1728
  raise ::Google::Cloud::Error.from_error(e)
@@ -1801,7 +1815,7 @@ module Google
1801
1815
  @workstations_stub.delete_workstation request, options do |result, operation|
1802
1816
  result = ::Gapic::Operation.new result, @operations_client, options: options
1803
1817
  yield result, operation if block_given?
1804
- return result
1818
+ throw :response, result
1805
1819
  end
1806
1820
  rescue ::Gapic::Rest::Error => e
1807
1821
  raise ::Google::Cloud::Error.from_error(e)
@@ -1894,7 +1908,7 @@ module Google
1894
1908
  @workstations_stub.start_workstation request, options do |result, operation|
1895
1909
  result = ::Gapic::Operation.new result, @operations_client, options: options
1896
1910
  yield result, operation if block_given?
1897
- return result
1911
+ throw :response, result
1898
1912
  end
1899
1913
  rescue ::Gapic::Rest::Error => e
1900
1914
  raise ::Google::Cloud::Error.from_error(e)
@@ -1987,7 +2001,7 @@ module Google
1987
2001
  @workstations_stub.stop_workstation request, options do |result, operation|
1988
2002
  result = ::Gapic::Operation.new result, @operations_client, options: options
1989
2003
  yield result, operation if block_given?
1990
- return result
2004
+ throw :response, result
1991
2005
  end
1992
2006
  rescue ::Gapic::Rest::Error => e
1993
2007
  raise ::Google::Cloud::Error.from_error(e)
@@ -2077,7 +2091,6 @@ module Google
2077
2091
 
2078
2092
  @workstations_stub.generate_access_token request, options do |result, operation|
2079
2093
  yield result, operation if block_given?
2080
- return result
2081
2094
  end
2082
2095
  rescue ::Gapic::Rest::Error => e
2083
2096
  raise ::Google::Cloud::Error.from_error(e)
@@ -2157,6 +2170,11 @@ module Google
2157
2170
  # default endpoint URL. The default value of nil uses the environment
2158
2171
  # universe (usually the default "googleapis.com" universe).
2159
2172
  # @return [::String,nil]
2173
+ # @!attribute [rw] logger
2174
+ # A custom logger to use for request/response debug logging, or the value
2175
+ # `:default` (the default) to construct a default logger, or `nil` to
2176
+ # explicitly disable logging.
2177
+ # @return [::Logger,:default,nil]
2160
2178
  #
2161
2179
  class Configuration
2162
2180
  extend ::Gapic::Config
@@ -2185,6 +2203,7 @@ module Google
2185
2203
  # by the host service.
2186
2204
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2187
2205
  config_attr :bindings_override, {}, ::Hash, nil
2206
+ config_attr :logger, :default, ::Logger, nil, :default
2188
2207
 
2189
2208
  # @private
2190
2209
  def initialize parent_config = nil