google-cloud-spanner-admin-instance-v1 1.3.0 → 1.4.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: 9c12a23a53590ba4b88196b0e358b59623c2f9d7c00290540ddaf9e26ed94c43
4
- data.tar.gz: dade9c8f576e31c8f36d4bfc55f7b55cbd781dda356c8d7496235a49fc0a7333
3
+ metadata.gz: 96acd673d20b00e3741ae06619e7862339482f0f2f6383b93f948d0f48c89a2a
4
+ data.tar.gz: b526506524a3bdc43048e377124924394737a48b2b775718a76f8f95e34e90c3
5
5
  SHA512:
6
- metadata.gz: b43d70df84753c1db2cb98eccbb9e6a99080a9509d772c3fe84e65443c26df24fccec3b34e79b1cea42fe8cedd791550050574f42f00acefc0399bd84e6118a0
7
- data.tar.gz: 640a6733f2c82e84bb49fb9f62ccc79b079c944f5377ba105164d717b80384aaa3379548f6b017fce29f77cea36e80dd53ec6a46776a9167061d238af18137a4
6
+ metadata.gz: 6c38818d6839ead43f5fed31b7d8ef62caaf86f2d46c552ad1c4f27992a3b81a9ee6f3c8bdbab919a8ed0e44c1a46a9fc8dd66710109d987c2e018dfdc1c7b1f
7
+ data.tar.gz: 83c7ade0d395b7ce8d431aa5d230ee185662dea2af2314d901cdc6b292e891d2f0e4493b216772ef44ce68f31646d17d85f0f79d8fded71368cbb171c4132e34
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/spanner)
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/spanner/admin/instance/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::Spanner::Admin::Instance::V1::InstanceAdmin::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).
@@ -224,8 +224,19 @@ module Google
224
224
  universe_domain: @config.universe_domain,
225
225
  channel_args: @config.channel_args,
226
226
  interceptors: @config.interceptors,
227
- channel_pool_config: @config.channel_pool
227
+ channel_pool_config: @config.channel_pool,
228
+ logger: @config.logger
228
229
  )
230
+
231
+ @instance_admin_stub.stub_logger&.info do |entry|
232
+ entry.set_system_name
233
+ entry.set_service
234
+ entry.message = "Created client for #{entry.service}"
235
+ entry.set_credentials_fields credentials
236
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
237
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
238
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
239
+ end
229
240
  end
230
241
 
231
242
  ##
@@ -235,6 +246,15 @@ module Google
235
246
  #
236
247
  attr_reader :operations_client
237
248
 
249
+ ##
250
+ # The logger used for request/response debug logging.
251
+ #
252
+ # @return [Logger]
253
+ #
254
+ def logger
255
+ @instance_admin_stub.logger
256
+ end
257
+
238
258
  # Service calls
239
259
 
240
260
  ##
@@ -332,7 +352,7 @@ module Google
332
352
  @instance_admin_stub.call_rpc :list_instance_configs, request, options: options do |response, operation|
333
353
  response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, request, response, operation, options
334
354
  yield response, operation if block_given?
335
- return response
355
+ throw :response, response
336
356
  end
337
357
  rescue ::GRPC::BadStatus => e
338
358
  raise ::Google::Cloud::Error.from_error(e)
@@ -419,7 +439,6 @@ module Google
419
439
 
420
440
  @instance_admin_stub.call_rpc :get_instance_config, request, options: options do |response, operation|
421
441
  yield response, operation if block_given?
422
- return response
423
442
  end
424
443
  rescue ::GRPC::BadStatus => e
425
444
  raise ::Google::Cloud::Error.from_error(e)
@@ -568,7 +587,7 @@ module Google
568
587
  @instance_admin_stub.call_rpc :create_instance_config, request, options: options do |response, operation|
569
588
  response = ::Gapic::Operation.new response, @operations_client, options: options
570
589
  yield response, operation if block_given?
