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.
@@ -32,6 +32,9 @@ module Google
32
32
  # Datastream service
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "datastream.$UNIVERSE_DOMAIN$"
37
40
 
@@ -179,8 +182,19 @@ module Google
179
182
  endpoint: @config.endpoint,
180
183
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
181
184
  universe_domain: @config.universe_domain,
182
- credentials: credentials
185
+ credentials: credentials,
186
+ logger: @config.logger
183
187
  )
188
+
189
+ @datastream_stub.logger(stub: true)&.info do |entry|
190
+ entry.set_system_name
191
+ entry.set_service
192
+ entry.message = "Created client for #{entry.service}"
193
+ entry.set_credentials_fields credentials
194
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
195
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
196
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
197
+ end
184
198
  end
185
199
 
186
200
  ##
@@ -190,6 +204,15 @@ module Google
190
204
  #
191
205
  attr_reader :operations_client
192
206
 
207
+ ##
208
+ # The logger used for request/response debug logging.
209
+ #
210
+ # @return [Logger]
211
+ #
212
+ def logger
213
+ @datastream_stub.logger
214
+ end
215
+
193
216
  # Service calls
194
217
 
195
218
  ##
@@ -265,12 +288,13 @@ module Google
265
288
  # Customize the options with defaults
266
289
  call_metadata = @config.rpcs.list_connection_profiles.metadata.to_h
267
290
 
268
- # Set x-goog-api-client and x-goog-user-project headers
291
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
269
292
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
270
293
  lib_name: @config.lib_name, lib_version: @config.lib_version,
271
294
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
272
295
  transports_version_send: [:rest]
273
296
 
297
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
274
298
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
275
299
 
276
300
  options.apply_defaults timeout: @config.rpcs.list_connection_profiles.timeout,
@@ -283,7 +307,6 @@ module Google
283
307
 
284
308
  @datastream_stub.list_connection_profiles request, options do |result, operation|
285
309
  yield result, operation if block_given?
286
- return result
287
310
  end
288
311
  rescue ::Gapic::Rest::Error => e
289
312
  raise ::Google::Cloud::Error.from_error(e)
@@ -343,12 +366,13 @@ module Google
343
366
  # Customize the options with defaults
344
367
  call_metadata = @config.rpcs.get_connection_profile.metadata.to_h
345
368
 
346
- # Set x-goog-api-client and x-goog-user-project headers
369
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
347
370
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
348
371
  lib_name: @config.lib_name, lib_version: @config.lib_version,
349
372
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
350
373
  transports_version_send: [:rest]
351
374
 
375
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
352
376
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
377
 
354
378
  options.apply_defaults timeout: @config.rpcs.get_connection_profile.timeout,
@@ -361,7 +385,6 @@ module Google
361
385
 
362
386
  @datastream_stub.get_connection_profile request, options do |result, operation|
363
387
  yield result, operation if block_given?
364
- return result
365
388
  end
366
389
  rescue ::Gapic::Rest::Error => e
367
390
  raise ::Google::Cloud::Error.from_error(e)
@@ -446,12 +469,13 @@ module Google
446
469
  # Customize the options with defaults
447
470
  call_metadata = @config.rpcs.create_connection_profile.metadata.to_h
448
471
 
449
- # Set x-goog-api-client and x-goog-user-project headers
472
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
450
473
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
451
474
  lib_name: @config.lib_name, lib_version: @config.lib_version,
452
475
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
453
476
  transports_version_send: [:rest]
454
477
 
478
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
455
479
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
456
480
 
457
481
  options.apply_defaults timeout: @config.rpcs.create_connection_profile.timeout,
@@ -465,7 +489,7 @@ module Google
465
489
  @datastream_stub.create_connection_profile request, options do |result, operation|
466
490
  result = ::Gapic::Operation.new result, @operations_client, options: options
467
491
  yield result, operation if block_given?
468
- return result
492
+ throw :response, result
469
493
  end
470
494
  rescue ::Gapic::Rest::Error => e
471
495
  raise ::Google::Cloud::Error.from_error(e)
@@ -552,12 +576,13 @@ module Google
552
576
  # Customize the options with defaults
553
577
  call_metadata = @config.rpcs.update_connection_profile.metadata.to_h
554
578
 
555
- # Set x-goog-api-client and x-goog-user-project headers
579
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
556
580
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
557
581
  lib_name: @config.lib_name, lib_version: @config.lib_version,
558
582
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
559
583
  transports_version_send: [:rest]
560
584
 
585
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
561
586
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
562
587
 
