google-cloud-tasks-v2beta3 0.13.1 → 0.15.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: 3b705ea949378c5bc1a0ce8c4abc16b868533d8a5012ac5f5bb152ce654f5b3f
4
- data.tar.gz: 1682daeaddacd480109703bae0908e4d8dd67d97daadaeac75e3dcc27a6077f7
3
+ metadata.gz: 54d58e4706ad94ccfbe9a8cdbfb761c1801dbcb1ff08c5cb40db62f6f4971c4e
4
+ data.tar.gz: 0db2f1d2225698688d55171e86b234302665a9e0130690458e11334e8930ce70
5
5
  SHA512:
6
- metadata.gz: edac64f49b39052a899d793060691b43ce407d4875288ce849d6bb4d11206f965b0d567a839c0a750202889a6ca1ae1e11c200cd4c30fbd4fca38627ac82ebeb
7
- data.tar.gz: e4ac9f75c76f5c2aa9d9eb26ef4cb030a0e8f865212fb704188bf2db70c49dc2ebb4d3ee60f1950020e45f87e89c34323d9f04a2ed73e11164dc783cc0ebf8fe
6
+ metadata.gz: b5611330464ee350d8c2c63cf8ffe1cfec78f4bc7701f1fb8b5f5df940d3df33410a025fb6ad022cc26a156d632dc7a3e0b79ef1595019f6e18dd762cd0d713b
7
+ data.tar.gz: 34c53d2a00b8af94b11c813bd4f80f8c5aa24e46e66f5fccc807fa42f020105cce13765a992c827604b12b07784a8a085e0e26ac19552556e3b40d36bf425365
data/README.md CHANGED
@@ -43,40 +43,50 @@ 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/v2beta3"
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::V2beta3::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).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -215,14 +215,26 @@ module Google
215
215
  universe_domain: @config.universe_domain,
216
216
  channel_args: @config.channel_args,
217
217
  interceptors: @config.interceptors,
218
- channel_pool_config: @config.channel_pool
218
+ channel_pool_config: @config.channel_pool,
219
+ logger: @config.logger
219
220
  )
220
221
 
222
+ @cloud_tasks_stub.stub_logger&.info do |entry|
223
+ entry.set_system_name
224
+ entry.set_service
225
+ entry.message = "Created client for #{entry.service}"
226
+ entry.set_credentials_fields credentials
227
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
228
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
229
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
230
+ end
231
+
221
232
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
222
233
  config.credentials = credentials
223
234
  config.quota_project = @quota_project_id
224
235
  config.endpoint = @cloud_tasks_stub.endpoint
225
236
  config.universe_domain = @cloud_tasks_stub.universe_domain
237
+ config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger=
226
238
  end
227
239
  end
228
240
 
@@ -233,6 +245,15 @@ module Google
233
245
  #
234
246
  attr_reader :location_client
235
247
 
248
+ ##
249
+ # The logger used for request/response debug logging.
250
+ #
251
+ # @return [Logger]
252
+ #
253
+ def logger
254
+ @cloud_tasks_stub.logger
255
+ end
256
+
236
257
  # Service calls
237
258
 
238
259
  ##
@@ -358,7 +379,7 @@ module Google
358
379
  @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation|
359
380
  response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options
360
381
  yield response, operation if block_given?
361
- return response
382
+ throw :response, response
362
383
  end
363
384
  rescue ::GRPC::BadStatus => e
364
385
  raise ::Google::Cloud::Error.from_error(e)
@@ -450,7 +471,6 @@ module Google
450
471
 
451
472
  @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation|
452
473
  yield response, operation if block_given?
453
- return response
454
474
  end
455
475
  rescue ::GRPC::BadStatus => e
456
476
  raise ::Google::Cloud::Error.from_error(e)
@@ -557,7 +577,6 @@ module Google
557
577
 
558
578
  @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation|
559
579
  yield response, operation if block_given?
560
- return response
561
580
  end
562
581
  rescue ::GRPC::BadStatus => e
563
582
  raise ::Google::Cloud::Error.from_error(e)
@@ -669,7 +688,6 @@ module Google
669
688
 
670
689
  @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation|
671
690
  yield response, operation if block_given?
