google-cloud-datastream-v1alpha1 0.7.0 → 0.8.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: db386cec4b9fe885328843eef24dbef786ba547d348553d193be71466fb5988d
4
- data.tar.gz: 6b33440a0f3ed4716b237790498c52829b4cc47b9248ee76d729cd601fa0c8ba
3
+ metadata.gz: ecb1010b65b88f6f8b6128df4890b04185e08cb9a89e377c38c0fe76beebb02c
4
+ data.tar.gz: 5d1f546cdee1aeaaab73b67ab826cc202202f6737e368ff8531ec3757e5ee847
5
5
  SHA512:
6
- metadata.gz: a69e9f80d93fcb26e8ec939abfd05ae103147c7444f25ead20d8c646574dbc238375eb86f507e0cd024d0476735af24238c8f5d0b6031a639b6aeba4feef9f32
7
- data.tar.gz: eb95e7f699603559a8c653de0e85c8cea81caf8139a0ae034840d8df5e2c7842889f572e44e2ea3a7c3b71a94f4fa387d067a893fb98a2e5011579585543af91
6
+ metadata.gz: 0b58e4842ca85d2f61e26ef9a9d9f36550201632630ec274d3fa3ffe917ac855ae53a9ff049c2eb99e45413a6db23154a2bb7a2b25d2a64a6483b4f314e141a2
7
+ data.tar.gz: 836c0e649cbc18403fbdff0ee6eeb47054486bfd843e54410f2a711f5e61ff29df1e066e30873821a29bd36819e9d154945435741bedc4ed814250cfc7f4be47
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/datastream/)
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/datastream/v1alpha1"
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::Datastream::V1alpha1::Datastream::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).
@@ -30,6 +30,9 @@ module Google
30
30
  # Datastream service
31
31
  #
32
32
  class Client
33
+ # @private
34
+ API_VERSION = ""
35
+
33
36
  # @private
34
37
  DEFAULT_ENDPOINT_TEMPLATE = "datastream.$UNIVERSE_DOMAIN$"
35
38
 
@@ -186,8 +189,19 @@ module Google
186
189
  universe_domain: @config.universe_domain,
187
190
  channel_args: @config.channel_args,
188
191
  interceptors: @config.interceptors,
189
- channel_pool_config: @config.channel_pool
192
+ channel_pool_config: @config.channel_pool,
193
+ logger: @config.logger
190
194
  )
195
+
196
+ @datastream_stub.stub_logger&.info do |entry|
197
+ entry.set_system_name
198
+ entry.set_service
199
+ entry.message = "Created client for #{entry.service}"
200
+ entry.set_credentials_fields credentials
201
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
202
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
203
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
204
+ end
191
205
  end
192
206
 
193
207
  ##
@@ -197,6 +211,15 @@ module Google
197
211
  #
198
212
  attr_reader :operations_client
199
213
 
214
+ ##
215
+ # The logger used for request/response debug logging.
216
+ #
217
+ # @return [Logger]
218
+ #
219
+ def logger
220
+ @datastream_stub.logger
221
+ end
222
+
200
223
  # Service calls
201
224
 
202
225
  ##
@@ -273,10 +296,11 @@ module Google
273
296
  # Customize the options with defaults
274
297
  metadata = @config.rpcs.list_connection_profiles.metadata.to_h
275
298
 
276
- # Set x-goog-api-client and x-goog-user-project headers
299
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
277
300
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
278
301
  lib_name: @config.lib_name, lib_version: @config.lib_version,
279
302
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
303
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
280
304
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
305
 
282
306
  header_params = {}
@@ -298,7 +322,7 @@ module Google
298
322
  @datastream_stub.call_rpc :list_connection_profiles, request, options: options do |response, operation|
299
323
  response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_connection_profiles, request, response, operation, options
300
324
  yield response, operation if block_given?
301
- return response
325
+ throw :response, response
302
326
  end
303
327
  rescue ::GRPC::BadStatus => e
304
328
  raise ::Google::Cloud::Error.from_error(e)
@@ -359,10 +383,11 @@ module Google
359
383
  # Customize the options with defaults
360
384
  metadata = @config.rpcs.get_connection_profile.metadata.to_h
361
385
 
362
- # Set x-goog-api-client and x-goog-user-project headers
386
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
363
387
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
364
388
  lib_name: @config.lib_name, lib_version: @config.lib_version,
365
389
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
390
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
366
391
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
392
 
368
393
  header_params = {}
@@ -383,7 +408,6 @@ module Google
383
408
 
