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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d25d77d0ed2c1c11e1ce13240bfe726ee3370301ad4a4fc1d1cbcd7980d4077e
4
- data.tar.gz: 5fac9cd708de370e083e43a1b5f5873f4da43a887d0b2d5510931293260a62f0
3
+ metadata.gz: baa8e9db28eecbf3afcea14c0a0cf2d48881564108786427b58e0bed2694d669
4
+ data.tar.gz: 1497d6dbca25b657db8faf6d88f6d6a798d87a7547df3f5e1890df621238df4d
5
5
  SHA512:
6
- metadata.gz: 68862685c7716e4365297a8a99b15344803e6d65a6ca7ca24ad2067b5fc601c7ca772c1a29877bedcffc51220a824f145ac474806fd11fc83dd140fd3b67c4c9
7
- data.tar.gz: 67ea02da7e7fe98440957b4d7169d1568b922655abc7bd33ca3fd56cd31510b7935b421d21c72c486ec6652ebc0a6bdf132bf58954d619bf9e579833210b57ef
6
+ metadata.gz: 2b69d5c369ab6270afdb40bd9b7b3877da0d3bf1402488f7558a97cf16c92d8c9a02e27fdab45908eca6e726e9507ff72a2d95581293b311d87bad23d09a23c8
7
+ data.tar.gz: 2d9faaae9c2ee52561c2d0175b81f8a9d53a53b7be19e651145a6b8fde2f88f4dbcdfb022bdd86c45b6e6d84fb7e6fa876cac346213775325778604944cbe94b
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/tasks)
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/tasks/v2beta2"
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::Tasks::V2beta2::CloudTasks::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).
@@ -32,6 +32,9 @@ module Google
32
32
  # work in their applications.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$"
37
40
 
@@ -222,14 +225,26 @@ module Google
222
225
  universe_domain: @config.universe_domain,
223
226
  channel_args: @config.channel_args,
224
227
  interceptors: @config.interceptors,
225
- channel_pool_config: @config.channel_pool
228
+ channel_pool_config: @config.channel_pool,
229
+ logger: @config.logger
226
230
  )
227
231
 
232
+ @cloud_tasks_stub.stub_logger&.info do |entry|
233
+ entry.set_system_name
234
+ entry.set_service
235
+ entry.message = "Created client for #{entry.service}"
236
+ entry.set_credentials_fields credentials
237
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
238
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
239
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
240
+ end
241
+
228
242
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
229
243
  config.credentials = credentials
230
244
  config.quota_project = @quota_project_id
231
245
  config.endpoint = @cloud_tasks_stub.endpoint
232
246
  config.universe_domain = @cloud_tasks_stub.universe_domain
247
+ config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger=
233
248
  end
234
249
  end
235
250
 
@@ -240,6 +255,15 @@ module Google
240
255
  #
241
256
  attr_reader :location_client
242
257
 
258
+ ##
259
+ # The logger used for request/response debug logging.
260
+ #
261
+ # @return [Logger]
262
+ #
263
+ def logger
264
+ @cloud_tasks_stub.logger
265
+ end
266
+
243
267
  # Service calls
244
268
 
245
269
  ##
@@ -339,10 +363,11 @@ module Google
339
363
  # Customize the options with defaults
340
364
  metadata = @config.rpcs.list_queues.metadata.to_h
341
365
 
342
- # Set x-goog-api-client and x-goog-user-project headers
366
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
343
367
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
344
368
  lib_name: @config.lib_name, lib_version: @config.lib_version,
345
369
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
370
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
346
371
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
347
372
 
348
373
  header_params = {}
@@ -364,7 +389,7 @@ module Google
364
389
  @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation|
365
390
  response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options
366
391
  yield response, operation if block_given?
367
- return response
392
+ throw :response, response
368
393
  end
369
394
  rescue ::GRPC::BadStatus => e
370
395
  raise ::Google::Cloud::Error.from_error(e)
@@ -431,10 +456,11 @@ module Google
431
456
  # Customize the options with defaults
432
457
  metadata = @config.rpcs.get_queue.metadata.to_h
