google-cloud-metastore-v1 1.0.0 → 1.1.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: 53c62b2e644b1f54fa64efa40e5004b56a76dba4d6e0bca31814a36f42751301
4
- data.tar.gz: 93848f12ac90496dea9d59482f93edbdbaf1e94f06b95d86436de84683a5b57c
3
+ metadata.gz: 5df5238f3aed5f3f0ace22bf4256871194c4ca995c3c57cd51dc8e3293de4e2d
4
+ data.tar.gz: 50da309cb837096548abf7d8f6aceaedb9db47e99cd2a8579aba566da67e75ee
5
5
  SHA512:
6
- metadata.gz: e20d4052261dfc7f91367c6fa422fac3a399f4360c635a5c2e84b120de26916a5c0dc1bea564bc4bc3e6841d0ee1bb9cd2dba2304a47e0554d4bac4889e76be2
7
- data.tar.gz: 735f14d2ed81de507f330ffa3c21c28aded579cac52dd3f05469fc6501d3efd21875124e9b061889c0a5f27cb3327f49d921db8904321f6a2c155cb506fda732
6
+ metadata.gz: 89a52e5de5a586b83c1b04f08a2ebad6d4f58553b4b424f27986867567fc99754747bf95a455979fe1c7bdfad389c4792ce8ab8c8d67cec50eded9ce7977d976
7
+ data.tar.gz: 84154e9d39f5bb71053be218fafb43ad3542eff1ab9c13aca2360115362a41ce78b85538936ce93985f4a0f108024f831faf99b24f48bd4ea9fbce6bfc99955d
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/dataproc-metastore/)
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/metastore/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::Metastore::V1::DataprocMetastore::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).
@@ -205,14 +205,26 @@ module Google
205
205
  universe_domain: @config.universe_domain,
206
206
  channel_args: @config.channel_args,
207
207
  interceptors: @config.interceptors,
208
- channel_pool_config: @config.channel_pool
208
+ channel_pool_config: @config.channel_pool,
209
+ logger: @config.logger
209
210
  )
210
211
 
212
+ @dataproc_metastore_stub.stub_logger&.info do |entry|
213
+ entry.set_system_name
214
+ entry.set_service
215
+ entry.message = "Created client for #{entry.service}"
216
+ entry.set_credentials_fields credentials
217
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
218
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
219
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
220
+ end
221
+
211
222
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
212
223
  config.credentials = credentials
213
224
  config.quota_project = @quota_project_id
214
225
  config.endpoint = @dataproc_metastore_stub.endpoint
215
226
  config.universe_domain = @dataproc_metastore_stub.universe_domain
227
+ config.logger = @dataproc_metastore_stub.logger if config.respond_to? :logger=
216
228
  end
217
229
 
218
230
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -220,6 +232,7 @@ module Google
220
232
  config.quota_project = @quota_project_id
221
233
  config.endpoint = @dataproc_metastore_stub.endpoint
222
234
  config.universe_domain = @dataproc_metastore_stub.universe_domain
235
+ config.logger = @dataproc_metastore_stub.logger if config.respond_to? :logger=
223
236
  end
224
237
  end
225
238
 
@@ -244,6 +257,15 @@ module Google
244
257
  #
245
258
  attr_reader :iam_policy_client
246
259
 
260
+ ##
261
+ # The logger used for request/response debug logging.
262
+ #
263
+ # @return [Logger]
264
+ #
265
+ def logger
266
+ @dataproc_metastore_stub.logger
267
+ end
268
+
247
269
  # Service calls
248
270
 
249
271
  ##
@@ -355,7 +377,7 @@ module Google
355
377
  @dataproc_metastore_stub.call_rpc :list_services, request, options: options do |response, operation|
356
378
  response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_services, request, response, operation, options
357
379
  yield response, operation if block_given?
358
- return response
380
+ throw :response, response
359
381
  end
360
382
  rescue ::GRPC::BadStatus => e
361
383
  raise ::Google::Cloud::Error.from_error(e)