672
- return response
673
691
  end
674
692
  rescue ::GRPC::BadStatus => e
675
693
  raise ::Google::Cloud::Error.from_error(e)
@@ -768,7 +786,6 @@ module Google
768
786
 
769
787
  @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation|
770
788
  yield response, operation if block_given?
771
- return response
772
789
  end
773
790
  rescue ::GRPC::BadStatus => e
774
791
  raise ::Google::Cloud::Error.from_error(e)
@@ -860,7 +877,6 @@ module Google
860
877
 
861
878
  @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation|
862
879
  yield response, operation if block_given?
863
- return response
864
880
  end
865
881
  rescue ::GRPC::BadStatus => e
866
882
  raise ::Google::Cloud::Error.from_error(e)
@@ -954,7 +970,6 @@ module Google
954
970
 
955
971
  @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation|
956
972
  yield response, operation if block_given?
957
- return response
958
973
  end
959
974
  rescue ::GRPC::BadStatus => e
960
975
  raise ::Google::Cloud::Error.from_error(e)
@@ -1055,7 +1070,6 @@ module Google
1055
1070
 
1056
1071
  @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation|
1057
1072
  yield response, operation if block_given?
1058
- return response
1059
1073
  end
1060
1074
  rescue ::GRPC::BadStatus => e
1061
1075
  raise ::Google::Cloud::Error.from_error(e)
@@ -1153,7 +1167,6 @@ module Google
1153
1167
 
1154
1168
  @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1155
1169
  yield response, operation if block_given?
1156
- return response
1157
1170
  end
1158
1171
  rescue ::GRPC::BadStatus => e
1159
1172
  raise ::Google::Cloud::Error.from_error(e)
@@ -1261,7 +1274,6 @@ module Google
1261
1274
 
1262
1275
  @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1263
1276
  yield response, operation if block_given?
1264
- return response
1265
1277
  end
1266
1278
  rescue ::GRPC::BadStatus => e
1267
1279
  raise ::Google::Cloud::Error.from_error(e)
@@ -1360,7 +1372,6 @@ module Google
1360
1372
 
1361
1373
  @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1362
1374
  yield response, operation if block_given?
1363
- return response
1364
1375
  end
1365
1376
  rescue ::GRPC::BadStatus => e
1366
1377
  raise ::Google::Cloud::Error.from_error(e)
@@ -1493,7 +1504,7 @@ module Google
1493
1504
  @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation|
1494
1505
  response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options
1495
1506
  yield response, operation if block_given?
1496
- return response
1507
+ throw :response, response
1497
1508
  end
1498
1509
  rescue ::GRPC::BadStatus => e
1499
1510
  raise ::Google::Cloud::Error.from_error(e)
@@ -1594,7 +1605,6 @@ module Google
1594
1605
 
1595
1606
  @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation|
1596
1607
  yield response, operation if block_given?
1597
- return response
1598
1608
  end
1599
1609
  rescue ::GRPC::BadStatus => e
1600
1610
  raise ::Google::Cloud::Error.from_error(e)
@@ -1735,7 +1745,6 @@ module Google
1735
1745
 
1736
1746
  @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation|
1737
1747
  yield response, operation if block_given?
1738
- return response
1739
1748
  end
1740
1749
  rescue ::GRPC::BadStatus => e
1741
1750
  raise ::Google::Cloud::Error.from_error(e)
@@ -1826,7 +1835,6 @@ module Google
1826
1835
 
1827
1836
  @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation|
1828
1837
  yield response, operation if block_given?
1829
- return response
1830
1838
  end
1831
1839
  rescue ::GRPC::BadStatus => e
1832
1840
  raise ::Google::Cloud::Error.from_error(e)
@@ -1953,7 +1961,6 @@ module Google
1953
1961
 
1954
1962
  @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation|
1955
1963
  yield response, operation if block_given?
1956
- return response
1957
1964
  end
1958
1965
  rescue ::GRPC::BadStatus => e
1959
1966
  raise ::Google::Cloud::Error.from_error(e)
@@ -2003,6 +2010,13 @@ module Google
2003
2010
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2004
2011
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2005
2012
  # * (`nil`) indicating no credentials