433
458
 
434
- # Set x-goog-api-client and x-goog-user-project headers
459
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
435
460
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
436
461
  lib_name: @config.lib_name, lib_version: @config.lib_version,
437
462
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
463
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
438
464
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
465
 
440
466
  header_params = {}
@@ -455,7 +481,6 @@ module Google
455
481
 
456
482
  @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation|
457
483
  yield response, operation if block_given?
458
- return response
459
484
  end
460
485
  rescue ::GRPC::BadStatus => e
461
486
  raise ::Google::Cloud::Error.from_error(e)
@@ -537,10 +562,11 @@ module Google
537
562
  # Customize the options with defaults
538
563
  metadata = @config.rpcs.create_queue.metadata.to_h
539
564
 
540
- # Set x-goog-api-client and x-goog-user-project headers
565
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
541
566
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
542
567
  lib_name: @config.lib_name, lib_version: @config.lib_version,
543
568
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
569
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
544
570
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
545
571
 
546
572
  header_params = {}
@@ -561,7 +587,6 @@ module Google
561
587
 
562
588
  @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation|
563
589
  yield response, operation if block_given?
564
- return response
565
590
  end
566
591
  rescue ::GRPC::BadStatus => e
567
592
  raise ::Google::Cloud::Error.from_error(e)
@@ -648,10 +673,11 @@ module Google
648
673
  # Customize the options with defaults
649
674
  metadata = @config.rpcs.update_queue.metadata.to_h
650
675
 
651
- # Set x-goog-api-client and x-goog-user-project headers
676
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
652
677
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
653
678
  lib_name: @config.lib_name, lib_version: @config.lib_version,
654
679
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
680
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
655
681
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
656
682
 
657
683
  header_params = {}
@@ -672,7 +698,6 @@ module Google
672
698
 
673
699
  @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation|
674
700
  yield response, operation if block_given?
675
- return response
676
701
  end
677
702
  rescue ::GRPC::BadStatus => e
678
703
  raise ::Google::Cloud::Error.from_error(e)
@@ -746,10 +771,11 @@ module Google
746
771
  # Customize the options with defaults
747
772
  metadata = @config.rpcs.delete_queue.metadata.to_h
748
773
 
749
- # Set x-goog-api-client and x-goog-user-project headers
774
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
750
775
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
751
776
  lib_name: @config.lib_name, lib_version: @config.lib_version,
752
777
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
778
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
753
779
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
754
780
 
755
781
  header_params = {}
@@ -770,7 +796,6 @@ module Google
770
796
 
771
797
  @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation|
772
798
  yield response, operation if block_given?
773
- return response
774
799
  end
775
800
  rescue ::GRPC::BadStatus => e
776
801
  raise ::Google::Cloud::Error.from_error(e)
@@ -837,10 +862,11 @@ module Google
837
862
  # Customize the options with defaults
838
863
  metadata = @config.rpcs.purge_queue.metadata.to_h
839
864
 
840
- # Set x-goog-api-client and x-goog-user-project headers
865
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
841
866
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
842
867
  lib_name: @config.lib_name, lib_version: @config.lib_version,
843
868
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
869
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
844
870
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
845
871
 
846
872
  header_params = {}
@@ -861,7 +887,6 @@ module Google
861
887
 
862
888
  @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation|
863
889
  yield response, operation if block_given?
864
- return response
865
890
  end
866
891
  rescue ::GRPC::BadStatus => e
867
892
  raise ::Google::Cloud::Error.from_error(e)
@@ -930,10 +955,11 @@ module Google
930
955
  # Customize the options with defaults
931
956
  metadata = @config.rpcs.pause_queue.metadata.to_h
932
957
 
933
- # Set x-goog-api-client and x-goog-user-project headers
958
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
934
959
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
935
960
  lib_name: @config.lib_name, lib_version: @config.lib_version,
936
961
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
962
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
937
963
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
938
964
 
939
965
  header_params = {}
@@ -954,7 +980,6 @@ module Google
954
980
 
955
981
  @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation|
956
982
  yield response, operation if block_given?
