google-cloud-tasks-v2beta2 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,9 @@ module Google
34
34
  # work in their applications.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
37
40
  # @private
38
41
  DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$"
39
42
 
@@ -213,15 +216,27 @@ module Google
213
216
  endpoint: @config.endpoint,
214
217
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
215
218
  universe_domain: @config.universe_domain,
216
- credentials: credentials
219
+ credentials: credentials,
220
+ logger: @config.logger
217
221
  )
218
222
 
223
+ @cloud_tasks_stub.logger(stub: true)&.info do |entry|
224
+ entry.set_system_name
225
+ entry.set_service
226
+ entry.message = "Created client for #{entry.service}"
227
+ entry.set_credentials_fields credentials
228
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
229
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
230
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
231
+ end
232
+
219
233
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
220
234
  config.credentials = credentials
221
235
  config.quota_project = @quota_project_id
222
236
  config.endpoint = @cloud_tasks_stub.endpoint
223
237
  config.universe_domain = @cloud_tasks_stub.universe_domain
224
238
  config.bindings_override = @config.bindings_override
239
+ config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger=
225
240
  end
226
241
  end
227
242
 
@@ -232,6 +247,15 @@ module Google
232
247
  #
233
248
  attr_reader :location_client
234
249
 
250
+ ##
251
+ # The logger used for request/response debug logging.
252
+ #
253
+ # @return [Logger]
254
+ #
255
+ def logger
256
+ @cloud_tasks_stub.logger
257
+ end
258
+
235
259
  # Service calls
236
260
 
237
261
  ##
@@ -330,12 +354,13 @@ module Google
330
354
  # Customize the options with defaults
331
355
  call_metadata = @config.rpcs.list_queues.metadata.to_h
332
356
 
333
- # Set x-goog-api-client and x-goog-user-project headers
357
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
334
358
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
335
359
  lib_name: @config.lib_name, lib_version: @config.lib_version,
336
360
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
337
361
  transports_version_send: [:rest]
338
362
 
363
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
339
364
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
340
365
 
341
366
  options.apply_defaults timeout: @config.rpcs.list_queues.timeout,
@@ -349,7 +374,7 @@ module Google
349
374
  @cloud_tasks_stub.list_queues request, options do |result, operation|
350
375
  result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options
351
376
  yield result, operation if block_given?
352
- return result
377
+ throw :response, result
353
378
  end
354
379
  rescue ::Gapic::Rest::Error => e
355
380
  raise ::Google::Cloud::Error.from_error(e)
@@ -415,12 +440,13 @@ module Google
415
440
  # Customize the options with defaults
416
441
  call_metadata = @config.rpcs.get_queue.metadata.to_h
417
442
 
418
- # Set x-goog-api-client and x-goog-user-project headers
443
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
419
444
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
420
445
  lib_name: @config.lib_name, lib_version: @config.lib_version,
421
446
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
422
447
  transports_version_send: [:rest]
423
448
 
449
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
424
450
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
425
451
 
426
452
  options.apply_defaults timeout: @config.rpcs.get_queue.timeout,
@@ -433,7 +459,6 @@ module Google
433
459
 
434
460
  @cloud_tasks_stub.get_queue request, options do |result, operation|
435
461
  yield result, operation if block_given?
436
- return result
437
462
  end
438
463
  rescue ::Gapic::Rest::Error => e
439
464
  raise ::Google::Cloud::Error.from_error(e)
@@ -514,12 +539,13 @@ module Google
514
539
  # Customize the options with defaults
515
540
  call_metadata = @config.rpcs.create_queue.metadata.to_h
516
541
 
517
- # Set x-goog-api-client and x-goog-user-project headers
542
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
518
543
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
519
544
  lib_name: @config.lib_name, lib_version: @config.lib_version,
520
545
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
521
546
  transports_version_send: [:rest]
522
547
 
548
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
523
549
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
524
550
 
525
551
  options.apply_defaults timeout: @config.rpcs.create_queue.timeout,
@@ -532,7 +558,6 @@ module Google
532
558
 
533
559
  @cloud_tasks_stub.create_queue request, options do |result, operation|
534
560
  yield result, operation if block_given?