@@ -444,7 +466,6 @@ module Google
444
466
 
445
467
  @dataproc_metastore_stub.call_rpc :get_service, request, options: options do |response, operation|
446
468
  yield response, operation if block_given?
447
- return response
448
469
  end
449
470
  rescue ::GRPC::BadStatus => e
450
471
  raise ::Google::Cloud::Error.from_error(e)
@@ -565,7 +586,7 @@ module Google
565
586
  @dataproc_metastore_stub.call_rpc :create_service, request, options: options do |response, operation|
566
587
  response = ::Gapic::Operation.new response, @operations_client, options: options
567
588
  yield response, operation if block_given?
568
- return response
589
+ throw :response, response
569
590
  end
570
591
  rescue ::GRPC::BadStatus => e
571
592
  raise ::Google::Cloud::Error.from_error(e)
@@ -681,7 +702,7 @@ module Google
681
702
  @dataproc_metastore_stub.call_rpc :update_service, request, options: options do |response, operation|
682
703
  response = ::Gapic::Operation.new response, @operations_client, options: options
683
704
  yield response, operation if block_given?
684
- return response
705
+ throw :response, response
685
706
  end
686
707
  rescue ::GRPC::BadStatus => e
687
708
  raise ::Google::Cloud::Error.from_error(e)
@@ -791,7 +812,7 @@ module Google
791
812
  @dataproc_metastore_stub.call_rpc :delete_service, request, options: options do |response, operation|
792
813
  response = ::Gapic::Operation.new response, @operations_client, options: options
793
814
  yield response, operation if block_given?
794
- return response
815
+ throw :response, response
795
816
  end
796
817
  rescue ::GRPC::BadStatus => e
797
818
  raise ::Google::Cloud::Error.from_error(e)
@@ -905,7 +926,7 @@ module Google
905
926
  @dataproc_metastore_stub.call_rpc :list_metadata_imports, request, options: options do |response, operation|
906
927
  response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_metadata_imports, request, response, operation, options
907
928
  yield response, operation if block_given?
908
- return response
929
+ throw :response, response
909
930
  end
910
931
  rescue ::GRPC::BadStatus => e
911
932
  raise ::Google::Cloud::Error.from_error(e)
@@ -994,7 +1015,6 @@ module Google
994
1015
 
995
1016
  @dataproc_metastore_stub.call_rpc :get_metadata_import, request, options: options do |response, operation|
996
1017
  yield response, operation if block_given?
997
- return response
998
1018
  end
999
1019
  rescue ::GRPC::BadStatus => e
1000
1020
  raise ::Google::Cloud::Error.from_error(e)
@@ -1115,7 +1135,7 @@ module Google
1115
1135
  @dataproc_metastore_stub.call_rpc :create_metadata_import, request, options: options do |response, operation|
1116
1136
  response = ::Gapic::Operation.new response, @operations_client, options: options
1117
1137
  yield response, operation if block_given?
1118
- return response
1138
+ throw :response, response
1119
1139
  end
1120
1140
  rescue ::GRPC::BadStatus => e
1121
1141
  raise ::Google::Cloud::Error.from_error(e)
@@ -1232,7 +1252,7 @@ module Google
1232
1252
  @dataproc_metastore_stub.call_rpc :update_metadata_import, request, options: options do |response, operation|
1233
1253
  response = ::Gapic::Operation.new response, @operations_client, options: options
1234
1254
  yield response, operation if block_given?
1235
- return response
1255
+ throw :response, response
1236
1256
  end
1237
1257
  rescue ::GRPC::BadStatus => e
1238
1258
  raise ::Google::Cloud::Error.from_error(e)
@@ -1349,7 +1369,7 @@ module Google
1349
1369
  @dataproc_metastore_stub.call_rpc :export_metadata, request, options: options do |response, operation|
1350
1370
  response = ::Gapic::Operation.new response, @operations_client, options: options
1351
1371
  yield response, operation if block_given?