957
- return response
958
983
  end
959
984
  rescue ::GRPC::BadStatus => e
960
985
  raise ::Google::Cloud::Error.from_error(e)
@@ -1030,10 +1055,11 @@ module Google
1030
1055
  # Customize the options with defaults
1031
1056
  metadata = @config.rpcs.resume_queue.metadata.to_h
1032
1057
 
1033
- # Set x-goog-api-client and x-goog-user-project headers
1058
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1034
1059
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1035
1060
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1036
1061
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1062
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1037
1063
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1038
1064
 
1039
1065
  header_params = {}
@@ -1054,7 +1080,6 @@ module Google
1054
1080
 
1055
1081
  @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation|
1056
1082
  yield response, operation if block_given?
1057
- return response
1058
1083
  end
1059
1084
  rescue ::GRPC::BadStatus => e
1060
1085
  raise ::Google::Cloud::Error.from_error(e)
@@ -1123,10 +1148,11 @@ module Google
1123
1148
  # Customize the options with defaults
1124
1149
  metadata = @config.rpcs.upload_queue_yaml.metadata.to_h
1125
1150
 
1126
- # Set x-goog-api-client and x-goog-user-project headers
1151
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1127
1152
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1128
1153
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1129
1154
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1155
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1130
1156
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1131
1157
 
1132
1158
  options.apply_defaults timeout: @config.rpcs.upload_queue_yaml.timeout,
@@ -1139,7 +1165,6 @@ module Google
1139
1165
 
1140
1166
  @cloud_tasks_stub.call_rpc :upload_queue_yaml, request, options: options do |response, operation|
1141
1167
  yield response, operation if block_given?
1142
- return response
1143
1168
  end
1144
1169
  rescue ::GRPC::BadStatus => e
1145
1170
  raise ::Google::Cloud::Error.from_error(e)
@@ -1212,10 +1237,11 @@ module Google
1212
1237
  # Customize the options with defaults
1213
1238
  metadata = @config.rpcs.get_iam_policy.metadata.to_h
1214
1239
 
1215
- # Set x-goog-api-client and x-goog-user-project headers
1240
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1216
1241
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1217
1242
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1218
1243
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1244
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1219
1245
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1220
1246
 
1221
1247
  header_params = {}
@@ -1236,7 +1262,6 @@ module Google
1236
1262
 
1237
1263
  @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1238
1264
  yield response, operation if block_given?
1239
- return response
1240
1265
  end
1241
1266
  rescue ::GRPC::BadStatus => e
1242
1267
  raise ::Google::Cloud::Error.from_error(e)
@@ -1319,10 +1344,11 @@ module Google
1319
1344
  # Customize the options with defaults
1320
1345
  metadata = @config.rpcs.set_iam_policy.metadata.to_h
1321
1346
 
1322
- # Set x-goog-api-client and x-goog-user-project headers
1347
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1323
1348
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1324
1349
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1325
1350
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1351
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1326
1352
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1327
1353
 
1328
1354
  header_params = {}
@@ -1343,7 +1369,6 @@ module Google
1343
1369
 
1344
1370
  @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1345
1371
  yield response, operation if block_given?
1346
- return response
1347
1372
  end
1348
1373
  rescue ::GRPC::BadStatus => e
1349
1374
  raise ::Google::Cloud::Error.from_error(e)
@@ -1417,10 +1442,11 @@ module Google
1417
1442
  # Customize the options with defaults
1418
1443
  metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1419
1444
 
1420
- # Set x-goog-api-client and x-goog-user-project headers
1445
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1421
1446
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1422
1447
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1423
1448
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1449
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1424
1450
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1425
1451
 
1426
1452
  header_params = {}
@@ -1441,7 +1467,6 @@ module Google
1441
1467
 
1442
1468
  @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1443
1469
  yield response, operation if block_given?
1444
- return response
1445
1470
  end
1446
1471
  rescue ::GRPC::BadStatus => e
1447
1472
  raise ::Google::Cloud::Error.from_error(e)
@@ -1548,10 +1573,11 @@ module Google
1548
1573
  # Customize the options with defaults
