google-cloud-bigquery-analytics_hub-v1 0.8.1 → 0.9.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: c97f122b13fa60c306403a858b80282759c443402974b7c0ebd32cd2c88124a6
4
- data.tar.gz: 5b0225ba8a0af88315153e38c10119c7bb82ea401a919bf944d0b7294d97be62
3
+ metadata.gz: d2abe72d32d4acd5e5662caef447e3e9e22b2525093f8c79a680a5f427de123c
4
+ data.tar.gz: 07da2ef3cce8e6e7c75b1662028eab9449632a959825fce6a38830d559bf342a
5
5
  SHA512:
6
- metadata.gz: 335ef1f5b3719c4e1c69058fe801de02585c3a6e8fcf7706d0f7b383d30e6d313ff17059e854db3a86feb1644e4ea037d31253c9d85f9067073b9a31d136f0f2
7
- data.tar.gz: 72d1dd5eea433c5995af68f1f53b40e90f77da0c9f5d9cbddec08806566aa81de8fcbbe4216c27e0db0664833c7db64727929bcc9ecdbb849ffc907dc103560a
6
+ metadata.gz: 872c1e8f39e4357750aa49372c6502c86db8626f6769b069e8ea46c00801089564bf0279c99f79afa6fd6b0f8acad70880a966db9b3712c400e61117b08ffcdb
7
+ data.tar.gz: 20dc1bc112b452d6ac7f5fc88664ad84813fd02326d716c6028d54c7c3d12434291cb58febc9a71427516fe8f0f885132dd5d98fdf182f655f889c471ce875b7
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/bigquery/docs)
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/bigquery/analytics_hub/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::Bigquery::AnalyticsHub::V1::AnalyticsHubService::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).
@@ -175,8 +175,19 @@ module Google
175
175
  universe_domain: @config.universe_domain,
176
176
  channel_args: @config.channel_args,
177
177
  interceptors: @config.interceptors,
178
- channel_pool_config: @config.channel_pool
178
+ channel_pool_config: @config.channel_pool,
179
+ logger: @config.logger
179
180
  )
181
+
182
+ @analytics_hub_service_stub.stub_logger&.info do |entry|
183
+ entry.set_system_name
184
+ entry.set_service
185
+ entry.message = "Created client for #{entry.service}"
186
+ entry.set_credentials_fields credentials
187
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
188
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
189
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
190
+ end
180
191
  end
181
192
 
182
193
  ##
@@ -186,6 +197,15 @@ module Google
186
197
  #
187
198
  attr_reader :operations_client
188
199
 
200
+ ##
201
+ # The logger used for request/response debug logging.
202
+ #
203
+ # @return [Logger]
204
+ #
205
+ def logger
206
+ @analytics_hub_service_stub.logger
207
+ end
208
+
189
209
  # Service calls
190
210
 
191
211
  ##
@@ -280,7 +300,7 @@ module Google
280
300
  @analytics_hub_service_stub.call_rpc :list_data_exchanges, request, options: options do |response, operation|
281
301
  response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_data_exchanges, request, response, operation, options
282
302
  yield response, operation if block_given?
283
- return response
303
+ throw :response, response
284
304
  end
285
305
  rescue ::GRPC::BadStatus => e
286
306
  raise ::Google::Cloud::Error.from_error(e)
@@ -379,7 +399,7 @@ module Google
379
399
  @analytics_hub_service_stub.call_rpc :list_org_data_exchanges, request, options: options do |response, operation|
380
400
  response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_org_data_exchanges, request, response, operation, options
381
401
  yield response, operation if block_given?
382
- return response
402
+ throw :response, response
383
403
  end
384
404
  rescue ::GRPC::BadStatus => e
385
405
  raise ::Google::Cloud::Error.from_error(e)
@@ -466,7 +486,6 @@ module Google
466
486
 
467
487
  @analytics_hub_service_stub.call_rpc :get_data_exchange, request, options: options do |response, operation|
468
488
  yield response, operation if block_given?