535
- return result
536
561
  end
537
562
  rescue ::Gapic::Rest::Error => e
538
563
  raise ::Google::Cloud::Error.from_error(e)
@@ -618,12 +643,13 @@ module Google
618
643
  # Customize the options with defaults
619
644
  call_metadata = @config.rpcs.update_queue.metadata.to_h
620
645
 
621
- # Set x-goog-api-client and x-goog-user-project headers
646
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
622
647
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
623
648
  lib_name: @config.lib_name, lib_version: @config.lib_version,
624
649
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
625
650
  transports_version_send: [:rest]
626
651
 
652
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
627
653
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
628
654
 
629
655
  options.apply_defaults timeout: @config.rpcs.update_queue.timeout,
@@ -636,7 +662,6 @@ module Google
636
662
 
637
663
  @cloud_tasks_stub.update_queue request, options do |result, operation|
638
664
  yield result, operation if block_given?
639
- return result
640
665
  end
641
666
  rescue ::Gapic::Rest::Error => e
642
667
  raise ::Google::Cloud::Error.from_error(e)
@@ -709,12 +734,13 @@ module Google
709
734
  # Customize the options with defaults
710
735
  call_metadata = @config.rpcs.delete_queue.metadata.to_h
711
736
 
712
- # Set x-goog-api-client and x-goog-user-project headers
737
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
713
738
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
714
739
  lib_name: @config.lib_name, lib_version: @config.lib_version,
715
740
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
716
741
  transports_version_send: [:rest]
717
742
 
743
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
718
744
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
719
745
 
720
746
  options.apply_defaults timeout: @config.rpcs.delete_queue.timeout,
@@ -727,7 +753,6 @@ module Google
727
753
 
728
754
  @cloud_tasks_stub.delete_queue request, options do |result, operation|
729
755
  yield result, operation if block_given?
730
- return result
731
756
  end
732
757
  rescue ::Gapic::Rest::Error => e
733
758
  raise ::Google::Cloud::Error.from_error(e)
@@ -793,12 +818,13 @@ module Google
793
818
  # Customize the options with defaults
794
819
  call_metadata = @config.rpcs.purge_queue.metadata.to_h
795
820
 
796
- # Set x-goog-api-client and x-goog-user-project headers
821
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
797
822
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
798
823
  lib_name: @config.lib_name, lib_version: @config.lib_version,
799
824
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
800
825
  transports_version_send: [:rest]
801
826
 
827
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
802
828
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
803
829
 
804
830
  options.apply_defaults timeout: @config.rpcs.purge_queue.timeout,
@@ -811,7 +837,6 @@ module Google
811
837
 
812
838
  @cloud_tasks_stub.purge_queue request, options do |result, operation|
813
839
  yield result, operation if block_given?
814
- return result
815
840
  end
816
841
  rescue ::Gapic::Rest::Error => e
817
842
  raise ::Google::Cloud::Error.from_error(e)
@@ -879,12 +904,13 @@ module Google
879
904
  # Customize the options with defaults
880
905
  call_metadata = @config.rpcs.pause_queue.metadata.to_h
881
906
 
882
- # Set x-goog-api-client and x-goog-user-project headers
907
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
883
908
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
884
909
  lib_name: @config.lib_name, lib_version: @config.lib_version,
885
910
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
886
911
  transports_version_send: [:rest]
887
912
 
913
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
888
914
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
889
915
 
890
916
  options.apply_defaults timeout: @config.rpcs.pause_queue.timeout,
@@ -897,7 +923,6 @@ module Google
897
923
 
898
924
  @cloud_tasks_stub.pause_queue request, options do |result, operation|
899
925
  yield result, operation if block_given?
900
- return result
901
926
  end
902
927
  rescue ::Gapic::Rest::Error => e
903
928
  raise ::Google::Cloud::Error.from_error(e)
@@ -972,12 +997,13 @@ module Google
972
997
  # Customize the options with defaults
973
998
  call_metadata = @config.rpcs.resume_queue.metadata.to_h
974
999
 
975
- # Set x-goog-api-client and x-goog-user-project headers
1000
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
976
1001
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
977
1002
  lib_name: @config.lib_name, lib_version: @config.lib_version,