563
588
  options.apply_defaults timeout: @config.rpcs.update_connection_profile.timeout,
@@ -571,7 +596,7 @@ module Google
571
596
  @datastream_stub.update_connection_profile request, options do |result, operation|
572
597
  result = ::Gapic::Operation.new result, @operations_client, options: options
573
598
  yield result, operation if block_given?
574
- return result
599
+ throw :response, result
575
600
  end
576
601
  rescue ::Gapic::Rest::Error => e
577
602
  raise ::Google::Cloud::Error.from_error(e)
@@ -652,12 +677,13 @@ module Google
652
677
  # Customize the options with defaults
653
678
  call_metadata = @config.rpcs.delete_connection_profile.metadata.to_h
654
679
 
655
- # Set x-goog-api-client and x-goog-user-project headers
680
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
656
681
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
657
682
  lib_name: @config.lib_name, lib_version: @config.lib_version,
658
683
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
659
684
  transports_version_send: [:rest]
660
685
 
686
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
661
687
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
662
688
 
663
689
  options.apply_defaults timeout: @config.rpcs.delete_connection_profile.timeout,
@@ -671,7 +697,7 @@ module Google
671
697
  @datastream_stub.delete_connection_profile request, options do |result, operation|
672
698
  result = ::Gapic::Operation.new result, @operations_client, options: options
673
699
  yield result, operation if block_given?
674
- return result
700
+ throw :response, result
675
701
  end
676
702
  rescue ::Gapic::Rest::Error => e
677
703
  raise ::Google::Cloud::Error.from_error(e)
@@ -748,12 +774,13 @@ module Google
748
774
  # Customize the options with defaults
749
775
  call_metadata = @config.rpcs.discover_connection_profile.metadata.to_h
750
776
 
751
- # Set x-goog-api-client and x-goog-user-project headers
777
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
752
778
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
753
779
  lib_name: @config.lib_name, lib_version: @config.lib_version,
754
780
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
755
781
  transports_version_send: [:rest]
756
782
 
783
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
757
784
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
758
785
 
759
786
  options.apply_defaults timeout: @config.rpcs.discover_connection_profile.timeout,
@@ -766,7 +793,6 @@ module Google
766
793
 
767
794
  @datastream_stub.discover_connection_profile request, options do |result, operation|
768
795
  yield result, operation if block_given?
769
- return result
770
796
  end
771
797
  rescue ::Gapic::Rest::Error => e
772
798
  raise ::Google::Cloud::Error.from_error(e)
@@ -844,12 +870,13 @@ module Google
844
870
  # Customize the options with defaults
845
871
  call_metadata = @config.rpcs.list_streams.metadata.to_h
846
872
 
847
- # Set x-goog-api-client and x-goog-user-project headers
873
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
848
874
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
849
875
  lib_name: @config.lib_name, lib_version: @config.lib_version,
850
876
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
851
877
  transports_version_send: [:rest]
852
878
 
879
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
853
880
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
854
881
 
855
882
  options.apply_defaults timeout: @config.rpcs.list_streams.timeout,
@@ -862,7 +889,6 @@ module Google
862
889
 
863
890
  @datastream_stub.list_streams request, options do |result, operation|
864
891
  yield result, operation if block_given?
865
- return result
866
892
  end
867
893
  rescue ::Gapic::Rest::Error => e
868
894
  raise ::Google::Cloud::Error.from_error(e)
@@ -922,12 +948,13 @@ module Google
922
948
  # Customize the options with defaults
923
949
  call_metadata = @config.rpcs.get_stream.metadata.to_h
924
950
 
925
- # Set x-goog-api-client and x-goog-user-project headers
951
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
926
952
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
927
953
  lib_name: @config.lib_name, lib_version: @config.lib_version,
928
954
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
929
955
  transports_version_send: [:rest]
930
956
 
957
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
931
958
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
932
959
 
933
960
  options.apply_defaults timeout: @config.rpcs.get_stream.timeout,
@@ -940,7 +967,6 @@ module Google
940
967
 
941
968
  @datastream_stub.get_stream request, options do |result, operation|
942
969
  yield result, operation if block_given?
943
- return result
944
970
  end
945
971
  rescue ::Gapic::Rest::Error => e
946
972
  raise ::Google::Cloud::Error.from_error(e)
@@ -1030,12 +1056,13 @@ module Google
1030
1056
  # Customize the options with defaults
1031
1057
  call_metadata = @config.rpcs.create_stream.metadata.to_h
1032
1058
 
1033
- # Set x-goog-api-client and x-goog-user-project headers
1059
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1034
1060
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1035
1061
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1036
1062
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1037
1063
  transports_version_send: [:rest]