1549
1574
  metadata = @config.rpcs.list_tasks.metadata.to_h
1550
1575
 
1551
- # Set x-goog-api-client and x-goog-user-project headers
1576
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1552
1577
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1553
1578
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1554
1579
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1580
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1555
1581
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1556
1582
 
1557
1583
  header_params = {}
@@ -1573,7 +1599,7 @@ module Google
1573
1599
  @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation|
1574
1600
  response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options
1575
1601
  yield response, operation if block_given?
1576
- return response
1602
+ throw :response, response
1577
1603
  end
1578
1604
  rescue ::GRPC::BadStatus => e
1579
1605
  raise ::Google::Cloud::Error.from_error(e)
@@ -1649,10 +1675,11 @@ module Google
1649
1675
  # Customize the options with defaults
1650
1676
  metadata = @config.rpcs.get_task.metadata.to_h
1651
1677
 
1652
- # Set x-goog-api-client and x-goog-user-project headers
1678
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1653
1679
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1654
1680
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1655
1681
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1682
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1656
1683
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1657
1684
 
1658
1685
  header_params = {}
@@ -1673,7 +1700,6 @@ module Google
1673
1700
 
1674
1701
  @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation|
1675
1702
  yield response, operation if block_given?
1676
- return response
1677
1703
  end
1678
1704
  rescue ::GRPC::BadStatus => e
1679
1705
  raise ::Google::Cloud::Error.from_error(e)
@@ -1793,10 +1819,11 @@ module Google
1793
1819
  # Customize the options with defaults
1794
1820
  metadata = @config.rpcs.create_task.metadata.to_h
1795
1821
 
1796
- # Set x-goog-api-client and x-goog-user-project headers
1822
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1797
1823
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1798
1824
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1799
1825
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1826
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1800
1827
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1801
1828
 
1802
1829
  header_params = {}
@@ -1817,7 +1844,6 @@ module Google
1817
1844
 
1818
1845
  @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation|
1819
1846
  yield response, operation if block_given?
1820
- return response
1821
1847
  end
1822
1848
  rescue ::GRPC::BadStatus => e
1823
1849
  raise ::Google::Cloud::Error.from_error(e)
@@ -1883,10 +1909,11 @@ module Google
1883
1909
  # Customize the options with defaults
1884
1910
  metadata = @config.rpcs.delete_task.metadata.to_h
1885
1911
 
1886
- # Set x-goog-api-client and x-goog-user-project headers
1912
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1887
1913
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1888
1914
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1889
1915
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
1916
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1890
1917
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1891
1918
 
1892
1919
  header_params = {}
@@ -1907,7 +1934,6 @@ module Google
1907
1934
 
1908
1935
  @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation|
1909
1936
  yield response, operation if block_given?
1910
- return response
1911
1937
  end
1912
1938
  rescue ::GRPC::BadStatus => e
1913
1939
  raise ::Google::Cloud::Error.from_error(e)
@@ -2072,10 +2098,11 @@ module Google
2072
2098
  # Customize the options with defaults
2073
2099
  metadata = @config.rpcs.lease_tasks.metadata.to_h
2074
2100
 
2075
- # Set x-goog-api-client and x-goog-user-project headers
2101
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2076
2102
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2077
2103
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2078
2104
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
2105
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2079
2106
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2080
2107
 
2081
2108
  header_params = {}
@@ -2096,7 +2123,6 @@ module Google
2096
2123
 
2097
2124
  @cloud_tasks_stub.call_rpc :lease_tasks, request, options: options do |response, operation|
2098
2125
  yield response, operation if block_given?
2099
- return response
2100
2126
  end
2101
2127
  rescue ::GRPC::BadStatus => e
2102
2128
  raise ::Google::Cloud::Error.from_error(e)
@@ -2177,10 +2203,11 @@ module Google
2177
2203
  # Customize the options with defaults
2178
2204
  metadata = @config.rpcs.acknowledge_task.metadata.to_h
2179
2205
 