384
409
  @datastream_stub.call_rpc :get_connection_profile, request, options: options do |response, operation|
385
410
  yield response, operation if block_given?
386
- return response
387
411
  end
388
412
  rescue ::GRPC::BadStatus => e
389
413
  raise ::Google::Cloud::Error.from_error(e)
@@ -469,10 +493,11 @@ module Google
469
493
  # Customize the options with defaults
470
494
  metadata = @config.rpcs.create_connection_profile.metadata.to_h
471
495
 
472
- # Set x-goog-api-client and x-goog-user-project headers
496
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
473
497
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
474
498
  lib_name: @config.lib_name, lib_version: @config.lib_version,
475
499
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
500
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
476
501
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
477
502
 
478
503
  header_params = {}
@@ -494,7 +519,7 @@ module Google
494
519
  @datastream_stub.call_rpc :create_connection_profile, request, options: options do |response, operation|
495
520
  response = ::Gapic::Operation.new response, @operations_client, options: options
496
521
  yield response, operation if block_given?
497
- return response
522
+ throw :response, response
498
523
  end
499
524
  rescue ::GRPC::BadStatus => e
500
525
  raise ::Google::Cloud::Error.from_error(e)
@@ -582,10 +607,11 @@ module Google
582
607
  # Customize the options with defaults
583
608
  metadata = @config.rpcs.update_connection_profile.metadata.to_h
584
609
 
585
- # Set x-goog-api-client and x-goog-user-project headers
610
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
586
611
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
587
612
  lib_name: @config.lib_name, lib_version: @config.lib_version,
588
613
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
614
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
589
615
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
590
616
 
591
617
  header_params = {}
@@ -607,7 +633,7 @@ module Google
607
633
  @datastream_stub.call_rpc :update_connection_profile, request, options: options do |response, operation|
608
634
  response = ::Gapic::Operation.new response, @operations_client, options: options
609
635
  yield response, operation if block_given?
610
- return response
636
+ throw :response, response
611
637
  end
612
638
  rescue ::GRPC::BadStatus => e
613
639
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,10 +715,11 @@ module Google
689
715
  # Customize the options with defaults
690
716
  metadata = @config.rpcs.delete_connection_profile.metadata.to_h
691
717
 
692
- # Set x-goog-api-client and x-goog-user-project headers
718
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
693
719
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
694
720
  lib_name: @config.lib_name, lib_version: @config.lib_version,
695
721
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
722
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
696
723
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
697
724
 
698
725
  header_params = {}
@@ -714,7 +741,7 @@ module Google
714
741
  @datastream_stub.call_rpc :delete_connection_profile, request, options: options do |response, operation|
715
742
  response = ::Gapic::Operation.new response, @operations_client, options: options
716
743
  yield response, operation if block_given?
717
- return response
744
+ throw :response, response
718
745
  end
719
746
  rescue ::GRPC::BadStatus => e
720
747
  raise ::Google::Cloud::Error.from_error(e)
@@ -792,10 +819,11 @@ module Google
792
819
  # Customize the options with defaults
793
820
  metadata = @config.rpcs.discover_connection_profile.metadata.to_h
794
821
 
795
- # Set x-goog-api-client and x-goog-user-project headers
822
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
796
823
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
797
824
  lib_name: @config.lib_name, lib_version: @config.lib_version,
798
825
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
826
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
799
827
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
800
828
 
801
829
  header_params = {}
@@ -816,7 +844,6 @@ module Google
816
844
 
817
845
  @datastream_stub.call_rpc :discover_connection_profile, request, options: options do |response, operation|
818
846
  yield response, operation if block_given?
819
- return response
820
847
  end
821
848
  rescue ::GRPC::BadStatus => e
822
849
  raise ::Google::Cloud::Error.from_error(e)
@@ -895,10 +922,11 @@ module Google
895
922
  # Customize the options with defaults
896
923
  metadata = @config.rpcs.list_streams.metadata.to_h
897
924
 
898
- # Set x-goog-api-client and x-goog-user-project headers
925
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
899
926
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
900
927
  lib_name: @config.lib_name, lib_version: @config.lib_version,
901
928
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
929
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
902
930
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
903
931
 
904
932
  header_params = {}
@@ -920,7 +948,7 @@ module Google
920
948
  @datastream_stub.call_rpc :list_streams, request, options: options do |response, operation|
921
949
  response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_streams, request, response, operation, options
922
950
  yield response, operation if block_given?
923
- return response
951
+ throw :response, response
924
952
  end