571
- return response
590
+ throw :response, response
572
591
  end
573
592
  rescue ::GRPC::BadStatus => e
574
593
  raise ::Google::Cloud::Error.from_error(e)
@@ -721,7 +740,7 @@ module Google
721
740
  @instance_admin_stub.call_rpc :update_instance_config, request, options: options do |response, operation|
722
741
  response = ::Gapic::Operation.new response, @operations_client, options: options
723
742
  yield response, operation if block_given?
724
- return response
743
+ throw :response, response
725
744
  end
726
745
  rescue ::GRPC::BadStatus => e
727
746
  raise ::Google::Cloud::Error.from_error(e)
@@ -827,7 +846,6 @@ module Google
827
846
 
828
847
  @instance_admin_stub.call_rpc :delete_instance_config, request, options: options do |response, operation|
829
848
  yield response, operation if block_given?
830
- return response
831
849
  end
832
850
  rescue ::GRPC::BadStatus => e
833
851
  raise ::Google::Cloud::Error.from_error(e)
@@ -983,7 +1001,7 @@ module Google
983
1001
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
984
1002
  response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, request, response, operation, options, format_resource: wrap_lro_operation
985
1003
  yield response, operation if block_given?
986
- return response
1004
+ throw :response, response
987
1005
  end
988
1006
  rescue ::GRPC::BadStatus => e
989
1007
  raise ::Google::Cloud::Error.from_error(e)
@@ -1110,7 +1128,7 @@ module Google
1110
1128
  @instance_admin_stub.call_rpc :list_instances, request, options: options do |response, operation|
1111
1129
  response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instances, request, response, operation, options
1112
1130
  yield response, operation if block_given?
1113
- return response
1131
+ throw :response, response
1114
1132
  end
1115
1133
  rescue ::GRPC::BadStatus => e
1116
1134
  raise ::Google::Cloud::Error.from_error(e)
@@ -1217,7 +1235,7 @@ module Google
1217
1235
  @instance_admin_stub.call_rpc :list_instance_partitions, request, options: options do |response, operation|
1218
1236
  response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, request, response, operation, options
1219
1237
  yield response, operation if block_given?
1220
- return response
1238
+ throw :response, response
1221
1239
  end
1222
1240
  rescue ::GRPC::BadStatus => e
1223
1241
  raise ::Google::Cloud::Error.from_error(e)
@@ -1309,7 +1327,6 @@ module Google
1309
1327
 
1310
1328
  @instance_admin_stub.call_rpc :get_instance, request, options: options do |response, operation|
1311
1329
  yield response, operation if block_given?
1312
- return response
1313
1330
  end
1314
1331
  rescue ::GRPC::BadStatus => e
1315
1332
  raise ::Google::Cloud::Error.from_error(e)
@@ -1444,7 +1461,7 @@ module Google
1444
1461
  @instance_admin_stub.call_rpc :create_instance, request, options: options do |response, operation|
1445
1462
  response = ::Gapic::Operation.new response, @operations_client, options: options
1446
1463
  yield response, operation if block_given?
1447
- return response
1464
+ throw :response, response
1448
1465
  end
1449
1466
  rescue ::GRPC::BadStatus => e
1450
1467
  raise ::Google::Cloud::Error.from_error(e)
@@ -1586,7 +1603,7 @@ module Google
1586
1603
  @instance_admin_stub.call_rpc :update_instance, request, options: options do |response, operation|
1587
1604
  response = ::Gapic::Operation.new response, @operations_client, options: options
1588
1605
  yield response, operation if block_given?
1589
- return response
1606
+ throw :response, response
1590
1607
  end
1591
1608
  rescue ::GRPC::BadStatus => e
1592
1609
  raise ::Google::Cloud::Error.from_error(e)
@@ -1683,7 +1700,6 @@ module Google
1683
1700
 
1684
1701
  @instance_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation|