1352
- return response
1372
+ throw :response, response
1353
1373
  end
1354
1374
  rescue ::GRPC::BadStatus => e
1355
1375
  raise ::Google::Cloud::Error.from_error(e)
@@ -1466,7 +1486,7 @@ module Google
1466
1486
  @dataproc_metastore_stub.call_rpc :restore_service, request, options: options do |response, operation|
1467
1487
  response = ::Gapic::Operation.new response, @operations_client, options: options
1468
1488
  yield response, operation if block_given?
1469
- return response
1489
+ throw :response, response
1470
1490
  end
1471
1491
  rescue ::GRPC::BadStatus => e
1472
1492
  raise ::Google::Cloud::Error.from_error(e)
@@ -1580,7 +1600,7 @@ module Google
1580
1600
  @dataproc_metastore_stub.call_rpc :list_backups, request, options: options do |response, operation|
1581
1601
  response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_backups, request, response, operation, options
1582
1602
  yield response, operation if block_given?
1583
- return response
1603
+ throw :response, response
1584
1604
  end
1585
1605
  rescue ::GRPC::BadStatus => e
1586
1606
  raise ::Google::Cloud::Error.from_error(e)
@@ -1669,7 +1689,6 @@ module Google
1669
1689
 
1670
1690
  @dataproc_metastore_stub.call_rpc :get_backup, request, options: options do |response, operation|
1671
1691
  yield response, operation if block_given?
1672
- return response
1673
1692
  end
1674
1693
  rescue ::GRPC::BadStatus => e
1675
1694
  raise ::Google::Cloud::Error.from_error(e)
@@ -1789,7 +1808,7 @@ module Google
1789
1808
  @dataproc_metastore_stub.call_rpc :create_backup, request, options: options do |response, operation|
1790
1809
  response = ::Gapic::Operation.new response, @operations_client, options: options
1791
1810
  yield response, operation if block_given?
1792
- return response
1811
+ throw :response, response
1793
1812
  end
1794
1813
  rescue ::GRPC::BadStatus => e
1795
1814
  raise ::Google::Cloud::Error.from_error(e)
@@ -1899,7 +1918,7 @@ module Google
1899
1918
  @dataproc_metastore_stub.call_rpc :delete_backup, request, options: options do |response, operation|
1900
1919
  response = ::Gapic::Operation.new response, @operations_client, options: options
1901
1920
  yield response, operation if block_given?
1902
- return response
1921
+ throw :response, response
1903
1922
  end
1904
1923
  rescue ::GRPC::BadStatus => e
1905
1924
  raise ::Google::Cloud::Error.from_error(e)
@@ -1999,7 +2018,7 @@ module Google
1999
2018
  @dataproc_metastore_stub.call_rpc :query_metadata, request, options: options do |response, operation|
2000
2019
  response = ::Gapic::Operation.new response, @operations_client, options: options
2001
2020
  yield response, operation if block_given?
2002
- return response
2021
+ throw :response, response
2003
2022
  end
2004
2023
  rescue ::GRPC::BadStatus => e
2005
2024
  raise ::Google::Cloud::Error.from_error(e)
@@ -2102,7 +2121,7 @@ module Google
2102
2121
  @dataproc_metastore_stub.call_rpc :move_table_to_database, request, options: options do |response, operation|
2103
2122
  response = ::Gapic::Operation.new response, @operations_client, options: options
2104
2123
  yield response, operation if block_given?
2105
- return response
2124
+ throw :response, response
2106
2125
  end
2107
2126
  rescue ::GRPC::BadStatus => e
2108
2127
  raise ::Google::Cloud::Error.from_error(e)
@@ -2212,7 +2231,7 @@ module Google
2212
2231
  @dataproc_metastore_stub.call_rpc :alter_metadata_resource_location, request, options: options do |response, operation|
2213
2232
  response = ::Gapic::Operation.new response, @operations_client, options: options
2214
2233
  yield response, operation if block_given?
2215
- return response
2234
+ throw :response, response
2216
2235
  end