1038
1064
 
1065
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1039
1066
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1040
1067
 
1041
1068
  options.apply_defaults timeout: @config.rpcs.create_stream.timeout,
@@ -1049,7 +1076,7 @@ module Google
1049
1076
  @datastream_stub.create_stream request, options do |result, operation|
1050
1077
  result = ::Gapic::Operation.new result, @operations_client, options: options
1051
1078
  yield result, operation if block_given?
1052
- return result
1079
+ throw :response, result
1053
1080
  end
1054
1081
  rescue ::Gapic::Rest::Error => e
1055
1082
  raise ::Google::Cloud::Error.from_error(e)
@@ -1141,12 +1168,13 @@ module Google
1141
1168
  # Customize the options with defaults
1142
1169
  call_metadata = @config.rpcs.update_stream.metadata.to_h
1143
1170
 
1144
- # Set x-goog-api-client and x-goog-user-project headers
1171
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1145
1172
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1146
1173
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1147
1174
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1148
1175
  transports_version_send: [:rest]
1149
1176
 
1177
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1150
1178
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1151
1179
 
1152
1180
  options.apply_defaults timeout: @config.rpcs.update_stream.timeout,
@@ -1160,7 +1188,7 @@ module Google
1160
1188
  @datastream_stub.update_stream request, options do |result, operation|
1161
1189
  result = ::Gapic::Operation.new result, @operations_client, options: options
1162
1190
  yield result, operation if block_given?
1163
- return result
1191
+ throw :response, result
1164
1192
  end
1165
1193
  rescue ::Gapic::Rest::Error => e
1166
1194
  raise ::Google::Cloud::Error.from_error(e)
@@ -1241,12 +1269,13 @@ module Google
1241
1269
  # Customize the options with defaults
1242
1270
  call_metadata = @config.rpcs.delete_stream.metadata.to_h
1243
1271
 
1244
- # Set x-goog-api-client and x-goog-user-project headers
1272
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1245
1273
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1246
1274
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1247
1275
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1248
1276
  transports_version_send: [:rest]
1249
1277
 
1278
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1250
1279
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1251
1280
 
1252
1281
  options.apply_defaults timeout: @config.rpcs.delete_stream.timeout,
@@ -1260,7 +1289,7 @@ module Google
1260
1289
  @datastream_stub.delete_stream request, options do |result, operation|
1261
1290
  result = ::Gapic::Operation.new result, @operations_client, options: options
1262
1291
  yield result, operation if block_given?
1263
- return result
1292
+ throw :response, result
1264
1293
  end
1265
1294
  rescue ::Gapic::Rest::Error => e
1266
1295
  raise ::Google::Cloud::Error.from_error(e)
@@ -1327,12 +1356,13 @@ module Google
1327
1356
  # Customize the options with defaults
1328
1357
  call_metadata = @config.rpcs.fetch_errors.metadata.to_h
1329
1358
 
1330
- # Set x-goog-api-client and x-goog-user-project headers
1359
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1331
1360
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1332
1361
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1333
1362
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1334
1363
  transports_version_send: [:rest]
1335
1364
 
1365
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1336
1366
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1337
1367
 
1338
1368
  options.apply_defaults timeout: @config.rpcs.fetch_errors.timeout,
@@ -1346,7 +1376,7 @@ module Google
1346
1376
  @datastream_stub.fetch_errors request, options do |result, operation|
1347
1377
  result = ::Gapic::Operation.new result, @operations_client, options: options
1348
1378
  yield result, operation if block_given?
1349
- return result
1379
+ throw :response, result
1350
1380
  end
1351
1381
  rescue ::Gapic::Rest::Error => e
1352
1382
  raise ::Google::Cloud::Error.from_error(e)
@@ -1414,12 +1444,13 @@ module Google
1414
1444
  # Customize the options with defaults
1415
1445
  call_metadata = @config.rpcs.fetch_static_ips.metadata.to_h
1416
1446
 
1417
- # Set x-goog-api-client and x-goog-user-project headers
1447
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1418
1448
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1419
1449
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1420
1450
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1421
1451
  transports_version_send: [:rest]
1422
1452
 
1453
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1423
1454
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1424
1455
 
1425
1456
  options.apply_defaults timeout: @config.rpcs.fetch_static_ips.timeout,
@@ -1433,7 +1464,7 @@ module Google
1433
1464
  @datastream_stub.fetch_static_ips request, options do |result, operation|
1434
1465
  result = ::Gapic::Rest::PagedEnumerable.new @datastream_stub, :fetch_static_ips, "static_ips", request, result, options