2180
- # Set x-goog-api-client and x-goog-user-project headers
2206
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2181
2207
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2182
2208
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2183
2209
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
2210
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2184
2211
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2185
2212
 
2186
2213
  header_params = {}
@@ -2201,7 +2228,6 @@ module Google
2201
2228
 
2202
2229
  @cloud_tasks_stub.call_rpc :acknowledge_task, request, options: options do |response, operation|
2203
2230
  yield response, operation if block_given?
2204
- return response
2205
2231
  end
2206
2232
  rescue ::GRPC::BadStatus => e
2207
2233
  raise ::Google::Cloud::Error.from_error(e)
@@ -2294,10 +2320,11 @@ module Google
2294
2320
  # Customize the options with defaults
2295
2321
  metadata = @config.rpcs.renew_lease.metadata.to_h
2296
2322
 
2297
- # Set x-goog-api-client and x-goog-user-project headers
2323
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2298
2324
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2299
2325
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2300
2326
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
2327
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2301
2328
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2302
2329
 
2303
2330
  header_params = {}
@@ -2318,7 +2345,6 @@ module Google
2318
2345
 
2319
2346
  @cloud_tasks_stub.call_rpc :renew_lease, request, options: options do |response, operation|
2320
2347
  yield response, operation if block_given?
2321
- return response
2322
2348
  end
2323
2349
  rescue ::GRPC::BadStatus => e
2324
2350
  raise ::Google::Cloud::Error.from_error(e)
@@ -2405,10 +2431,11 @@ module Google
2405
2431
  # Customize the options with defaults
2406
2432
  metadata = @config.rpcs.cancel_lease.metadata.to_h
2407
2433
 
2408
- # Set x-goog-api-client and x-goog-user-project headers
2434
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2409
2435
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2410
2436
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2411
2437
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
2438
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2412
2439
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2413
2440
 
2414
2441
  header_params = {}
@@ -2429,7 +2456,6 @@ module Google
2429
2456
 
2430
2457
  @cloud_tasks_stub.call_rpc :cancel_lease, request, options: options do |response, operation|
2431
2458
  yield response, operation if block_given?
2432
- return response
2433
2459
  end
2434
2460
  rescue ::GRPC::BadStatus => e
2435
2461
  raise ::Google::Cloud::Error.from_error(e)
@@ -2534,10 +2560,11 @@ module Google
2534
2560
  # Customize the options with defaults
2535
2561
  metadata = @config.rpcs.run_task.metadata.to_h
2536
2562
 
2537
- # Set x-goog-api-client and x-goog-user-project headers
2563
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2538
2564
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2539
2565
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2540
2566
  gapic_version: ::Google::Cloud::Tasks::V2beta2::VERSION
2567
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2541
2568
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2542
2569
 
2543
2570
  header_params = {}
@@ -2558,7 +2585,6 @@ module Google
2558
2585
 
2559
2586
  @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation|
2560
2587
  yield response, operation if block_given?
2561
- return response
2562
2588
  end
2563
2589
  rescue ::GRPC::BadStatus => e
2564
2590
  raise ::Google::Cloud::Error.from_error(e)
@@ -2647,6 +2673,11 @@ module Google
2647
2673
  # default endpoint URL. The default value of nil uses the environment
2648
2674
  # universe (usually the default "googleapis.com" universe).
2649
2675
  # @return [::String,nil]
2676
+ # @!attribute [rw] logger
2677
+ # A custom logger to use for request/response debug logging, or the value
2678
+ # `:default` (the default) to construct a default logger, or `nil` to
2679
+ # explicitly disable logging.
2680
+ # @return [::Logger,:default,nil]
2650
2681
  #
2651
2682
  class Configuration
2652
2683
  extend ::Gapic::Config
@@ -2671,6 +2702,7 @@ module Google
2671
2702
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2672
2703
  config_attr :quota_project, nil, ::String, nil
2673
2704
  config_attr :universe_domain, nil, ::String, nil
2705
+ config_attr :logger, :default, ::Logger, nil, :default
2674
2706
 
2675
2707
  # @private
2676
2708
  def initialize parent_config = nil