2013
+ #
2014
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2015
+ # external source for authentication to Google Cloud, you must validate it before
2016
+ # providing it to a Google API client library. Providing an unvalidated credential
2017
+ # configuration to Google APIs can compromise the security of your systems and data.
2018
+ # For more information, refer to [Validate credential configurations from external
2019
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2006
2020
  # @return [::Object]
2007
2021
  # @!attribute [rw] scope
2008
2022
  # The OAuth scopes
@@ -2042,6 +2056,11 @@ module Google
2042
2056
  # default endpoint URL. The default value of nil uses the environment
2043
2057
  # universe (usually the default "googleapis.com" universe).
2044
2058
  # @return [::String,nil]
2059
+ # @!attribute [rw] logger
2060
+ # A custom logger to use for request/response debug logging, or the value
2061
+ # `:default` (the default) to construct a default logger, or `nil` to
2062
+ # explicitly disable logging.
2063
+ # @return [::Logger,:default,nil]
2045
2064
  #
2046
2065
  class Configuration
2047
2066
  extend ::Gapic::Config
@@ -2066,6 +2085,7 @@ module Google
2066
2085
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2067
2086
  config_attr :quota_project, nil, ::String, nil
2068
2087
  config_attr :universe_domain, nil, ::String, nil
2088
+ config_attr :logger, :default, ::Logger, nil, :default
2069
2089
 
2070
2090
  # @private
2071
2091
  def initialize parent_config = nil
@@ -208,15 +208,27 @@ module Google
208
208
  endpoint: @config.endpoint,
209
209
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
210
210
  universe_domain: @config.universe_domain,
211
- credentials: credentials
211
+ credentials: credentials,
212
+ logger: @config.logger
212
213
  )
213
214
 
215
+ @cloud_tasks_stub.logger(stub: true)&.info do |entry|
216
+ entry.set_system_name
217
+ entry.set_service
218
+ entry.message = "Created client for #{entry.service}"
219
+ entry.set_credentials_fields credentials
220
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
221
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
222
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
223
+ end
224
+
214
225
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
215
226
  config.credentials = credentials
216
227
  config.quota_project = @quota_project_id
217
228
  config.endpoint = @cloud_tasks_stub.endpoint
218
229
  config.universe_domain = @cloud_tasks_stub.universe_domain
219
230
  config.bindings_override = @config.bindings_override
231
+ config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger=
220
232
  end
221
233
  end
222
234
 
@@ -227,6 +239,15 @@ module Google
227
239
  #
228
240
  attr_reader :location_client
229
241
 
242
+ ##
243
+ # The logger used for request/response debug logging.
244
+ #
245
+ # @return [Logger]
246
+ #
247
+ def logger
248
+ @cloud_tasks_stub.logger
249
+ end
250
+
230
251
  # Service calls
231
252
 
232
253
  ##
@@ -345,7 +366,7 @@ module Google
345
366
  @cloud_tasks_stub.list_queues request, options do |result, operation|
346
367
  result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options
347
368
  yield result, operation if block_given?
348
- return result
369
+ throw :response, result
349
370
  end
350
371
  rescue ::Gapic::Rest::Error => e
351
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -430,7 +451,6 @@ module Google
430
451
 
431
452
  @cloud_tasks_stub.get_queue request, options do |result, operation|
432
453
  yield result, operation if block_given?
433
- return result
434
454
  end
435
455
  rescue ::Gapic::Rest::Error => e
436
456
  raise ::Google::Cloud::Error.from_error(e)
@@ -530,7 +550,6 @@ module Google
530
550
 
531
551
  @cloud_tasks_stub.create_queue request, options do |result, operation|
532
552
  yield result, operation if block_given?
533
- return result
534
553
  end
535
554
  rescue ::Gapic::Rest::Error => e
536
555
  raise ::Google::Cloud::Error.from_error(e)
@@ -635,7 +654,6 @@ module Google
635
654
 
636
655
  @cloud_tasks_stub.update_queue request, options do |result, operation|
637
656
  yield result, operation if block_given?
638
- return result
639
657
  end
640
658
  rescue ::Gapic::Rest::Error => e