469
- return response
470
489
  end
471
490
  rescue ::GRPC::BadStatus => e
472
491
  raise ::Google::Cloud::Error.from_error(e)
@@ -561,7 +580,6 @@ module Google
561
580
 
562
581
  @analytics_hub_service_stub.call_rpc :create_data_exchange, request, options: options do |response, operation|
563
582
  yield response, operation if block_given?
564
- return response
565
583
  end
566
584
  rescue ::GRPC::BadStatus => e
567
585
  raise ::Google::Cloud::Error.from_error(e)
@@ -651,7 +669,6 @@ module Google
651
669
 
652
670
  @analytics_hub_service_stub.call_rpc :update_data_exchange, request, options: options do |response, operation|
653
671
  yield response, operation if block_given?
654
- return response
655
672
  end
656
673
  rescue ::GRPC::BadStatus => e
657
674
  raise ::Google::Cloud::Error.from_error(e)
@@ -738,7 +755,6 @@ module Google
738
755
 
739
756
  @analytics_hub_service_stub.call_rpc :delete_data_exchange, request, options: options do |response, operation|
740
757
  yield response, operation if block_given?
741
- return response
742
758
  end
743
759
  rescue ::GRPC::BadStatus => e
744
760
  raise ::Google::Cloud::Error.from_error(e)
@@ -836,7 +852,7 @@ module Google
836
852
  @analytics_hub_service_stub.call_rpc :list_listings, request, options: options do |response, operation|
837
853
  response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_listings, request, response, operation, options
838
854
  yield response, operation if block_given?
839
- return response
855
+ throw :response, response
840
856
  end
841
857
  rescue ::GRPC::BadStatus => e
842
858
  raise ::Google::Cloud::Error.from_error(e)
@@ -923,7 +939,6 @@ module Google
923
939
 
924
940
  @analytics_hub_service_stub.call_rpc :get_listing, request, options: options do |response, operation|
925
941
  yield response, operation if block_given?
926
- return response
927
942
  end
928
943
  rescue ::GRPC::BadStatus => e
929
944
  raise ::Google::Cloud::Error.from_error(e)
@@ -1018,7 +1033,6 @@ module Google
1018
1033
 
1019
1034
  @analytics_hub_service_stub.call_rpc :create_listing, request, options: options do |response, operation|
1020
1035
  yield response, operation if block_given?
1021
- return response
1022
1036
  end
1023
1037
  rescue ::GRPC::BadStatus => e
1024
1038
  raise ::Google::Cloud::Error.from_error(e)
@@ -1108,7 +1122,6 @@ module Google
1108
1122
 
1109
1123
  @analytics_hub_service_stub.call_rpc :update_listing, request, options: options do |response, operation|
1110
1124
  yield response, operation if block_given?
1111
- return response
1112
1125
  end
1113
1126
  rescue ::GRPC::BadStatus => e
1114
1127
  raise ::Google::Cloud::Error.from_error(e)
@@ -1195,7 +1208,6 @@ module Google
1195
1208
 
1196
1209
  @analytics_hub_service_stub.call_rpc :delete_listing, request, options: options do |response, operation|
1197
1210
  yield response, operation if block_given?
1198
- return response
1199
1211
  end
1200
1212
  rescue ::GRPC::BadStatus => e
1201
1213
  raise ::Google::Cloud::Error.from_error(e)
@@ -1289,7 +1301,6 @@ module Google
1289
1301
 
1290
1302
  @analytics_hub_service_stub.call_rpc :subscribe_listing, request, options: options do |response, operation|
1291
1303
  yield response, operation if block_given?
1292
- return response
1293
1304
  end
1294
1305
  rescue ::GRPC::BadStatus => e
1295
1306
  raise ::Google::Cloud::Error.from_error(e)
@@ -1393,7 +1404,7 @@ module Google
1393
1404
  @analytics_hub_service_stub.call_rpc :subscribe_data_exchange, request, options: options do |response, operation|