1435
1466
  yield result, operation if block_given?
1436
- return result
1467
+ throw :response, result
1437
1468
  end
1438
1469
  rescue ::Gapic::Rest::Error => e
1439
1470
  raise ::Google::Cloud::Error.from_error(e)
@@ -1518,12 +1549,13 @@ module Google
1518
1549
  # Customize the options with defaults
1519
1550
  call_metadata = @config.rpcs.create_private_connection.metadata.to_h
1520
1551
 
1521
- # Set x-goog-api-client and x-goog-user-project headers
1552
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1522
1553
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1523
1554
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1524
1555
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1525
1556
  transports_version_send: [:rest]
1526
1557
 
1558
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1527
1559
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1528
1560
 
1529
1561
  options.apply_defaults timeout: @config.rpcs.create_private_connection.timeout,
@@ -1537,7 +1569,7 @@ module Google
1537
1569
  @datastream_stub.create_private_connection request, options do |result, operation|
1538
1570
  result = ::Gapic::Operation.new result, @operations_client, options: options
1539
1571
  yield result, operation if block_given?
1540
- return result
1572
+ throw :response, result
1541
1573
  end
1542
1574
  rescue ::Gapic::Rest::Error => e
1543
1575
  raise ::Google::Cloud::Error.from_error(e)
@@ -1597,12 +1629,13 @@ module Google
1597
1629
  # Customize the options with defaults
1598
1630
  call_metadata = @config.rpcs.get_private_connection.metadata.to_h
1599
1631
 
1600
- # Set x-goog-api-client and x-goog-user-project headers
1632
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1601
1633
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1602
1634
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1603
1635
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1604
1636
  transports_version_send: [:rest]
1605
1637
 
1638
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1606
1639
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1607
1640
 
1608
1641
  options.apply_defaults timeout: @config.rpcs.get_private_connection.timeout,
@@ -1615,7 +1648,6 @@ module Google
1615
1648
 
1616
1649
  @datastream_stub.get_private_connection request, options do |result, operation|
1617
1650
  yield result, operation if block_given?
1618
- return result
1619
1651
  end
1620
1652
  rescue ::Gapic::Rest::Error => e
1621
1653
  raise ::Google::Cloud::Error.from_error(e)
@@ -1696,12 +1728,13 @@ module Google
1696
1728
  # Customize the options with defaults
1697
1729
  call_metadata = @config.rpcs.list_private_connections.metadata.to_h
1698
1730
 
1699
- # Set x-goog-api-client and x-goog-user-project headers
1731
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1700
1732
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1701
1733
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1702
1734
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1703
1735
  transports_version_send: [:rest]
1704
1736
 
1737
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1705
1738
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1706
1739
 
1707
1740
  options.apply_defaults timeout: @config.rpcs.list_private_connections.timeout,
@@ -1714,7 +1747,6 @@ module Google
1714
1747
 
1715
1748
  @datastream_stub.list_private_connections request, options do |result, operation|
1716
1749
  yield result, operation if block_given?
1717
- return result
1718
1750
  end
1719
1751
  rescue ::Gapic::Rest::Error => e
1720
1752
  raise ::Google::Cloud::Error.from_error(e)
@@ -1798,12 +1830,13 @@ module Google
1798
1830
  # Customize the options with defaults
1799
1831
  call_metadata = @config.rpcs.delete_private_connection.metadata.to_h
1800
1832
 
1801
- # Set x-goog-api-client and x-goog-user-project headers
1833
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1802
1834
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1803
1835
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1804
1836
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1805
1837
  transports_version_send: [:rest]
1806
1838
 
1839
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1807
1840
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1808
1841
 
1809
1842
  options.apply_defaults timeout: @config.rpcs.delete_private_connection.timeout,
@@ -1817,7 +1850,7 @@ module Google
1817
1850
  @datastream_stub.delete_private_connection request, options do |result, operation|
1818
1851
  result = ::Gapic::Operation.new result, @operations_client, options: options
1819
1852
  yield result, operation if block_given?
1820
- return result
1853
+ throw :response, result
1821
1854
  end
1822
1855
  rescue ::Gapic::Rest::Error => e
1823
1856
  raise ::Google::Cloud::Error.from_error(e)
@@ -1903,12 +1936,13 @@ module Google
1903
1936
  # Customize the options with defaults
1904
1937
  call_metadata = @config.rpcs.create_route.metadata.to_h
1905
1938
 
1906
- # Set x-goog-api-client and x-goog-user-project headers
1939
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1907
1940
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1908
1941
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1909
1942
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1910
1943
  transports_version_send: [:rest]