641
659
  raise ::Google::Cloud::Error.from_error(e)
@@ -727,7 +745,6 @@ module Google
727
745
 
728
746
  @cloud_tasks_stub.delete_queue request, options do |result, operation|
729
747
  yield result, operation if block_given?
730
- return result
731
748
  end
732
749
  rescue ::Gapic::Rest::Error => e
733
750
  raise ::Google::Cloud::Error.from_error(e)
@@ -812,7 +829,6 @@ module Google
812
829
 
813
830
  @cloud_tasks_stub.purge_queue request, options do |result, operation|
814
831
  yield result, operation if block_given?
815
- return result
816
832
  end
817
833
  rescue ::Gapic::Rest::Error => e
818
834
  raise ::Google::Cloud::Error.from_error(e)
@@ -899,7 +915,6 @@ module Google
899
915
 
900
916
  @cloud_tasks_stub.pause_queue request, options do |result, operation|
901
917
  yield result, operation if block_given?
902
- return result
903
918
  end
904
919
  rescue ::Gapic::Rest::Error => e
905
920
  raise ::Google::Cloud::Error.from_error(e)
@@ -993,7 +1008,6 @@ module Google
993
1008
 
994
1009
  @cloud_tasks_stub.resume_queue request, options do |result, operation|
995
1010
  yield result, operation if block_given?
996
- return result
997
1011
  end
998
1012
  rescue ::Gapic::Rest::Error => e
999
1013
  raise ::Google::Cloud::Error.from_error(e)
@@ -1084,7 +1098,6 @@ module Google
1084
1098
 
1085
1099
  @cloud_tasks_stub.get_iam_policy request, options do |result, operation|
1086
1100
  yield result, operation if block_given?
1087
- return result
1088
1101
  end
1089
1102
  rescue ::Gapic::Rest::Error => e
1090
1103
  raise ::Google::Cloud::Error.from_error(e)
@@ -1185,7 +1198,6 @@ module Google
1185
1198
 
1186
1199
  @cloud_tasks_stub.set_iam_policy request, options do |result, operation|
1187
1200
  yield result, operation if block_given?
1188
- return result
1189
1201
  end
1190
1202
  rescue ::Gapic::Rest::Error => e
1191
1203
  raise ::Google::Cloud::Error.from_error(e)
@@ -1277,7 +1289,6 @@ module Google
1277
1289
 
1278
1290
  @cloud_tasks_stub.test_iam_permissions request, options do |result, operation|
1279
1291
  yield result, operation if block_given?
1280
- return result
1281
1292
  end
1282
1293
  rescue ::Gapic::Rest::Error => e
1283
1294
  raise ::Google::Cloud::Error.from_error(e)
@@ -1403,7 +1414,7 @@ module Google
1403
1414
  @cloud_tasks_stub.list_tasks request, options do |result, operation|
1404
1415
  result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options
1405
1416
  yield result, operation if block_given?
1406
- return result
1417
+ throw :response, result
1407
1418
  end
1408
1419
  rescue ::Gapic::Rest::Error => e
1409
1420
  raise ::Google::Cloud::Error.from_error(e)
@@ -1497,7 +1508,6 @@ module Google
1497
1508
 
1498
1509
  @cloud_tasks_stub.get_task request, options do |result, operation|
1499
1510
  yield result, operation if block_given?
1500
- return result
1501
1511
  end
1502
1512
  rescue ::Gapic::Rest::Error => e
1503
1513
  raise ::Google::Cloud::Error.from_error(e)
@@ -1631,7 +1641,6 @@ module Google
1631
1641
 
1632
1642
  @cloud_tasks_stub.create_task request, options do |result, operation|
1633
1643
  yield result, operation if block_given?
1634
- return result
1635
1644
  end
1636
1645
  rescue ::Gapic::Rest::Error => e
1637
1646
  raise ::Google::Cloud::Error.from_error(e)
@@ -1715,7 +1724,6 @@ module Google
1715
1724
 
1716
1725
  @cloud_tasks_stub.delete_task request, options do |result, operation|
1717
1726
  yield result, operation if block_given?
1718
- return result
1719
1727
  end
1720
1728
  rescue ::Gapic::Rest::Error => e