978
1003
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
979
1004
  transports_version_send: [:rest]
980
1005
 
1006
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
981
1007
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
982
1008
 
983
1009
  options.apply_defaults timeout: @config.rpcs.resume_queue.timeout,
@@ -990,7 +1016,6 @@ module Google
990
1016
 
991
1017
  @cloud_tasks_stub.resume_queue request, options do |result, operation|
992
1018
  yield result, operation if block_given?
993
- return result
994
1019
  end
995
1020
  rescue ::Gapic::Rest::Error => e
996
1021
  raise ::Google::Cloud::Error.from_error(e)
@@ -1062,12 +1087,13 @@ module Google
1062
1087
  # Customize the options with defaults
1063
1088
  call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
1064
1089
 
1065
- # Set x-goog-api-client and x-goog-user-project headers
1090
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1066
1091
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1067
1092
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1068
1093
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1069
1094
  transports_version_send: [:rest]
1070
1095
 
1096
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1071
1097
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1072
1098
 
1073
1099
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
@@ -1080,7 +1106,6 @@ module Google
1080
1106
 
1081
1107
  @cloud_tasks_stub.get_iam_policy request, options do |result, operation|
1082
1108
  yield result, operation if block_given?
1083
- return result
1084
1109
  end
1085
1110
  rescue ::Gapic::Rest::Error => e
1086
1111
  raise ::Google::Cloud::Error.from_error(e)
@@ -1162,12 +1187,13 @@ module Google
1162
1187
  # Customize the options with defaults
1163
1188
  call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1164
1189
 
1165
- # Set x-goog-api-client and x-goog-user-project headers
1190
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1166
1191
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1167
1192
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1168
1193
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1169
1194
  transports_version_send: [:rest]
1170
1195
 
1196
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1171
1197
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1172
1198
 
1173
1199
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
@@ -1180,7 +1206,6 @@ module Google
1180
1206
 
1181
1207
  @cloud_tasks_stub.set_iam_policy request, options do |result, operation|
1182
1208
  yield result, operation if block_given?
1183
- return result
1184
1209
  end
1185
1210
  rescue ::Gapic::Rest::Error => e
1186
1211
  raise ::Google::Cloud::Error.from_error(e)
@@ -1253,12 +1278,13 @@ module Google
1253
1278
  # Customize the options with defaults
1254
1279
  call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1255
1280
 
1256
- # Set x-goog-api-client and x-goog-user-project headers
1281
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1257
1282
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1258
1283
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1259
1284
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1260
1285
  transports_version_send: [:rest]
1261
1286
 
1287
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1262
1288
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1263
1289
 
1264
1290
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
@@ -1271,7 +1297,6 @@ module Google
1271
1297
 
1272
1298
  @cloud_tasks_stub.test_iam_permissions request, options do |result, operation|
1273
1299
  yield result, operation if block_given?
1274
- return result
1275
1300
  end
1276
1301
  rescue ::Gapic::Rest::Error => e
1277
1302
  raise ::Google::Cloud::Error.from_error(e)
@@ -1377,12 +1402,13 @@ module Google
1377
1402
  # Customize the options with defaults
1378
1403
  call_metadata = @config.rpcs.list_tasks.metadata.to_h
1379
1404
 
1380
- # Set x-goog-api-client and x-goog-user-project headers
1405
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1381
1406
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1382
1407
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1383
1408
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1384
1409
  transports_version_send: [:rest]
1385
1410
 
1411
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1386
1412
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1387
1413
 
1388
1414
  options.apply_defaults timeout: @config.rpcs.list_tasks.timeout,
@@ -1396,7 +1422,7 @@ module Google
1396
1422
  @cloud_tasks_stub.list_tasks request, options do |result, operation|
1397
1423
  result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options
1398
1424
  yield result, operation if block_given?
1399
- return result
1425
+ throw :response, result
1400
1426
  end
1401
1427
  rescue ::Gapic::Rest::Error => e
1402
1428
  raise ::Google::Cloud::Error.from_error(e)
@@ -1471,12 +1497,13 @@ module Google
1471
1497
  # Customize the options with defaults
1472
1498
  call_metadata = @config.rpcs.get_task.metadata.to_h