1685
1702
  yield response, operation if block_given?
1686
- return response
1687
1703
  end
1688
1704
  rescue ::GRPC::BadStatus => e
1689
1705
  raise ::Google::Cloud::Error.from_error(e)
@@ -1785,7 +1801,6 @@ module Google
1785
1801
 
1786
1802
  @instance_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1787
1803
  yield response, operation if block_given?
1788
- return response
1789
1804
  end
1790
1805
  rescue ::GRPC::BadStatus => e
1791
1806
  raise ::Google::Cloud::Error.from_error(e)
@@ -1879,7 +1894,6 @@ module Google
1879
1894
 
1880
1895
  @instance_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1881
1896
  yield response, operation if block_given?
1882
- return response
1883
1897
  end
1884
1898
  rescue ::GRPC::BadStatus => e
1885
1899
  raise ::Google::Cloud::Error.from_error(e)
@@ -1976,7 +1990,6 @@ module Google
1976
1990
 
1977
1991
  @instance_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1978
1992
  yield response, operation if block_given?
1979
- return response
1980
1993
  end
1981
1994
  rescue ::GRPC::BadStatus => e
1982
1995
  raise ::Google::Cloud::Error.from_error(e)
@@ -2064,7 +2077,6 @@ module Google
2064
2077
 
2065
2078
  @instance_admin_stub.call_rpc :get_instance_partition, request, options: options do |response, operation|
2066
2079
  yield response, operation if block_given?
2067
- return response
2068
2080
  end
2069
2081
  rescue ::GRPC::BadStatus => e
2070
2082
  raise ::Google::Cloud::Error.from_error(e)
@@ -2204,7 +2216,7 @@ module Google
2204
2216
  @instance_admin_stub.call_rpc :create_instance_partition, request, options: options do |response, operation|
2205
2217
  response = ::Gapic::Operation.new response, @operations_client, options: options
2206
2218
  yield response, operation if block_given?
2207
- return response
2219
+ throw :response, response
2208
2220
  end
2209
2221
  rescue ::GRPC::BadStatus => e
2210
2222
  raise ::Google::Cloud::Error.from_error(e)
@@ -2303,7 +2315,6 @@ module Google
2303
2315
 
2304
2316
  @instance_admin_stub.call_rpc :delete_instance_partition, request, options: options do |response, operation|
2305
2317
  yield response, operation if block_given?
2306
- return response
2307
2318
  end
2308
2319
  rescue ::GRPC::BadStatus => e
2309
2320
  raise ::Google::Cloud::Error.from_error(e)
@@ -2450,7 +2461,7 @@ module Google
2450
2461
  @instance_admin_stub.call_rpc :update_instance_partition, request, options: options do |response, operation|
2451
2462
  response = ::Gapic::Operation.new response, @operations_client, options: options
2452
2463
  yield response, operation if block_given?
2453
- return response
2464
+ throw :response, response
2454
2465
  end
2455
2466
  rescue ::GRPC::BadStatus => e
2456
2467
  raise ::Google::Cloud::Error.from_error(e)
@@ -2616,7 +2627,7 @@ module Google
2616
2627
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
2617
2628
  response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_operations, request, response, operation, options, format_resource: wrap_lro_operation
2618
2629
  yield response, operation if block_given?
2619
- return response
2630
+ throw :response, response
2620
2631
  end
2621
2632
  rescue ::GRPC::BadStatus => e
2622
2633
  raise ::Google::Cloud::Error.from_error(e)
@@ -2774,7 +2785,7 @@ module Google
2774
2785
  @instance_admin_stub.call_rpc :move_instance, request, options: options do |response, operation|
2775
2786
  response = ::Gapic::Operation.new response, @operations_client, options: options
2776
2787
  yield response, operation if block_given?
2777
- return response
2788
+ throw :response, response
2778
2789
  end
2779
2790
  rescue ::GRPC::BadStatus => e