1721
1729
  raise ::Google::Cloud::Error.from_error(e)
@@ -1835,7 +1843,6 @@ module Google
1835
1843
 
1836
1844
  @cloud_tasks_stub.run_task request, options do |result, operation|
1837
1845
  yield result, operation if block_given?
1838
- return result
1839
1846
  end
1840
1847
  rescue ::Gapic::Rest::Error => e
1841
1848
  raise ::Google::Cloud::Error.from_error(e)
@@ -1883,6 +1890,13 @@ module Google
1883
1890
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1884
1891
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1885
1892
  # * (`nil`) indicating no credentials
1893
+ #
1894
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1895
+ # external source for authentication to Google Cloud, you must validate it before
1896
+ # providing it to a Google API client library. Providing an unvalidated credential
1897
+ # configuration to Google APIs can compromise the security of your systems and data.
1898
+ # For more information, refer to [Validate credential configurations from external
1899
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1886
1900
  # @return [::Object]
1887
1901
  # @!attribute [rw] scope
1888
1902
  # The OAuth scopes
@@ -1915,6 +1929,11 @@ module Google
1915
1929
  # default endpoint URL. The default value of nil uses the environment
1916
1930
  # universe (usually the default "googleapis.com" universe).
1917
1931
  # @return [::String,nil]
1932
+ # @!attribute [rw] logger
1933
+ # A custom logger to use for request/response debug logging, or the value
1934
+ # `:default` (the default) to construct a default logger, or `nil` to
1935
+ # explicitly disable logging.
1936
+ # @return [::Logger,:default,nil]
1918
1937
  #
1919
1938
  class Configuration
1920
1939
  extend ::Gapic::Config
@@ -1943,6 +1962,7 @@ module Google
1943
1962
  # by the host service.
1944
1963
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1945
1964
  config_attr :bindings_override, {}, ::Hash, nil
1965
+ config_attr :logger, :default, ::Logger, nil, :default
1946
1966
 
1947
1967
  # @private
1948
1968
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_queues REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_queues",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_queue",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_queue",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_queue",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "delete_queue",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "purge_queue",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "pause_queue",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -353,16 +379,18 @@ module Google
353
379
 
354
380
  response = @client_stub.make_http_request(
355
381
  verb,
356
- uri: uri,
357
- body: body || "",
358
- params: query_string_params,
382
+ uri: uri,
383
+ body: body || "",
384
+ params: query_string_params,
385
+ method_name: "resume_queue",
359
386
  options: options
360
387
  )
361
388
  operation = ::Gapic::Rest::TransportOperation.new response
362
389
  result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true
363
-
364
- yield result, operation if block_given?
365
- result
390
+ catch :response do
391
+ yield result, operation if block_given?
392
+ result
393
+ end
366
394
  end
367
395
 
368
396
  ##
@@ -391,16 +419,18 @@ module Google
391
419
 
392
420
  response = @client_stub.make_http_request(
393
421
  verb,
394
- uri: uri,
395
- body: body || "",
396
- params: query_string_params,
422
+ uri: uri,
423
+ body: body || "",
424
+ params: query_string_params,
425
+ method_name: "get_iam_policy",
397
426
  options: options
398
427
  )
399
428
  operation = ::Gapic::Rest::TransportOperation.new response
400
429
  result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
401
-
402
- yield result, operation if block_given?
403
- result
430
+ catch :response do
431
+ yield result, operation if block_given?
432
+ result
433
+ end
404
434
  end
405
435
 
406
436
  ##
@@ -429,16 +459,18 @@ module Google
429
459
 
430
460
  response = @client_stub.make_http_request(
431
461
  verb,
432
- uri: uri,
433
- body: body || "",
434
- params: query_string_params,
462
+ uri: uri,
463
+ body: body || "",
464
+ params: query_string_params,
465
+ method_name: "set_iam_policy",
435
466
  options: options
436
467
  )
437
468
  operation = ::Gapic::Rest::TransportOperation.new response
438
469
  result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
439
-
440
- yield result, operation if block_given?
441
- result
470
+ catch :response do
471
+ yield result, operation if block_given?
472
+ result
473
+ end
442
474
  end
443
475
 