1394
1405
  response = ::Gapic::Operation.new response, @operations_client, options: options
1395
1406
  yield response, operation if block_given?
1396
- return response
1407
+ throw :response, response
1397
1408
  end
1398
1409
  rescue ::GRPC::BadStatus => e
1399
1410
  raise ::Google::Cloud::Error.from_error(e)
@@ -1490,7 +1501,7 @@ module Google
1490
1501
  @analytics_hub_service_stub.call_rpc :refresh_subscription, request, options: options do |response, operation|
1491
1502
  response = ::Gapic::Operation.new response, @operations_client, options: options
1492
1503
  yield response, operation if block_given?
1493
- return response
1504
+ throw :response, response
1494
1505
  end
1495
1506
  rescue ::GRPC::BadStatus => e
1496
1507
  raise ::Google::Cloud::Error.from_error(e)
@@ -1577,7 +1588,6 @@ module Google
1577
1588
 
1578
1589
  @analytics_hub_service_stub.call_rpc :get_subscription, request, options: options do |response, operation|
1579
1590
  yield response, operation if block_given?
1580
- return response
1581
1591
  end
1582
1592
  rescue ::GRPC::BadStatus => e
1583
1593
  raise ::Google::Cloud::Error.from_error(e)
@@ -1689,7 +1699,7 @@ module Google
1689
1699
  @analytics_hub_service_stub.call_rpc :list_subscriptions, request, options: options do |response, operation|
1690
1700
  response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_subscriptions, request, response, operation, options
1691
1701
  yield response, operation if block_given?
1692
- return response
1702
+ throw :response, response
1693
1703
  end
1694
1704
  rescue ::GRPC::BadStatus => e
1695
1705
  raise ::Google::Cloud::Error.from_error(e)
@@ -1790,7 +1800,7 @@ module Google
1790
1800
  @analytics_hub_service_stub.call_rpc :list_shared_resource_subscriptions, request, options: options do |response, operation|
1791
1801
  response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_shared_resource_subscriptions, request, response, operation, options
1792
1802
  yield response, operation if block_given?
1793
- return response
1803
+ throw :response, response
1794
1804
  end
1795
1805
  rescue ::GRPC::BadStatus => e
1796
1806
  raise ::Google::Cloud::Error.from_error(e)
@@ -1877,7 +1887,6 @@ module Google
1877
1887
 
1878
1888
  @analytics_hub_service_stub.call_rpc :revoke_subscription, request, options: options do |response, operation|
1879
1889
  yield response, operation if block_given?
1880
- return response
1881
1890
  end
1882
1891
  rescue ::GRPC::BadStatus => e
1883
1892
  raise ::Google::Cloud::Error.from_error(e)
@@ -1972,7 +1981,7 @@ module Google
1972
1981
  @analytics_hub_service_stub.call_rpc :delete_subscription, request, options: options do |response, operation|
1973
1982
  response = ::Gapic::Operation.new response, @operations_client, options: options
1974
1983
  yield response, operation if block_given?
1975
- return response
1984
+ throw :response, response
1976
1985
  end
1977
1986
  rescue ::GRPC::BadStatus => e
1978
1987
  raise ::Google::Cloud::Error.from_error(e)
@@ -2062,7 +2071,6 @@ module Google
2062
2071
 
2063
2072
  @analytics_hub_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
2064
2073
  yield response, operation if block_given?
2065
- return response
2066
2074
  end
2067
2075
  rescue ::GRPC::BadStatus => e
2068
2076
  raise ::Google::Cloud::Error.from_error(e)
@@ -2160,7 +2168,6 @@ module Google
2160
2168
 
2161
2169
  @analytics_hub_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
2162
2170
  yield response, operation if block_given?
2163
- return response
2164
2171
  end
2165
2172
  rescue ::GRPC::BadStatus => e
2166
2173
  raise ::Google::Cloud::Error.from_error(e)
@@ -2252,7 +2259,6 @@ module Google
2252
2259
 