925
953
  rescue ::GRPC::BadStatus => e
926
954
  raise ::Google::Cloud::Error.from_error(e)
@@ -981,10 +1009,11 @@ module Google
981
1009
  # Customize the options with defaults
982
1010
  metadata = @config.rpcs.get_stream.metadata.to_h
983
1011
 
984
- # Set x-goog-api-client and x-goog-user-project headers
1012
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
985
1013
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
986
1014
  lib_name: @config.lib_name, lib_version: @config.lib_version,
987
1015
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1016
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
988
1017
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
989
1018
 
990
1019
  header_params = {}
@@ -1005,7 +1034,6 @@ module Google
1005
1034
 
1006
1035
  @datastream_stub.call_rpc :get_stream, request, options: options do |response, operation|
1007
1036
  yield response, operation if block_given?
1008
- return response
1009
1037
  end
1010
1038
  rescue ::GRPC::BadStatus => e
1011
1039
  raise ::Google::Cloud::Error.from_error(e)
@@ -1096,10 +1124,11 @@ module Google
1096
1124
  # Customize the options with defaults
1097
1125
  metadata = @config.rpcs.create_stream.metadata.to_h
1098
1126
 
1099
- # Set x-goog-api-client and x-goog-user-project headers
1127
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1100
1128
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1101
1129
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1102
1130
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1131
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1103
1132
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1104
1133
 
1105
1134
  header_params = {}
@@ -1121,7 +1150,7 @@ module Google
1121
1150
  @datastream_stub.call_rpc :create_stream, request, options: options do |response, operation|
1122
1151
  response = ::Gapic::Operation.new response, @operations_client, options: options
1123
1152
  yield response, operation if block_given?
1124
- return response
1153
+ throw :response, response
1125
1154
  end
1126
1155
  rescue ::GRPC::BadStatus => e
1127
1156
  raise ::Google::Cloud::Error.from_error(e)
@@ -1214,10 +1243,11 @@ module Google
1214
1243
  # Customize the options with defaults
1215
1244
  metadata = @config.rpcs.update_stream.metadata.to_h
1216
1245
 
1217
- # Set x-goog-api-client and x-goog-user-project headers
1246
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1218
1247
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1219
1248
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1220
1249
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1250
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1221
1251
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1222
1252
 
1223
1253
  header_params = {}
@@ -1239,7 +1269,7 @@ module Google
1239
1269
  @datastream_stub.call_rpc :update_stream, request, options: options do |response, operation|
1240
1270
  response = ::Gapic::Operation.new response, @operations_client, options: options
1241
1271
  yield response, operation if block_given?
1242
- return response
1272
+ throw :response, response
1243
1273
  end
1244
1274
  rescue ::GRPC::BadStatus => e
1245
1275
  raise ::Google::Cloud::Error.from_error(e)
@@ -1321,10 +1351,11 @@ module Google
1321
1351
  # Customize the options with defaults
1322
1352
  metadata = @config.rpcs.delete_stream.metadata.to_h
1323
1353
 
1324
- # Set x-goog-api-client and x-goog-user-project headers
1354
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1325
1355
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1326
1356
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1327
1357
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1358
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1328
1359
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1329
1360
 
1330
1361
  header_params = {}
@@ -1346,7 +1377,7 @@ module Google
1346
1377
  @datastream_stub.call_rpc :delete_stream, request, options: options do |response, operation|
1347
1378
  response = ::Gapic::Operation.new response, @operations_client, options: options
1348
1379
  yield response, operation if block_given?
1349
- return response
1380
+ throw :response, response
1350
1381
  end
1351
1382
  rescue ::GRPC::BadStatus => e
1352
1383
  raise ::Google::Cloud::Error.from_error(e)
@@ -1414,10 +1445,11 @@ module Google
1414
1445
  # Customize the options with defaults
1415
1446
  metadata = @config.rpcs.fetch_errors.metadata.to_h
1416
1447
 
1417
- # Set x-goog-api-client and x-goog-user-project headers
1448
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1418
1449
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1419
1450
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1420
1451
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1452
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1421
1453
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1422
1454
 
1423
1455
  header_params = {}
@@ -1439,7 +1471,7 @@ module Google
1439
1471
  @datastream_stub.call_rpc :fetch_errors, request, options: options do |response, operation|
1440
1472
  response = ::Gapic::Operation.new response, @operations_client, options: options
1441
1473
  yield response, operation if block_given?
1442
- return response
1474
+ throw :response, response
1443
1475
  end