2780
2791
  raise ::Google::Cloud::Error.from_error(e)
@@ -2863,6 +2874,11 @@ module Google
2863
2874
  # default endpoint URL. The default value of nil uses the environment
2864
2875
  # universe (usually the default "googleapis.com" universe).
2865
2876
  # @return [::String,nil]
2877
+ # @!attribute [rw] logger
2878
+ # A custom logger to use for request/response debug logging, or the value
2879
+ # `:default` (the default) to construct a default logger, or `nil` to
2880
+ # explicitly disable logging.
2881
+ # @return [::Logger,:default,nil]
2866
2882
  #
2867
2883
  class Configuration
2868
2884
  extend ::Gapic::Config
@@ -2887,6 +2903,7 @@ module Google
2887
2903
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2888
2904
  config_attr :quota_project, nil, ::String, nil
2889
2905
  config_attr :universe_domain, nil, ::String, nil
2906
+ config_attr :logger, :default, ::Logger, nil, :default
2890
2907
 
2891
2908
  # @private
2892
2909
  def initialize parent_config = nil
@@ -126,14 +126,6 @@ module Google
126
126
  # Lists operations that match the specified filter in the request. If the
127
127
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
128
128
  #
129
- # NOTE: the `name` binding allows API services to override the binding
130
- # to use different resource name schemes, such as `users/*/operations`. To
131
- # override the binding, API services can add a binding such as
132
- # `"/v1/{name=users/*}/operations"` to their service configuration.
133
- # For backwards compatibility, the default name includes the operations
134
- # collection id, however overriding users must ensure the name binding
135
- # is the parent resource, without the operations collection id.
136
- #
137
129
  # @overload list_operations(request, options = nil)
138
130
  # Pass arguments to `list_operations` via a request object, either of type
139
131
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -223,7 +215,7 @@ module Google
223
215
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
224
216
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
225
217
  yield response, operation if block_given?
226
- return response
218
+ throw :response, response
227
219
  end
228
220
  rescue ::GRPC::BadStatus => e
229
221
  raise ::Google::Cloud::Error.from_error(e)
@@ -319,7 +311,7 @@ module Google
319
311
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
320
312
  response = ::Gapic::Operation.new response, @operations_client, options: options
321
313
  yield response, operation if block_given?
322
- return response
314
+ throw :response, response
323
315
  end
324
316
  rescue ::GRPC::BadStatus => e
325
317
  raise ::Google::Cloud::Error.from_error(e)
@@ -408,7 +400,6 @@ module Google
408
400
 
409
401
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
410
402
  yield response, operation if block_given?
411
- return response
412
403
  end
413
404
  rescue ::GRPC::BadStatus => e
414
405
  raise ::Google::Cloud::Error.from_error(e)
@@ -423,8 +414,9 @@ module Google
423
414
  # other methods to check whether the cancellation succeeded or whether the
424
415
  # operation completed despite cancellation. On successful cancellation,
425
416
  # the operation is not deleted; instead, it becomes an operation with
426
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
427
- # corresponding to `Code.CANCELLED`.
417
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
418
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
419
+ # `Code.CANCELLED`.
428
420
  #
429
421
  # @overload cancel_operation(request, options = nil)
430
422
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -503,7 +495,6 @@ module Google
503
495
 
504
496
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
505
497
  yield response, operation if block_given?
506
- return response
507
498
  end
508
499
  rescue ::GRPC::BadStatus => e
509
500
  raise ::Google::Cloud::Error.from_error(e)
@@ -601,7 +592,7 @@ module Google
601
592
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
602
593
  response = ::Gapic::Operation.new response, @operations_client, options: options
603
594
  yield response, operation if block_given?
604
- return response
595
+ throw :response, response
605
596
  end
606
597
  rescue ::GRPC::BadStatus => e
607
598
  raise ::Google::Cloud::Error.from_error(e)