1473
1499
 
1474
- # Set x-goog-api-client and x-goog-user-project headers
1500
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1475
1501
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1476
1502
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1477
1503
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1478
1504
  transports_version_send: [:rest]
1479
1505
 
1506
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1480
1507
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1481
1508
 
1482
1509
  options.apply_defaults timeout: @config.rpcs.get_task.timeout,
@@ -1489,7 +1516,6 @@ module Google
1489
1516
 
1490
1517
  @cloud_tasks_stub.get_task request, options do |result, operation|
1491
1518
  yield result, operation if block_given?
1492
- return result
1493
1519
  end
1494
1520
  rescue ::Gapic::Rest::Error => e
1495
1521
  raise ::Google::Cloud::Error.from_error(e)
@@ -1608,12 +1634,13 @@ module Google
1608
1634
  # Customize the options with defaults
1609
1635
  call_metadata = @config.rpcs.create_task.metadata.to_h
1610
1636
 
1611
- # Set x-goog-api-client and x-goog-user-project headers
1637
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1612
1638
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1613
1639
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1614
1640
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1615
1641
  transports_version_send: [:rest]
1616
1642
 
1643
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1617
1644
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1618
1645
 
1619
1646
  options.apply_defaults timeout: @config.rpcs.create_task.timeout,
@@ -1626,7 +1653,6 @@ module Google
1626
1653
 
1627
1654
  @cloud_tasks_stub.create_task request, options do |result, operation|
1628
1655
  yield result, operation if block_given?
1629
- return result
1630
1656
  end
1631
1657
  rescue ::Gapic::Rest::Error => e
1632
1658
  raise ::Google::Cloud::Error.from_error(e)
@@ -1691,12 +1717,13 @@ module Google
1691
1717
  # Customize the options with defaults
1692
1718
  call_metadata = @config.rpcs.delete_task.metadata.to_h
1693
1719
 
1694
- # Set x-goog-api-client and x-goog-user-project headers
1720
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1695
1721
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1696
1722
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1697
1723
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1698
1724
  transports_version_send: [:rest]
1699
1725
 
1726
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1700
1727
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1701
1728
 
1702
1729
  options.apply_defaults timeout: @config.rpcs.delete_task.timeout,
@@ -1709,7 +1736,6 @@ module Google
1709
1736
 
1710
1737
  @cloud_tasks_stub.delete_task request, options do |result, operation|
1711
1738
  yield result, operation if block_given?
1712
- return result
1713
1739
  end
1714
1740
  rescue ::Gapic::Rest::Error => e
1715
1741
  raise ::Google::Cloud::Error.from_error(e)
@@ -1873,12 +1899,13 @@ module Google
1873
1899
  # Customize the options with defaults
1874
1900
  call_metadata = @config.rpcs.lease_tasks.metadata.to_h
1875
1901
 
1876
- # Set x-goog-api-client and x-goog-user-project headers
1902
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1877
1903
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1878
1904
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1879
1905
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1880
1906
  transports_version_send: [:rest]
1881
1907
 
1908
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1882
1909
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1883
1910
 
1884
1911
  options.apply_defaults timeout: @config.rpcs.lease_tasks.timeout,
@@ -1891,7 +1918,6 @@ module Google
1891
1918
 
1892
1919
  @cloud_tasks_stub.lease_tasks request, options do |result, operation|
1893
1920
  yield result, operation if block_given?
1894
- return result
1895
1921
  end
1896
1922
  rescue ::Gapic::Rest::Error => e
1897
1923
  raise ::Google::Cloud::Error.from_error(e)
@@ -1971,12 +1997,13 @@ module Google
1971
1997
  # Customize the options with defaults
1972
1998
  call_metadata = @config.rpcs.acknowledge_task.metadata.to_h
1973
1999
 
1974
- # Set x-goog-api-client and x-goog-user-project headers
2000
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1975
2001
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1976
2002
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1977
2003
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
1978
2004
  transports_version_send: [:rest]
1979
2005
 
2006
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1980
2007
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1981
2008
 
1982
2009
  options.apply_defaults timeout: @config.rpcs.acknowledge_task.timeout,