2217
2236
  rescue ::GRPC::BadStatus => e
2218
2237
  raise ::Google::Cloud::Error.from_error(e)
@@ -2301,6 +2320,11 @@ module Google
2301
2320
  # default endpoint URL. The default value of nil uses the environment
2302
2321
  # universe (usually the default "googleapis.com" universe).
2303
2322
  # @return [::String,nil]
2323
+ # @!attribute [rw] logger
2324
+ # A custom logger to use for request/response debug logging, or the value
2325
+ # `:default` (the default) to construct a default logger, or `nil` to
2326
+ # explicitly disable logging.
2327
+ # @return [::Logger,:default,nil]
2304
2328
  #
2305
2329
  class Configuration
2306
2330
  extend ::Gapic::Config
@@ -2325,6 +2349,7 @@ module Google
2325
2349
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2326
2350
  config_attr :quota_project, nil, ::String, nil
2327
2351
  config_attr :universe_domain, nil, ::String, nil
2352
+ config_attr :logger, :default, ::Logger, nil, :default
2328
2353
 
2329
2354
  # @private
2330
2355
  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
@@ -198,15 +198,27 @@ module Google
198
198
  endpoint: @config.endpoint,
199
199
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
200
200
  universe_domain: @config.universe_domain,
201
- credentials: credentials
201
+ credentials: credentials,
202
+ logger: @config.logger
202
203
  )
203
204
 
205
+ @dataproc_metastore_stub.logger(stub: true)&.info do |entry|
206
+ entry.set_system_name
207
+ entry.set_service
208
+ entry.message = "Created client for #{entry.service}"
209
+ entry.set_credentials_fields credentials
210
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
211
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
212
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
213
+ end
214
+
204
215
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
205
216
  config.credentials = credentials
206
217
  config.quota_project = @quota_project_id
207
218
  config.endpoint = @dataproc_metastore_stub.endpoint
208
219
  config.universe_domain = @dataproc_metastore_stub.universe_domain
209
220
  config.bindings_override = @config.bindings_override
221
+ config.logger = @dataproc_metastore_stub.logger if config.respond_to? :logger=
210
222
  end
211
223
 
212
224
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -215,6 +227,7 @@ module Google
215
227
  config.endpoint = @dataproc_metastore_stub.endpoint
216
228
  config.universe_domain = @dataproc_metastore_stub.universe_domain
217
229
  config.bindings_override = @config.bindings_override
230
+ config.logger = @dataproc_metastore_stub.logger if config.respond_to? :logger=
218
231
  end
219
232
  end
220
233
 
@@ -239,6 +252,15 @@ module Google
239
252
  #
240
253
  attr_reader :iam_policy_client
241
254
 
255
+ ##
256
+ # The logger used for request/response debug logging.
257
+ #
258
+ # @return [Logger]
259
+ #
260
+ def logger
261
+ @dataproc_metastore_stub.logger
262
+ end
263
+
242
264
  # Service calls
243
265
 
244
266
  ##
@@ -342,7 +364,6 @@ module Google
342
364
 
343
365
  @dataproc_metastore_stub.list_services request, options do |result, operation|
344
366
  yield result, operation if block_given?
345
- return result
346
367
  end
347
368
  rescue ::Gapic::Rest::Error => e
348
369
  raise ::Google::Cloud::Error.from_error(e)
@@ -424,7 +445,6 @@ module Google
424
445
 
425
446
  @dataproc_metastore_stub.get_service request, options do |result, operation|
426
447
  yield result, operation if block_given?
427
- return result
428
448
  end
429
449
  rescue ::Gapic::Rest::Error => e
430
450
  raise ::Google::Cloud::Error.from_error(e)
@@ -538,7 +558,7 @@ module Google
538
558
  @dataproc_metastore_stub.create_service request, options do |result, operation|
539
559
  result = ::Gapic::Operation.new result, @operations_client, options: options
540
560
  yield result, operation if block_given?