1911
1944
 
1945
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1912
1946
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1913
1947
 
1914
1948
  options.apply_defaults timeout: @config.rpcs.create_route.timeout,
@@ -1922,7 +1956,7 @@ module Google
1922
1956
  @datastream_stub.create_route request, options do |result, operation|
1923
1957
  result = ::Gapic::Operation.new result, @operations_client, options: options
1924
1958
  yield result, operation if block_given?
1925
- return result
1959
+ throw :response, result
1926
1960
  end
1927
1961
  rescue ::Gapic::Rest::Error => e
1928
1962
  raise ::Google::Cloud::Error.from_error(e)
@@ -1982,12 +2016,13 @@ module Google
1982
2016
  # Customize the options with defaults
1983
2017
  call_metadata = @config.rpcs.get_route.metadata.to_h
1984
2018
 
1985
- # Set x-goog-api-client and x-goog-user-project headers
2019
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1986
2020
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1987
2021
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1988
2022
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
1989
2023
  transports_version_send: [:rest]
1990
2024
 
2025
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1991
2026
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1992
2027
 
1993
2028
  options.apply_defaults timeout: @config.rpcs.get_route.timeout,
@@ -2000,7 +2035,6 @@ module Google
2000
2035
 
2001
2036
  @datastream_stub.get_route request, options do |result, operation|
2002
2037
  yield result, operation if block_given?
2003
- return result
2004
2038
  end
2005
2039
  rescue ::Gapic::Rest::Error => e
2006
2040
  raise ::Google::Cloud::Error.from_error(e)
@@ -2081,12 +2115,13 @@ module Google
2081
2115
  # Customize the options with defaults
2082
2116
  call_metadata = @config.rpcs.list_routes.metadata.to_h
2083
2117
 
2084
- # Set x-goog-api-client and x-goog-user-project headers
2118
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2085
2119
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2086
2120
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2087
2121
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
2088
2122
  transports_version_send: [:rest]
2089
2123
 
2124
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2090
2125
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2091
2126
 
2092
2127
  options.apply_defaults timeout: @config.rpcs.list_routes.timeout,
@@ -2099,7 +2134,6 @@ module Google
2099
2134
 
2100
2135
  @datastream_stub.list_routes request, options do |result, operation|
2101
2136
  yield result, operation if block_given?
2102
- return result
2103
2137
  end
2104
2138
  rescue ::Gapic::Rest::Error => e
2105
2139
  raise ::Google::Cloud::Error.from_error(e)
@@ -2180,12 +2214,13 @@ module Google
2180
2214
  # Customize the options with defaults
2181
2215
  call_metadata = @config.rpcs.delete_route.metadata.to_h
2182
2216
 
2183
- # Set x-goog-api-client and x-goog-user-project headers
2217
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2184
2218
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2185
2219
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2186
2220
  gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION,
2187
2221
  transports_version_send: [:rest]
2188
2222
 
2223
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2189
2224
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2190
2225
 
2191
2226
  options.apply_defaults timeout: @config.rpcs.delete_route.timeout,
@@ -2199,7 +2234,7 @@ module Google
2199
2234
  @datastream_stub.delete_route request, options do |result, operation|
2200
2235
  result = ::Gapic::Operation.new result, @operations_client, options: options
2201
2236
  yield result, operation if block_given?
2202
- return result
2237
+ throw :response, result
2203
2238
  end
2204
2239
  rescue ::Gapic::Rest::Error => e
2205
2240
  raise ::Google::Cloud::Error.from_error(e)
@@ -2279,6 +2314,11 @@ module Google
2279
2314
  # default endpoint URL. The default value of nil uses the environment
2280
2315
  # universe (usually the default "googleapis.com" universe).
2281
2316
  # @return [::String,nil]
2317
+ # @!attribute [rw] logger
2318
+ # A custom logger to use for request/response debug logging, or the value
2319
+ # `:default` (the default) to construct a default logger, or `nil` to
2320
+ # explicitly disable logging.
2321
+ # @return [::Logger,:default,nil]
2282
2322
  #
2283
2323
  class Configuration
2284
2324
  extend ::Gapic::Config
@@ -2300,6 +2340,7 @@ module Google
2300
2340
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2301
2341
  config_attr :quota_project, nil, ::String, nil
2302
2342
  config_attr :universe_domain, nil, ::String, nil
2343
+ config_attr :logger, :default, ::Logger, nil, :default
2303
2344
 
2304
2345
  # @private
2305
2346
  def initialize parent_config = nil