@@ -1989,7 +2016,6 @@ module Google
1989
2016
 
1990
2017
  @cloud_tasks_stub.acknowledge_task request, options do |result, operation|
1991
2018
  yield result, operation if block_given?
1992
- return result
1993
2019
  end
1994
2020
  rescue ::Gapic::Rest::Error => e
1995
2021
  raise ::Google::Cloud::Error.from_error(e)
@@ -2081,12 +2107,13 @@ module Google
2081
2107
  # Customize the options with defaults
2082
2108
  call_metadata = @config.rpcs.renew_lease.metadata.to_h
2083
2109
 
2084
- # Set x-goog-api-client and x-goog-user-project headers
2110
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2085
2111
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2086
2112
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2087
2113
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
2088
2114
  transports_version_send: [:rest]
2089
2115
 
2116
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2090
2117
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2091
2118
 
2092
2119
  options.apply_defaults timeout: @config.rpcs.renew_lease.timeout,
@@ -2099,7 +2126,6 @@ module Google
2099
2126
 
2100
2127
  @cloud_tasks_stub.renew_lease request, options do |result, operation|
2101
2128
  yield result, operation if block_given?
2102
- return result
2103
2129
  end
2104
2130
  rescue ::Gapic::Rest::Error => e
2105
2131
  raise ::Google::Cloud::Error.from_error(e)
@@ -2185,12 +2211,13 @@ module Google
2185
2211
  # Customize the options with defaults
2186
2212
  call_metadata = @config.rpcs.cancel_lease.metadata.to_h
2187
2213
 
2188
- # Set x-goog-api-client and x-goog-user-project headers
2214
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2189
2215
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2190
2216
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2191
2217
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
2192
2218
  transports_version_send: [:rest]
2193
2219
 
2220
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2194
2221
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2195
2222
 
2196
2223
  options.apply_defaults timeout: @config.rpcs.cancel_lease.timeout,
@@ -2203,7 +2230,6 @@ module Google
2203
2230
 
2204
2231
  @cloud_tasks_stub.cancel_lease request, options do |result, operation|
2205
2232
  yield result, operation if block_given?
2206
- return result
2207
2233
  end
2208
2234
  rescue ::Gapic::Rest::Error => e
2209
2235
  raise ::Google::Cloud::Error.from_error(e)
@@ -2307,12 +2333,13 @@ module Google
2307
2333
  # Customize the options with defaults
2308
2334
  call_metadata = @config.rpcs.run_task.metadata.to_h
2309
2335
 
2310
- # Set x-goog-api-client and x-goog-user-project headers
2336
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2311
2337
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2312
2338
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2313
2339
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION,
2314
2340
  transports_version_send: [:rest]
2315
2341
 
2342
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2316
2343
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2317
2344
 
2318
2345
  options.apply_defaults timeout: @config.rpcs.run_task.timeout,
@@ -2325,7 +2352,6 @@ module Google
2325
2352
 
2326
2353
  @cloud_tasks_stub.run_task request, options do |result, operation|
2327
2354
  yield result, operation if block_given?
2328
- return result
2329
2355
  end
2330
2356
  rescue ::Gapic::Rest::Error => e
2331
2357
  raise ::Google::Cloud::Error.from_error(e)
@@ -2405,6 +2431,11 @@ module Google
2405
2431
  # default endpoint URL. The default value of nil uses the environment
2406
2432
  # universe (usually the default "googleapis.com" universe).
2407
2433
  # @return [::String,nil]
2434
+ # @!attribute [rw] logger
2435
+ # A custom logger to use for request/response debug logging, or the value
2436
+ # `:default` (the default) to construct a default logger, or `nil` to
2437
+ # explicitly disable logging.
2438
+ # @return [::Logger,:default,nil]
2408
2439
  #
2409
2440
  class Configuration
2410
2441
  extend ::Gapic::Config
@@ -2433,6 +2464,7 @@ module Google
2433
2464
  # by the host service.
2434
2465
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2435
2466
  config_attr :bindings_override, {}, ::Hash, nil
2467
+ config_attr :logger, :default, ::Logger, nil, :default
2436
2468
 
2437
2469
  # @private
2438
2470
  def initialize parent_config = nil