2253
2260
  @analytics_hub_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
2254
2261
  yield response, operation if block_given?
2255
- return response
2256
2262
  end
2257
2263
  rescue ::GRPC::BadStatus => e
2258
2264
  raise ::Google::Cloud::Error.from_error(e)
@@ -2341,6 +2347,11 @@ module Google
2341
2347
  # default endpoint URL. The default value of nil uses the environment
2342
2348
  # universe (usually the default "googleapis.com" universe).
2343
2349
  # @return [::String,nil]
2350
+ # @!attribute [rw] logger
2351
+ # A custom logger to use for request/response debug logging, or the value
2352
+ # `:default` (the default) to construct a default logger, or `nil` to
2353
+ # explicitly disable logging.
2354
+ # @return [::Logger,:default,nil]
2344
2355
  #
2345
2356
  class Configuration
2346
2357
  extend ::Gapic::Config
@@ -2365,6 +2376,7 @@ module Google
2365
2376
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2366
2377
  config_attr :quota_project, nil, ::String, nil
2367
2378
  config_attr :universe_domain, nil, ::String, nil
2379
+ config_attr :logger, :default, ::Logger, nil, :default
2368
2380
 
2369
2381
  # @private
2370
2382
  def initialize parent_config = nil
@@ -125,14 +125,6 @@ module Google
125
125
  # Lists operations that match the specified filter in the request. If the
126
126
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
127
127
  #
128
- # NOTE: the `name` binding allows API services to override the binding
129
- # to use different resource name schemes, such as `users/*/operations`. To
130
- # override the binding, API services can add a binding such as
131
- # `"/v1/{name=users/*}/operations"` to their service configuration.
132
- # For backwards compatibility, the default name includes the operations
133
- # collection id, however overriding users must ensure the name binding
134
- # is the parent resource, without the operations collection id.
135
- #
136
128
  # @overload list_operations(request, options = nil)
137
129
  # Pass arguments to `list_operations` via a request object, either of type
138
130
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -222,7 +214,7 @@ module Google
222
214
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
223
215
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
224
216
  yield response, operation if block_given?
225
- return response
217
+ throw :response, response
226
218
  end
227
219
  rescue ::GRPC::BadStatus => e
228
220
  raise ::Google::Cloud::Error.from_error(e)
@@ -318,7 +310,7 @@ module Google
318
310
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
319
311
  response = ::Gapic::Operation.new response, @operations_client, options: options
320
312
  yield response, operation if block_given?
321
- return response
313
+ throw :response, response
322
314
  end
323
315
  rescue ::GRPC::BadStatus => e
324
316
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +399,6 @@ module Google
407
399
 
408
400
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
409
401
  yield response, operation if block_given?
410
- return response
411
402
  end
412
403
  rescue ::GRPC::BadStatus => e
413
404
  raise ::Google::Cloud::Error.from_error(e)
@@ -422,8 +413,9 @@ module Google
422
413
  # other methods to check whether the cancellation succeeded or whether the
423
414
  # operation completed despite cancellation. On successful cancellation,
424
415
  # the operation is not deleted; instead, it becomes an operation with
425
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
426
- # corresponding to `Code.CANCELLED`.
416
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
417
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
418
+ # `Code.CANCELLED`.
427
419
  #
428
420
  # @overload cancel_operation(request, options = nil)
429
421
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -502,7 +494,6 @@ module Google
502
494
 
503
495
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
504
496
  yield response, operation if block_given?
505
- return response
506
497
  end
507
498
  rescue ::GRPC::BadStatus => e
508
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +591,7 @@ module Google
600
591
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
601
592
  response = ::Gapic::Operation.new response, @operations_client, options: options
602
593
  yield response, operation if block_given?
603
- return response
594
+ throw :response, response
604
595
  end
605
596
  rescue ::GRPC::BadStatus => e
606
597
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,6 +680,11 @@ module Google
689
680
  # default endpoint URL. The default value of nil uses the environment