444
476
  ##
@@ -467,16 +499,18 @@ module Google
467
499
 
468
500
  response = @client_stub.make_http_request(
469
501
  verb,
470
- uri: uri,
471
- body: body || "",
472
- params: query_string_params,
502
+ uri: uri,
503
+ body: body || "",
504
+ params: query_string_params,
505
+ method_name: "test_iam_permissions",
473
506
  options: options
474
507
  )
475
508
  operation = ::Gapic::Rest::TransportOperation.new response
476
509
  result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
477
-
478
- yield result, operation if block_given?
479
- result
510
+ catch :response do
511
+ yield result, operation if block_given?
512
+ result
513
+ end
480
514
  end
481
515
 
482
516
  ##
@@ -505,16 +539,18 @@ module Google
505
539
 
506
540
  response = @client_stub.make_http_request(
507
541
  verb,
508
- uri: uri,
509
- body: body || "",
510
- params: query_string_params,
542
+ uri: uri,
543
+ body: body || "",
544
+ params: query_string_params,
545
+ method_name: "list_tasks",
511
546
  options: options
512
547
  )
513
548
  operation = ::Gapic::Rest::TransportOperation.new response
514
549
  result = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true
515
-
516
- yield result, operation if block_given?
517
- result
550
+ catch :response do
551
+ yield result, operation if block_given?
552
+ result
553
+ end
518
554
  end
519
555
 
520
556
  ##
@@ -543,16 +579,18 @@ module Google
543
579
 
544
580
  response = @client_stub.make_http_request(
545
581
  verb,
546
- uri: uri,
547
- body: body || "",
548
- params: query_string_params,
582
+ uri: uri,
583
+ body: body || "",
584
+ params: query_string_params,
585
+ method_name: "get_task",
549
586
  options: options
550
587
  )
551
588
  operation = ::Gapic::Rest::TransportOperation.new response
552
589
  result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true
553
-
554
- yield result, operation if block_given?
555
- result
590
+ catch :response do
591
+ yield result, operation if block_given?
592
+ result
593
+ end
556
594
  end
557
595
 
558
596
  ##
@@ -581,16 +619,18 @@ module Google
581
619
 
582
620
  response = @client_stub.make_http_request(
583
621
  verb,
584
- uri: uri,
585
- body: body || "",
586
- params: query_string_params,
622
+ uri: uri,
623
+ body: body || "",
624
+ params: query_string_params,
625
+ method_name: "create_task",
587
626
  options: options
588
627
  )
589
628
  operation = ::Gapic::Rest::TransportOperation.new response
590
629
  result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true
591
-
592
- yield result, operation if block_given?
593
- result
630
+ catch :response do
631
+ yield result, operation if block_given?
632
+ result
633
+ end
594
634
  end
595
635
 
596
636
  ##
@@ -619,16 +659,18 @@ module Google
619
659
 
620
660
  response = @client_stub.make_http_request(
621
661
  verb,
622
- uri: uri,
623
- body: body || "",
624
- params: query_string_params,
662
+ uri: uri,
663
+ body: body || "",
664
+ params: query_string_params,
665
+ method_name: "delete_task",
625
666
  options: options
626
667
  )
627
668
  operation = ::Gapic::Rest::TransportOperation.new response
628
669
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
629
-
630
- yield result, operation if block_given?
631
- result
670
+ catch :response do
671
+ yield result, operation if block_given?
672
+ result
673
+ end
632
674
  end
633
675
 
634
676
  ##
@@ -657,16 +699,18 @@ module Google
657
699
 
658
700
  response = @client_stub.make_http_request(
659
701
  verb,
660
- uri: uri,
661
- body: body || "",
662
- params: query_string_params,
702
+ uri: uri,
703
+ body: body || "",
704
+ params: query_string_params,
705
+ method_name: "run_task",
663
706
  options: options
664
707
  )
665
708
  operation = ::Gapic::Rest::TransportOperation.new response
666
709
  result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true
667
-
668
- yield result, operation if block_given?
669
- result
710
+ catch :response do
711
+ yield result, operation if block_given?
712
+ result
713
+ end
670
714
  end
671
715
 
672
716
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Tasks
23
23
  module V2beta3