1444
1476
  rescue ::GRPC::BadStatus => e
1445
1477
  raise ::Google::Cloud::Error.from_error(e)
@@ -1508,10 +1540,11 @@ module Google
1508
1540
  # Customize the options with defaults
1509
1541
  metadata = @config.rpcs.fetch_static_ips.metadata.to_h
1510
1542
 
1511
- # Set x-goog-api-client and x-goog-user-project headers
1543
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1512
1544
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1513
1545
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1514
1546
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1547
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1515
1548
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1516
1549
 
1517
1550
  header_params = {}
@@ -1532,7 +1565,6 @@ module Google
1532
1565
 
1533
1566
  @datastream_stub.call_rpc :fetch_static_ips, request, options: options do |response, operation|
1534
1567
  yield response, operation if block_given?
1535
- return response
1536
1568
  end
1537
1569
  rescue ::GRPC::BadStatus => e
1538
1570
  raise ::Google::Cloud::Error.from_error(e)
@@ -1618,10 +1650,11 @@ module Google
1618
1650
  # Customize the options with defaults
1619
1651
  metadata = @config.rpcs.create_private_connection.metadata.to_h
1620
1652
 
1621
- # Set x-goog-api-client and x-goog-user-project headers
1653
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1622
1654
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1623
1655
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1624
1656
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1657
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1625
1658
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1626
1659
 
1627
1660
  header_params = {}
@@ -1643,7 +1676,7 @@ module Google
1643
1676
  @datastream_stub.call_rpc :create_private_connection, request, options: options do |response, operation|
1644
1677
  response = ::Gapic::Operation.new response, @operations_client, options: options
1645
1678
  yield response, operation if block_given?
1646
- return response
1679
+ throw :response, response
1647
1680
  end
1648
1681
  rescue ::GRPC::BadStatus => e
1649
1682
  raise ::Google::Cloud::Error.from_error(e)
@@ -1704,10 +1737,11 @@ module Google
1704
1737
  # Customize the options with defaults
1705
1738
  metadata = @config.rpcs.get_private_connection.metadata.to_h
1706
1739
 
1707
- # Set x-goog-api-client and x-goog-user-project headers
1740
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1708
1741
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1709
1742
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1710
1743
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1744
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1711
1745
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1712
1746
 
1713
1747
  header_params = {}
@@ -1728,7 +1762,6 @@ module Google
1728
1762
 
1729
1763
  @datastream_stub.call_rpc :get_private_connection, request, options: options do |response, operation|
1730
1764
  yield response, operation if block_given?
1731
- return response
1732
1765
  end
1733
1766
  rescue ::GRPC::BadStatus => e
1734
1767
  raise ::Google::Cloud::Error.from_error(e)
@@ -1810,10 +1843,11 @@ module Google
1810
1843
  # Customize the options with defaults
1811
1844
  metadata = @config.rpcs.list_private_connections.metadata.to_h
1812
1845
 
1813
- # Set x-goog-api-client and x-goog-user-project headers
1846
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1814
1847
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1815
1848
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1816
1849
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1850
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1817
1851
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1818
1852
 
1819
1853
  header_params = {}
@@ -1835,7 +1869,7 @@ module Google
1835
1869
  @datastream_stub.call_rpc :list_private_connections, request, options: options do |response, operation|
1836
1870
  response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_private_connections, request, response, operation, options
1837
1871
  yield response, operation if block_given?
1838
- return response
1872
+ throw :response, response
1839
1873
  end
1840
1874
  rescue ::GRPC::BadStatus => e
1841
1875
  raise ::Google::Cloud::Error.from_error(e)
@@ -1920,10 +1954,11 @@ module Google
1920
1954
  # Customize the options with defaults
1921
1955
  metadata = @config.rpcs.delete_private_connection.metadata.to_h
1922
1956
 
1923
- # Set x-goog-api-client and x-goog-user-project headers
1957
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1924
1958
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1925
1959
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1926
1960
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1961
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1927
1962
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1928
1963
 
1929
1964
  header_params = {}
@@ -1945,7 +1980,7 @@ module Google
1945
1980
  @datastream_stub.call_rpc :delete_private_connection, request, options: options do |response, operation|
1946
1981
  response = ::Gapic::Operation.new response, @operations_client, options: options
1947
1982
  yield response, operation if block_given?
1948
- return response
1983
+ throw :response, response
1949
1984
  end
1950
1985
  rescue ::GRPC::BadStatus => e
1951
1986
  raise ::Google::Cloud::Error.from_error(e)