@@ -690,6 +681,11 @@ module Google
690
681
  # default endpoint URL. The default value of nil uses the environment
691
682
  # universe (usually the default "googleapis.com" universe).
692
683
  # @return [::String,nil]
684
+ # @!attribute [rw] logger
685
+ # A custom logger to use for request/response debug logging, or the value
686
+ # `:default` (the default) to construct a default logger, or `nil` to
687
+ # explicitly disable logging.
688
+ # @return [::Logger,:default,nil]
693
689
  #
694
690
  class Configuration
695
691
  extend ::Gapic::Config
@@ -714,6 +710,7 @@ module Google
714
710
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
715
711
  config_attr :quota_project, nil, ::String, nil
716
712
  config_attr :universe_domain, nil, ::String, nil
713
+ config_attr :logger, :default, ::Logger, nil, :default
717
714
 
718
715
  # @private
719
716
  def initialize parent_config = nil
@@ -217,8 +217,19 @@ module Google
217
217
  endpoint: @config.endpoint,
218
218
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
219
219
  universe_domain: @config.universe_domain,
220
- credentials: credentials
220
+ credentials: credentials,
221
+ logger: @config.logger
221
222
  )
223
+
224
+ @instance_admin_stub.logger(stub: true)&.info do |entry|
225
+ entry.set_system_name
226
+ entry.set_service
227
+ entry.message = "Created client for #{entry.service}"
228
+ entry.set_credentials_fields credentials
229
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
230
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
231
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
232
+ end
222
233
  end
223
234
 
224
235
  ##
@@ -228,6 +239,15 @@ module Google
228
239
  #
229
240
  attr_reader :operations_client
230
241
 
242
+ ##
243
+ # The logger used for request/response debug logging.
244
+ #
245
+ # @return [Logger]
246
+ #
247
+ def logger
248
+ @instance_admin_stub.logger
249
+ end
250
+
231
251
  # Service calls
232
252
 
233
253
  ##
@@ -318,7 +338,7 @@ module Google
318
338
  @instance_admin_stub.list_instance_configs request, options do |result, operation|
319
339
  result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, "instance_configs", request, result, options
320
340
  yield result, operation if block_given?
321
- return result
341
+ throw :response, result
322
342
  end
323
343
  rescue ::Gapic::Rest::Error => e
324
344
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +418,6 @@ module Google
398
418
 
399
419
  @instance_admin_stub.get_instance_config request, options do |result, operation|
400
420
  yield result, operation if block_given?
401
- return result
402
421
  end
403
422
  rescue ::Gapic::Rest::Error => e
404
423
  raise ::Google::Cloud::Error.from_error(e)
@@ -540,7 +559,7 @@ module Google
540
559
  @instance_admin_stub.create_instance_config request, options do |result, operation|
541
560
  result = ::Gapic::Operation.new result, @operations_client, options: options
542
561
  yield result, operation if block_given?
543
- return result
562
+ throw :response, result
544
563
  end
545
564
  rescue ::Gapic::Rest::Error => e
546
565
  raise ::Google::Cloud::Error.from_error(e)
@@ -686,7 +705,7 @@ module Google
686
705
  @instance_admin_stub.update_instance_config request, options do |result, operation|
687
706
  result = ::Gapic::Operation.new result, @operations_client, options: options
688
707
  yield result, operation if block_given?
689
- return result
708
+ throw :response, result
690
709
  end
691
710
  rescue ::Gapic::Rest::Error => e
692
711
  raise ::Google::Cloud::Error.from_error(e)
@@ -785,7 +804,6 @@ module Google
785
804
 
786
805
  @instance_admin_stub.delete_instance_config request, options do |result, operation|
787
806
  yield result, operation if block_given?
788
- return result
789
807
  end
790
808
  rescue ::Gapic::Rest::Error => e
791
809
  raise ::Google::Cloud::Error.from_error(e)