690
681
  # universe (usually the default "googleapis.com" universe).
691
682
  # @return [::String,nil]
683
+ # @!attribute [rw] logger
684
+ # A custom logger to use for request/response debug logging, or the value
685
+ # `:default` (the default) to construct a default logger, or `nil` to
686
+ # explicitly disable logging.
687
+ # @return [::Logger,:default,nil]
692
688
  #
693
689
  class Configuration
694
690
  extend ::Gapic::Config
@@ -713,6 +709,7 @@ module Google
713
709
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
714
710
  config_attr :quota_project, nil, ::String, nil
715
711
  config_attr :universe_domain, nil, ::String, nil
712
+ config_attr :logger, :default, ::Logger, nil, :default
716
713
 
717
714
  # @private
718
715
  def initialize parent_config = nil
@@ -168,8 +168,19 @@ module Google
168
168
  endpoint: @config.endpoint,
169
169
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
170
  universe_domain: @config.universe_domain,
171
- credentials: credentials
171
+ credentials: credentials,
172
+ logger: @config.logger
172
173
  )
174
+
175
+ @analytics_hub_service_stub.logger(stub: true)&.info do |entry|
176
+ entry.set_system_name
177
+ entry.set_service
178
+ entry.message = "Created client for #{entry.service}"
179
+ entry.set_credentials_fields credentials
180
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
181
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
182
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
183
+ end
173
184
  end
174
185
 
175
186
  ##
@@ -179,6 +190,15 @@ module Google
179
190
  #
180
191
  attr_reader :operations_client
181
192
 
193
+ ##
194
+ # The logger used for request/response debug logging.
195
+ #
196
+ # @return [Logger]
197
+ #
198
+ def logger
199
+ @analytics_hub_service_stub.logger
200
+ end
201
+
182
202
  # Service calls
183
203
 
184
204
  ##
@@ -266,7 +286,7 @@ module Google
266
286
  @analytics_hub_service_stub.list_data_exchanges request, options do |result, operation|
267
287
  result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_data_exchanges, "data_exchanges", request, result, options
268
288
  yield result, operation if block_given?
269
- return result
289
+ throw :response, result
270
290
  end
271
291
  rescue ::Gapic::Rest::Error => e
272
292
  raise ::Google::Cloud::Error.from_error(e)
@@ -358,7 +378,7 @@ module Google
358
378
  @analytics_hub_service_stub.list_org_data_exchanges request, options do |result, operation|
359
379
  result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_org_data_exchanges, "data_exchanges", request, result, options
360
380
  yield result, operation if block_given?
361
- return result
381
+ throw :response, result
362
382
  end
363
383
  rescue ::Gapic::Rest::Error => e
364
384
  raise ::Google::Cloud::Error.from_error(e)
@@ -438,7 +458,6 @@ module Google
438
458
 
439
459
  @analytics_hub_service_stub.get_data_exchange request, options do |result, operation|
440
460
  yield result, operation if block_given?
441
- return result
442
461
  end
443
462
  rescue ::Gapic::Rest::Error => e
444
463
  raise ::Google::Cloud::Error.from_error(e)
@@ -526,7 +545,6 @@ module Google
526
545
 
527
546
  @analytics_hub_service_stub.create_data_exchange request, options do |result, operation|
528
547
  yield result, operation if block_given?
529
- return result
530
548
  end
531
549
  rescue ::Gapic::Rest::Error => e
532
550
  raise ::Google::Cloud::Error.from_error(e)
@@ -609,7 +627,6 @@ module Google
609
627
 
610
628
  @analytics_hub_service_stub.update_data_exchange request, options do |result, operation|
611
629
  yield result, operation if block_given?
612
- return result
613
630
  end
614
631
  rescue ::Gapic::Rest::Error => e
615
632
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,7 +706,6 @@ module Google
689
706
 
690
707
  @analytics_hub_service_stub.delete_data_exchange request, options do |result, operation|
691
708
  yield result, operation if block_given?