@@ -2032,10 +2067,11 @@ module Google
2032
2067
  # Customize the options with defaults
2033
2068
  metadata = @config.rpcs.create_route.metadata.to_h
2034
2069
 
2035
- # Set x-goog-api-client and x-goog-user-project headers
2070
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2036
2071
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2037
2072
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2038
2073
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
2074
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2039
2075
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2040
2076
 
2041
2077
  header_params = {}
@@ -2057,7 +2093,7 @@ module Google
2057
2093
  @datastream_stub.call_rpc :create_route, request, options: options do |response, operation|
2058
2094
  response = ::Gapic::Operation.new response, @operations_client, options: options
2059
2095
  yield response, operation if block_given?
2060
- return response
2096
+ throw :response, response
2061
2097
  end
2062
2098
  rescue ::GRPC::BadStatus => e
2063
2099
  raise ::Google::Cloud::Error.from_error(e)
@@ -2118,10 +2154,11 @@ module Google
2118
2154
  # Customize the options with defaults
2119
2155
  metadata = @config.rpcs.get_route.metadata.to_h
2120
2156
 
2121
- # Set x-goog-api-client and x-goog-user-project headers
2157
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2122
2158
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2123
2159
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2124
2160
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
2161
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2125
2162
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2126
2163
 
2127
2164
  header_params = {}
@@ -2142,7 +2179,6 @@ module Google
2142
2179
 
2143
2180
  @datastream_stub.call_rpc :get_route, request, options: options do |response, operation|
2144
2181
  yield response, operation if block_given?
2145
- return response
2146
2182
  end
2147
2183
  rescue ::GRPC::BadStatus => e
2148
2184
  raise ::Google::Cloud::Error.from_error(e)
@@ -2224,10 +2260,11 @@ module Google
2224
2260
  # Customize the options with defaults
2225
2261
  metadata = @config.rpcs.list_routes.metadata.to_h
2226
2262
 
2227
- # Set x-goog-api-client and x-goog-user-project headers
2263
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2228
2264
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2229
2265
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2230
2266
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
2267
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2231
2268
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2232
2269
 
2233
2270
  header_params = {}
@@ -2249,7 +2286,7 @@ module Google
2249
2286
  @datastream_stub.call_rpc :list_routes, request, options: options do |response, operation|
2250
2287
  response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_routes, request, response, operation, options
2251
2288
  yield response, operation if block_given?
2252
- return response
2289
+ throw :response, response
2253
2290
  end
2254
2291
  rescue ::GRPC::BadStatus => e
2255
2292
  raise ::Google::Cloud::Error.from_error(e)
@@ -2331,10 +2368,11 @@ module Google
2331
2368
  # Customize the options with defaults
2332
2369
  metadata = @config.rpcs.delete_route.metadata.to_h
2333
2370
 
2334
- # Set x-goog-api-client and x-goog-user-project headers
2371
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2335
2372
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2336
2373
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2337
2374
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
2375
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2338
2376
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2339
2377
 
2340
2378
  header_params = {}
@@ -2356,7 +2394,7 @@ module Google
2356
2394
  @datastream_stub.call_rpc :delete_route, request, options: options do |response, operation|
2357
2395
  response = ::Gapic::Operation.new response, @operations_client, options: options
2358
2396
  yield response, operation if block_given?
2359
- return response
2397
+ throw :response, response
2360
2398
  end
2361
2399
  rescue ::GRPC::BadStatus => e
2362
2400
  raise ::Google::Cloud::Error.from_error(e)
@@ -2445,6 +2483,11 @@ module Google
2445
2483
  # default endpoint URL. The default value of nil uses the environment
2446
2484
  # universe (usually the default "googleapis.com" universe).
2447
2485
  # @return [::String,nil]
2486
+ # @!attribute [rw] logger
2487
+ # A custom logger to use for request/response debug logging, or the value
2488
+ # `:default` (the default) to construct a default logger, or `nil` to
2489
+ # explicitly disable logging.
2490
+ # @return [::Logger,:default,nil]
2448
2491
  #
2449
2492
  class Configuration
2450
2493
  extend ::Gapic::Config
@@ -2469,6 +2512,7 @@ module Google
2469
2512
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2470
2513
  config_attr :quota_project, nil, ::String, nil
2471
2514
  config_attr :universe_domain, nil, ::String, nil
2515
+ config_attr :logger, :default, ::Logger, nil, :default
2472
2516
 
2473
2517
  # @private
2474
2518
  def initialize parent_config = nil