@@ -933,7 +951,7 @@ module Google
933
951
  @instance_admin_stub.list_instance_config_operations request, options do |result, operation|
934
952
  result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, "operations", request, result, options
935
953
  yield result, operation if block_given?
936
- return result
954
+ throw :response, result
937
955
  end
938
956
  rescue ::Gapic::Rest::Error => e
939
957
  raise ::Google::Cloud::Error.from_error(e)
@@ -1052,7 +1070,6 @@ module Google
1052
1070
 
1053
1071
  @instance_admin_stub.list_instances request, options do |result, operation|
1054
1072
  yield result, operation if block_given?
1055
- return result
1056
1073
  end
1057
1074
  rescue ::Gapic::Rest::Error => e
1058
1075
  raise ::Google::Cloud::Error.from_error(e)
@@ -1151,7 +1168,6 @@ module Google
1151
1168
 
1152
1169
  @instance_admin_stub.list_instance_partitions request, options do |result, operation|
1153
1170
  yield result, operation if block_given?
1154
- return result
1155
1171
  end
1156
1172
  rescue ::Gapic::Rest::Error => e
1157
1173
  raise ::Google::Cloud::Error.from_error(e)
@@ -1236,7 +1252,6 @@ module Google
1236
1252
 
1237
1253
  @instance_admin_stub.get_instance request, options do |result, operation|
1238
1254
  yield result, operation if block_given?
1239
- return result
1240
1255
  end
1241
1256
  rescue ::Gapic::Rest::Error => e
1242
1257
  raise ::Google::Cloud::Error.from_error(e)
@@ -1364,7 +1379,7 @@ module Google
1364
1379
  @instance_admin_stub.create_instance request, options do |result, operation|
1365
1380
  result = ::Gapic::Operation.new result, @operations_client, options: options
1366
1381
  yield result, operation if block_given?
1367
- return result
1382
+ throw :response, result
1368
1383
  end
1369
1384
  rescue ::Gapic::Rest::Error => e
1370
1385
  raise ::Google::Cloud::Error.from_error(e)
@@ -1499,7 +1514,7 @@ module Google
1499
1514
  @instance_admin_stub.update_instance request, options do |result, operation|
1500
1515
  result = ::Gapic::Operation.new result, @operations_client, options: options
1501
1516
  yield result, operation if block_given?
1502
- return result
1517
+ throw :response, result
1503
1518
  end
1504
1519
  rescue ::Gapic::Rest::Error => e
1505
1520
  raise ::Google::Cloud::Error.from_error(e)
@@ -1589,7 +1604,6 @@ module Google
1589
1604
 
1590
1605
  @instance_admin_stub.delete_instance request, options do |result, operation|
1591
1606
  yield result, operation if block_given?
1592
- return result
1593
1607
  end
1594
1608
  rescue ::Gapic::Rest::Error => e
1595
1609
  raise ::Google::Cloud::Error.from_error(e)
@@ -1684,7 +1698,6 @@ module Google
1684
1698
 
1685
1699
  @instance_admin_stub.set_iam_policy request, options do |result, operation|
1686
1700
  yield result, operation if block_given?
1687
- return result
1688
1701
  end
1689
1702
  rescue ::Gapic::Rest::Error => e
1690
1703
  raise ::Google::Cloud::Error.from_error(e)
@@ -1771,7 +1784,6 @@ module Google
1771
1784
 
1772
1785
  @instance_admin_stub.get_iam_policy request, options do |result, operation|
1773
1786
  yield result, operation if block_given?
1774
- return result
1775
1787
  end
1776
1788
  rescue ::Gapic::Rest::Error => e
1777
1789
  raise ::Google::Cloud::Error.from_error(e)
@@ -1861,7 +1873,6 @@ module Google
1861
1873
 
1862
1874
  @instance_admin_stub.test_iam_permissions request, options do |result, operation|
1863
1875
  yield result, operation if block_given?