692
- return result
693
709
  end
694
710
  rescue ::Gapic::Rest::Error => e
695
711
  raise ::Google::Cloud::Error.from_error(e)
@@ -780,7 +796,7 @@ module Google
780
796
  @analytics_hub_service_stub.list_listings request, options do |result, operation|
781
797
  result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_listings, "listings", request, result, options
782
798
  yield result, operation if block_given?
783
- return result
799
+ throw :response, result
784
800
  end
785
801
  rescue ::Gapic::Rest::Error => e
786
802
  raise ::Google::Cloud::Error.from_error(e)
@@ -860,7 +876,6 @@ module Google
860
876
 
861
877
  @analytics_hub_service_stub.get_listing request, options do |result, operation|
862
878
  yield result, operation if block_given?
863
- return result
864
879
  end
865
880
  rescue ::Gapic::Rest::Error => e
866
881
  raise ::Google::Cloud::Error.from_error(e)
@@ -948,7 +963,6 @@ module Google
948
963
 
949
964
  @analytics_hub_service_stub.create_listing request, options do |result, operation|
950
965
  yield result, operation if block_given?
951
- return result
952
966
  end
953
967
  rescue ::Gapic::Rest::Error => e
954
968
  raise ::Google::Cloud::Error.from_error(e)
@@ -1031,7 +1045,6 @@ module Google
1031
1045
 
1032
1046
  @analytics_hub_service_stub.update_listing request, options do |result, operation|
1033
1047
  yield result, operation if block_given?
1034
- return result
1035
1048
  end
1036
1049
  rescue ::Gapic::Rest::Error => e
1037
1050
  raise ::Google::Cloud::Error.from_error(e)
@@ -1111,7 +1124,6 @@ module Google
1111
1124
 
1112
1125
  @analytics_hub_service_stub.delete_listing request, options do |result, operation|
1113
1126
  yield result, operation if block_given?
1114
- return result
1115
1127
  end
1116
1128
  rescue ::Gapic::Rest::Error => e
1117
1129
  raise ::Google::Cloud::Error.from_error(e)
@@ -1198,7 +1210,6 @@ module Google
1198
1210
 
1199
1211
  @analytics_hub_service_stub.subscribe_listing request, options do |result, operation|
1200
1212
  yield result, operation if block_given?
1201
- return result
1202
1213
  end
1203
1214
  rescue ::Gapic::Rest::Error => e
1204
1215
  raise ::Google::Cloud::Error.from_error(e)
@@ -1295,7 +1306,7 @@ module Google
1295
1306
  @analytics_hub_service_stub.subscribe_data_exchange request, options do |result, operation|
1296
1307
  result = ::Gapic::Operation.new result, @operations_client, options: options
1297
1308
  yield result, operation if block_given?
1298
- return result
1309
+ throw :response, result
1299
1310
  end
1300
1311
  rescue ::Gapic::Rest::Error => e
1301
1312
  raise ::Google::Cloud::Error.from_error(e)
@@ -1385,7 +1396,7 @@ module Google
1385
1396
  @analytics_hub_service_stub.refresh_subscription request, options do |result, operation|
1386
1397
  result = ::Gapic::Operation.new result, @operations_client, options: options
1387
1398
  yield result, operation if block_given?
1388
- return result
1399
+ throw :response, result
1389
1400
  end
1390
1401
  rescue ::Gapic::Rest::Error => e
1391
1402
  raise ::Google::Cloud::Error.from_error(e)
@@ -1465,7 +1476,6 @@ module Google
1465
1476
 
1466
1477
  @analytics_hub_service_stub.get_subscription request, options do |result, operation|
1467
1478
  yield result, operation if block_given?
1468
- return result
1469
1479
  end
1470
1480
  rescue ::Gapic::Rest::Error => e
1471
1481
  raise ::Google::Cloud::Error.from_error(e)
@@ -1570,7 +1580,7 @@ module Google
1570
1580
  @analytics_hub_service_stub.list_subscriptions request, options do |result, operation|