24
- VERSION = "0.13.1"
24
+ VERSION = "0.15.0"
25
25
  end
26
26
  end
27
27
  end
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization
@@ -209,6 +209,8 @@ module Google
209
209
  #
210
210
  # This type of authorization should generally only be used when calling
211
211
  # Google APIs hosted on *.googleapis.com.
212
+ #
213
+ # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared.
212
214
  # @!attribute [rw] oidc_token
213
215
  # @return [::Google::Cloud::Tasks::V2beta3::OidcToken]
214
216
  # If specified, an
@@ -219,6 +221,8 @@ module Google
219
221
  # This type of authorization can be used for many scenarios, including
220
222
  # calling Cloud Run, or endpoints where you intend to validate the token
221
223
  # yourself.
224
+ #
225
+ # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared.
222
226
  class HttpTarget
223
227
  include ::Google::Protobuf::MessageExts
224
228
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -340,6 +344,8 @@ module Google
340
344
  #
341
345
  # This type of authorization should generally only be used when calling
342
346
  # Google APIs hosted on *.googleapis.com.
347
+ #
348
+ # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared.
343
349
  # @!attribute [rw] oidc_token
344
350
  # @return [::Google::Cloud::Tasks::V2beta3::OidcToken]
345
351
  # If specified, an
@@ -350,6 +356,8 @@ module Google
350
356
  # This type of authorization can be used for many scenarios, including
351
357
  # calling Cloud Run, or endpoints where you intend to validate the token
352
358
  # yourself.
359
+ #
360
+ # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared.
353
361
  class HttpRequest
354
362
  include ::Google::Protobuf::MessageExts
355
363
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -52,12 +52,16 @@ module Google
52
52
  # An App Engine task is a task that has
53
53
  # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest}
54
54
  # set.
55
+ #
56
+ # Note: The following fields are mutually exclusive: `app_engine_http_request`, `http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared.
55
57
  # @!attribute [rw] http_request
56
58
  # @return [::Google::Cloud::Tasks::V2beta3::HttpRequest]
57
59
  # HTTP request that is sent to the task's target.
58
60
  #
59
61
  # An HTTP task is a task that has
60
62
  # {::Google::Cloud::Tasks::V2beta3::HttpRequest HttpRequest} set.
63
+ #
64
+ # Note: The following fields are mutually exclusive: `http_request`, `app_engine_http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared.
61
65
  # @!attribute [rw] pull_message
62
66
  # @return [::Google::Cloud::Tasks::V2beta3::PullMessage]
63
67
  # Pull Message contained in a task in a
@@ -67,6 +71,8 @@ module Google
67
71
  # [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/)
68
72
  # queues to provide a way to inspect contents of pull tasks through the
69
73
  # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task CloudTasks.GetTask}.
74
+ #
75
+ # Note: The following fields are mutually exclusive: `pull_message`, `app_engine_http_request`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared.
70
76
  # @!attribute [rw] schedule_time
71
77
  # @return [::Google::Protobuf::Timestamp]
72
78
  # The time when the task is scheduled to be attempted.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-tasks-v2beta3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-30 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gapic-common
@@ -16,7 +15,7 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.21.1
18
+ version: 0.25.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.a
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 0.21.1
28
+ version: 0.25.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.a
@@ -133,7 +132,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
133
132
  licenses:
134
133
  - Apache-2.0
135
134
  metadata: {}
136
- post_install_message:
137
135
  rdoc_options: []
138
136
  require_paths:
139
137
  - lib
@@ -141,15 +139,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
139
  requirements:
142
140
  - - ">="
143
141
  - !ruby/object:Gem::Version
144
- version: '2.7'
142
+ version: '3.0'
145
143
  required_rubygems_version: !ruby/object:Gem::Requirement
146
144
  requirements:
147
145
  - - ">="
148
146
  - !ruby/object:Gem::Version
149
147
  version: '0'
150
148
  requirements: []
151
- rubygems_version: 3.5.6
152
- signing_key:
149
+ rubygems_version: 3.6.2
153
150
  specification_version: 4
154
151
  summary: Manages the execution of large numbers of distributed requests.
155
152
  test_files: []