541
- return result
561
+ throw :response, result
542
562
  end
543
563
  rescue ::Gapic::Rest::Error => e
544
564
  raise ::Google::Cloud::Error.from_error(e)
@@ -647,7 +667,7 @@ module Google
647
667
  @dataproc_metastore_stub.update_service request, options do |result, operation|
648
668
  result = ::Gapic::Operation.new result, @operations_client, options: options
649
669
  yield result, operation if block_given?
650
- return result
670
+ throw :response, result
651
671
  end
652
672
  rescue ::Gapic::Rest::Error => e
653
673
  raise ::Google::Cloud::Error.from_error(e)
@@ -750,7 +770,7 @@ module Google
750
770
  @dataproc_metastore_stub.delete_service request, options do |result, operation|
751
771
  result = ::Gapic::Operation.new result, @operations_client, options: options
752
772
  yield result, operation if block_given?
753
- return result
773
+ throw :response, result
754
774
  end
755
775
  rescue ::Gapic::Rest::Error => e
756
776
  raise ::Google::Cloud::Error.from_error(e)
@@ -856,7 +876,6 @@ module Google
856
876
 
857
877
  @dataproc_metastore_stub.list_metadata_imports request, options do |result, operation|
858
878
  yield result, operation if block_given?
859
- return result
860
879
  end
861
880
  rescue ::Gapic::Rest::Error => e
862
881
  raise ::Google::Cloud::Error.from_error(e)
@@ -938,7 +957,6 @@ module Google
938
957
 
939
958
  @dataproc_metastore_stub.get_metadata_import request, options do |result, operation|
940
959
  yield result, operation if block_given?
941
- return result
942
960
  end
943
961
  rescue ::Gapic::Rest::Error => e
944
962
  raise ::Google::Cloud::Error.from_error(e)
@@ -1052,7 +1070,7 @@ module Google
1052
1070
  @dataproc_metastore_stub.create_metadata_import request, options do |result, operation|
1053
1071
  result = ::Gapic::Operation.new result, @operations_client, options: options
1054
1072
  yield result, operation if block_given?
1055
- return result
1073
+ throw :response, result
1056
1074
  end
1057
1075
  rescue ::Gapic::Rest::Error => e
1058
1076
  raise ::Google::Cloud::Error.from_error(e)
@@ -1162,7 +1180,7 @@ module Google
1162
1180
  @dataproc_metastore_stub.update_metadata_import request, options do |result, operation|
1163
1181
  result = ::Gapic::Operation.new result, @operations_client, options: options
1164
1182
  yield result, operation if block_given?
1165
- return result
1183
+ throw :response, result
1166
1184
  end
1167
1185
  rescue ::Gapic::Rest::Error => e
1168
1186
  raise ::Google::Cloud::Error.from_error(e)
@@ -1272,7 +1290,7 @@ module Google
1272
1290
  @dataproc_metastore_stub.export_metadata request, options do |result, operation|
1273
1291
  result = ::Gapic::Operation.new result, @operations_client, options: options
1274
1292
  yield result, operation if block_given?
1275
- return result
1293
+ throw :response, result
1276
1294
  end
1277
1295
  rescue ::Gapic::Rest::Error => e
1278
1296
  raise ::Google::Cloud::Error.from_error(e)
@@ -1382,7 +1400,7 @@ module Google
1382
1400
  @dataproc_metastore_stub.restore_service request, options do |result, operation|
1383
1401
  result = ::Gapic::Operation.new result, @operations_client, options: options
1384
1402
  yield result, operation if block_given?
1385
- return result
1403
+ throw :response, result
1386
1404
  end
1387
1405
  rescue ::Gapic::Rest::Error => e
1388
1406
  raise ::Google::Cloud::Error.from_error(e)
@@ -1488,7 +1506,6 @@ module Google
1488
1506
 
1489
1507
  @dataproc_metastore_stub.list_backups request, options do |result, operation|
1490
1508
  yield result, operation if block_given?