1571
1581
  result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_subscriptions, "subscriptions", request, result, options
1572
1582
  yield result, operation if block_given?
1573
- return result
1583
+ throw :response, result
1574
1584
  end
1575
1585
  rescue ::Gapic::Rest::Error => e
1576
1586
  raise ::Google::Cloud::Error.from_error(e)
@@ -1664,7 +1674,7 @@ module Google
1664
1674
  @analytics_hub_service_stub.list_shared_resource_subscriptions request, options do |result, operation|
1665
1675
  result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_shared_resource_subscriptions, "shared_resource_subscriptions", request, result, options
1666
1676
  yield result, operation if block_given?
1667
- return result
1677
+ throw :response, result
1668
1678
  end
1669
1679
  rescue ::Gapic::Rest::Error => e
1670
1680
  raise ::Google::Cloud::Error.from_error(e)
@@ -1744,7 +1754,6 @@ module Google
1744
1754
 
1745
1755
  @analytics_hub_service_stub.revoke_subscription request, options do |result, operation|
1746
1756
  yield result, operation if block_given?
1747
- return result
1748
1757
  end
1749
1758
  rescue ::Gapic::Rest::Error => e
1750
1759
  raise ::Google::Cloud::Error.from_error(e)
@@ -1832,7 +1841,7 @@ module Google
1832
1841
  @analytics_hub_service_stub.delete_subscription request, options do |result, operation|
1833
1842
  result = ::Gapic::Operation.new result, @operations_client, options: options
1834
1843
  yield result, operation if block_given?
1835
- return result
1844
+ throw :response, result
1836
1845
  end
1837
1846
  rescue ::Gapic::Rest::Error => e
1838
1847
  raise ::Google::Cloud::Error.from_error(e)
@@ -1915,7 +1924,6 @@ module Google
1915
1924
 
1916
1925
  @analytics_hub_service_stub.get_iam_policy request, options do |result, operation|
1917
1926
  yield result, operation if block_given?
1918
- return result
1919
1927
  end
1920
1928
  rescue ::Gapic::Rest::Error => e
1921
1929
  raise ::Google::Cloud::Error.from_error(e)
@@ -2006,7 +2014,6 @@ module Google
2006
2014
 
2007
2015
  @analytics_hub_service_stub.set_iam_policy request, options do |result, operation|
2008
2016
  yield result, operation if block_given?
2009
- return result
2010
2017
  end
2011
2018
  rescue ::Gapic::Rest::Error => e
2012
2019
  raise ::Google::Cloud::Error.from_error(e)
@@ -2091,7 +2098,6 @@ module Google
2091
2098
 
2092
2099
  @analytics_hub_service_stub.test_iam_permissions request, options do |result, operation|
2093
2100
  yield result, operation if block_given?
2094
- return result
2095
2101
  end
2096
2102
  rescue ::Gapic::Rest::Error => e
2097
2103
  raise ::Google::Cloud::Error.from_error(e)
@@ -2171,6 +2177,11 @@ module Google
2171
2177
  # default endpoint URL. The default value of nil uses the environment
2172
2178
  # universe (usually the default "googleapis.com" universe).
2173
2179
  # @return [::String,nil]
2180
+ # @!attribute [rw] logger
2181
+ # A custom logger to use for request/response debug logging, or the value
2182
+ # `:default` (the default) to construct a default logger, or `nil` to
2183
+ # explicitly disable logging.
2184
+ # @return [::Logger,:default,nil]
2174
2185
  #
2175
2186
  class Configuration
2176
2187
  extend ::Gapic::Config
@@ -2192,6 +2203,7 @@ module Google
2192
2203
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2193
2204
  config_attr :quota_project, nil, ::String, nil
2194
2205
  config_attr :universe_domain, nil, ::String, nil
2206
+ config_attr :logger, :default, ::Logger, nil, :default
2195
2207
 
2196
2208
  # @private
2197
2209
  def initialize parent_config = nil