1864
- return result
1865
1876
  end
1866
1877
  rescue ::Gapic::Rest::Error => e
1867
1878
  raise ::Google::Cloud::Error.from_error(e)
@@ -1942,7 +1953,6 @@ module Google
1942
1953
 
1943
1954
  @instance_admin_stub.get_instance_partition request, options do |result, operation|
1944
1955
  yield result, operation if block_given?
1945
- return result
1946
1956
  end
1947
1957
  rescue ::Gapic::Rest::Error => e
1948
1958
  raise ::Google::Cloud::Error.from_error(e)
@@ -2075,7 +2085,7 @@ module Google
2075
2085
  @instance_admin_stub.create_instance_partition request, options do |result, operation|
2076
2086
  result = ::Gapic::Operation.new result, @operations_client, options: options
2077
2087
  yield result, operation if block_given?
2078
- return result
2088
+ throw :response, result
2079
2089
  end
2080
2090
  rescue ::Gapic::Rest::Error => e
2081
2091
  raise ::Google::Cloud::Error.from_error(e)
@@ -2167,7 +2177,6 @@ module Google
2167
2177
 
2168
2178
  @instance_admin_stub.delete_instance_partition request, options do |result, operation|
2169
2179
  yield result, operation if block_given?
2170
- return result
2171
2180
  end
2172
2181
  rescue ::Gapic::Rest::Error => e
2173
2182
  raise ::Google::Cloud::Error.from_error(e)
@@ -2307,7 +2316,7 @@ module Google
2307
2316
  @instance_admin_stub.update_instance_partition request, options do |result, operation|
2308
2317
  result = ::Gapic::Operation.new result, @operations_client, options: options
2309
2318
  yield result, operation if block_given?
2310
- return result
2319
+ throw :response, result
2311
2320
  end
2312
2321
  rescue ::Gapic::Rest::Error => e
2313
2322
  raise ::Google::Cloud::Error.from_error(e)
@@ -2465,7 +2474,7 @@ module Google
2465
2474
  @instance_admin_stub.list_instance_partition_operations request, options do |result, operation|
2466
2475
  result = ::Gapic::Operation.new result, @operations_client, options: options
2467
2476
  yield result, operation if block_given?
2468
- return result
2477
+ throw :response, result
2469
2478
  end
2470
2479
  rescue ::Gapic::Rest::Error => e
2471
2480
  raise ::Google::Cloud::Error.from_error(e)
@@ -2616,7 +2625,7 @@ module Google
2616
2625
  @instance_admin_stub.move_instance request, options do |result, operation|
2617
2626
  result = ::Gapic::Operation.new result, @operations_client, options: options
2618
2627
  yield result, operation if block_given?
2619
- return result
2628
+ throw :response, result
2620
2629
  end
2621
2630
  rescue ::Gapic::Rest::Error => e
2622
2631
  raise ::Google::Cloud::Error.from_error(e)
@@ -2696,6 +2705,11 @@ module Google
2696
2705
  # default endpoint URL. The default value of nil uses the environment
2697
2706
  # universe (usually the default "googleapis.com" universe).
2698
2707
  # @return [::String,nil]
2708
+ # @!attribute [rw] logger
2709
+ # A custom logger to use for request/response debug logging, or the value
2710
+ # `:default` (the default) to construct a default logger, or `nil` to
2711
+ # explicitly disable logging.
2712
+ # @return [::Logger,:default,nil]
2699
2713
  #
2700
2714
  class Configuration
2701
2715
  extend ::Gapic::Config
@@ -2717,6 +2731,7 @@ module Google
2717
2731
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2718
2732
  config_attr :quota_project, nil, ::String, nil
2719
2733
  config_attr :universe_domain, nil, ::String, nil
2734
+ config_attr :logger, :default, ::Logger, nil, :default
2720
2735
 
2721
2736
  # @private
2722
2737
  def initialize parent_config = nil