1491
- return result
1492
1509
  end
1493
1510
  rescue ::Gapic::Rest::Error => e
1494
1511
  raise ::Google::Cloud::Error.from_error(e)
@@ -1570,7 +1587,6 @@ module Google
1570
1587
 
1571
1588
  @dataproc_metastore_stub.get_backup request, options do |result, operation|
1572
1589
  yield result, operation if block_given?
1573
- return result
1574
1590
  end
1575
1591
  rescue ::Gapic::Rest::Error => e
1576
1592
  raise ::Google::Cloud::Error.from_error(e)
@@ -1683,7 +1699,7 @@ module Google
1683
1699
  @dataproc_metastore_stub.create_backup request, options do |result, operation|
1684
1700
  result = ::Gapic::Operation.new result, @operations_client, options: options
1685
1701
  yield result, operation if block_given?
1686
- return result
1702
+ throw :response, result
1687
1703
  end
1688
1704
  rescue ::Gapic::Rest::Error => e
1689
1705
  raise ::Google::Cloud::Error.from_error(e)
@@ -1786,7 +1802,7 @@ module Google
1786
1802
  @dataproc_metastore_stub.delete_backup request, options do |result, operation|
1787
1803
  result = ::Gapic::Operation.new result, @operations_client, options: options
1788
1804
  yield result, operation if block_given?
1789
- return result
1805
+ throw :response, result
1790
1806
  end
1791
1807
  rescue ::Gapic::Rest::Error => e
1792
1808
  raise ::Google::Cloud::Error.from_error(e)
@@ -1879,7 +1895,7 @@ module Google
1879
1895
  @dataproc_metastore_stub.query_metadata request, options do |result, operation|
1880
1896
  result = ::Gapic::Operation.new result, @operations_client, options: options
1881
1897
  yield result, operation if block_given?
1882
- return result
1898
+ throw :response, result
1883
1899
  end
1884
1900
  rescue ::Gapic::Rest::Error => e
1885
1901
  raise ::Google::Cloud::Error.from_error(e)
@@ -1975,7 +1991,7 @@ module Google
1975
1991
  @dataproc_metastore_stub.move_table_to_database request, options do |result, operation|
1976
1992
  result = ::Gapic::Operation.new result, @operations_client, options: options
1977
1993
  yield result, operation if block_given?
1978
- return result
1994
+ throw :response, result
1979
1995
  end
1980
1996
  rescue ::Gapic::Rest::Error => e
1981
1997
  raise ::Google::Cloud::Error.from_error(e)
@@ -2078,7 +2094,7 @@ module Google
2078
2094
  @dataproc_metastore_stub.alter_metadata_resource_location request, options do |result, operation|
2079
2095
  result = ::Gapic::Operation.new result, @operations_client, options: options
2080
2096
  yield result, operation if block_given?
2081
- return result
2097
+ throw :response, result
2082
2098
  end
2083
2099
  rescue ::Gapic::Rest::Error => e
2084
2100
  raise ::Google::Cloud::Error.from_error(e)
@@ -2158,6 +2174,11 @@ module Google
2158
2174
  # default endpoint URL. The default value of nil uses the environment
2159
2175
  # universe (usually the default "googleapis.com" universe).
2160
2176
  # @return [::String,nil]
2177
+ # @!attribute [rw] logger
2178
+ # A custom logger to use for request/response debug logging, or the value
2179
+ # `:default` (the default) to construct a default logger, or `nil` to
2180
+ # explicitly disable logging.
2181
+ # @return [::Logger,:default,nil]
2161
2182
  #
2162
2183
  class Configuration
2163
2184
  extend ::Gapic::Config
@@ -2186,6 +2207,7 @@ module Google
2186
2207
  # by the host service.
2187
2208
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2188
2209
  config_attr :bindings_override, {}, ::Hash, nil
2210
+ config_attr :logger, :default, ::Logger, nil, :default
2189
2211
 
2190
2212
  # @private
2191
2213
  def initialize parent_config = nil