google-cloud-tasks-v2 1.6.0 → 1.7.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 +4 -4
- data/README.md +0 -4
- data/lib/google/cloud/tasks/v2/bindings_override.rb +1 -1
- data/lib/google/cloud/tasks/v2/cloud_tasks/client.rb +466 -12
- data/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb +1 -1
- data/lib/google/cloud/tasks/v2/cloud_tasks/operations.rb +843 -0
- data/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb +39 -1
- data/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb +438 -12
- data/lib/google/cloud/tasks/v2/cloud_tasks/rest/operations.rb +927 -0
- data/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb +248 -1
- data/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb +2 -1
- data/lib/google/cloud/tasks/v2/cloud_tasks.rb +2 -1
- data/lib/google/cloud/tasks/v2/cloudtasks_pb.rb +15 -1
- data/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb +37 -7
- data/lib/google/cloud/tasks/v2/cmek_config_pb.rb +24 -0
- data/lib/google/cloud/tasks/v2/queue_pb.rb +2 -1
- data/lib/google/cloud/tasks/v2/rest.rb +1 -1
- data/lib/google/cloud/tasks/v2/target_pb.rb +9 -1
- data/lib/google/cloud/tasks/v2/task_pb.rb +3 -1
- data/lib/google/cloud/tasks/v2/version.rb +1 -1
- data/lib/google/cloud/tasks/v2.rb +1 -1
- data/lib/google-cloud-tasks-v2.rb +1 -1
- data/proto_docs/google/api/client.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +1 -1
- data/proto_docs/google/api/field_info.rb +88 -0
- data/proto_docs/google/api/launch_stage.rb +1 -1
- data/proto_docs/google/api/resource.rb +1 -1
- data/proto_docs/google/cloud/tasks/v2/cloudtasks.rb +203 -6
- data/proto_docs/google/cloud/tasks/v2/cmek_config.rb +44 -0
- data/proto_docs/google/cloud/tasks/v2/queue.rb +54 -30
- data/proto_docs/google/cloud/tasks/v2/target.rb +217 -3
- data/proto_docs/google/cloud/tasks/v2/task.rb +13 -1
- data/proto_docs/google/iam/v1/iam_policy.rb +1 -1
- data/proto_docs/google/iam/v1/options.rb +1 -1
- data/proto_docs/google/iam/v1/policy.rb +1 -1
- data/proto_docs/google/longrunning/operations.rb +191 -0
- data/proto_docs/google/protobuf/any.rb +1 -1
- data/proto_docs/google/protobuf/duration.rb +1 -1
- data/proto_docs/google/protobuf/empty.rb +1 -1
- data/proto_docs/google/protobuf/field_mask.rb +1 -1
- data/proto_docs/google/protobuf/timestamp.rb +8 -7
- data/proto_docs/google/rpc/status.rb +1 -1
- data/proto_docs/google/type/expr.rb +1 -1
- metadata +11 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d2f5553c7a5bb49378e43a9515721979892c172d08c41a287b7410dbe096fe5
|
|
4
|
+
data.tar.gz: c87751ed6341679d9932e1b07801c9dd060a88f5200b0646cdc2d77c94ed6bf8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10df1983e0743bcb219b3032723fba5d1e155735a6284788abf52d1daa9b4016e65594675a8308a0713cc4010e2f8440c87f00e676310edda14189fa9c1f19cd
|
|
7
|
+
data.tar.gz: 2e43b75d6e622d9e05f780b3ecb68bf7d51e0a5f6ccbcca16bd18a355d600143f796b1e8a96b9231075a3caa8a7d5468816556b9f095c1d0406b754ac74cf624
|
data/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Manages the execution of large numbers of distributed requests.
|
|
4
4
|
|
|
5
|
-
Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint.
|
|
6
5
|
|
|
7
6
|
https://github.com/googleapis/google-cloud-ruby
|
|
8
7
|
|
|
@@ -40,9 +39,6 @@ response = client.list_queues request
|
|
|
40
39
|
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest)
|
|
41
40
|
for class and method documentation.
|
|
42
41
|
|
|
43
|
-
See also the [Product Documentation](https://cloud.google.com/tasks)
|
|
44
|
-
for general usage information.
|
|
45
|
-
|
|
46
42
|
## Debug Logging
|
|
47
43
|
|
|
48
44
|
This library comes with opt-in Debug Logging that can help you troubleshoot
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -128,6 +128,10 @@ module Google
|
|
|
128
128
|
|
|
129
129
|
default_config.rpcs.run_task.timeout = 20.0
|
|
130
130
|
|
|
131
|
+
default_config.rpcs.update_cmek_config.timeout = 20.0
|
|
132
|
+
|
|
133
|
+
default_config.rpcs.get_cmek_config.timeout = 20.0
|
|
134
|
+
|
|
131
135
|
default_config
|
|
132
136
|
end
|
|
133
137
|
yield @configure if block_given?
|
|
@@ -207,6 +211,13 @@ module Google
|
|
|
207
211
|
@quota_project_id = @config.quota_project
|
|
208
212
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
209
213
|
|
|
214
|
+
@operations_client = Operations.new do |config|
|
|
215
|
+
config.credentials = credentials
|
|
216
|
+
config.quota_project = @quota_project_id
|
|
217
|
+
config.endpoint = @config.endpoint
|
|
218
|
+
config.universe_domain = @config.universe_domain
|
|
219
|
+
end
|
|
220
|
+
|
|
210
221
|
@cloud_tasks_stub = ::Gapic::ServiceStub.new(
|
|
211
222
|
::Google::Cloud::Tasks::V2::CloudTasks::Stub,
|
|
212
223
|
credentials: credentials,
|
|
@@ -238,6 +249,13 @@ module Google
|
|
|
238
249
|
end
|
|
239
250
|
end
|
|
240
251
|
|
|
252
|
+
##
|
|
253
|
+
# Get the associated client for long-running operations.
|
|
254
|
+
#
|
|
255
|
+
# @return [::Google::Cloud::Tasks::V2::CloudTasks::Operations]
|
|
256
|
+
#
|
|
257
|
+
attr_reader :operations_client
|
|
258
|
+
|
|
241
259
|
##
|
|
242
260
|
# Get the associated client for mix-in of the Locations.
|
|
243
261
|
#
|
|
@@ -686,8 +704,15 @@ module Google
|
|
|
686
704
|
#
|
|
687
705
|
# This command will delete the queue even if it has tasks in it.
|
|
688
706
|
#
|
|
689
|
-
# Note: If you delete a queue,
|
|
690
|
-
# for
|
|
707
|
+
# Note: If you delete a queue, you may be prevented from creating a new queue
|
|
708
|
+
# with the same name as the deleted queue for a tombstone window of up to
|
|
709
|
+
# 3 days. During this window, the CreateQueue operation may appear to
|
|
710
|
+
# recreate the queue, but this can be misleading. If you attempt to create
|
|
711
|
+
# a queue with the same name as one that is in the tombstone window, run
|
|
712
|
+
# GetQueue to confirm that the queue creation was successful. If GetQueue
|
|
713
|
+
# returns 200 response code, your queue was successfully created with the
|
|
714
|
+
# name of the previously deleted queue. Otherwise, your queue did not
|
|
715
|
+
# successfully recreate.
|
|
691
716
|
#
|
|
692
717
|
# WARNING: Using this method may have unintended side effects if you are
|
|
693
718
|
# using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
|
|
@@ -1499,6 +1524,10 @@ module Google
|
|
|
1499
1524
|
##
|
|
1500
1525
|
# Gets a task.
|
|
1501
1526
|
#
|
|
1527
|
+
# After a task is successfully executed or has exhausted its retry attempts,
|
|
1528
|
+
# the task is deleted. A `GetTask` request for a deleted task returns a
|
|
1529
|
+
# `NOT_FOUND` error.
|
|
1530
|
+
#
|
|
1502
1531
|
# @overload get_task(request, options = nil)
|
|
1503
1532
|
# Pass arguments to `get_task` via a request object, either of type
|
|
1504
1533
|
# {::Google::Cloud::Tasks::V2::GetTaskRequest} or an equivalent Hash.
|
|
@@ -1641,11 +1670,10 @@ module Google
|
|
|
1641
1670
|
# a task's ID is identical to that of an existing task or a task
|
|
1642
1671
|
# that was deleted or executed recently then the call will fail
|
|
1643
1672
|
# with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
|
|
1644
|
-
#
|
|
1645
|
-
#
|
|
1646
|
-
#
|
|
1647
|
-
#
|
|
1648
|
-
# for ~9days after the original task was deleted or executed.
|
|
1673
|
+
# The IDs of deleted tasks are not immediately available for reuse. It can
|
|
1674
|
+
# take up to 24 hours (or 9 days if the task's queue was created using a
|
|
1675
|
+
# queue.yaml or queue.xml) for the task ID to be released and made available
|
|
1676
|
+
# again.
|
|
1649
1677
|
#
|
|
1650
1678
|
# Because there is an extra lookup cost to identify duplicate task
|
|
1651
1679
|
# names, these {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask}
|
|
@@ -1734,6 +1762,118 @@ module Google
|
|
|
1734
1762
|
raise ::Google::Cloud::Error.from_error(e)
|
|
1735
1763
|
end
|
|
1736
1764
|
|
|
1765
|
+
##
|
|
1766
|
+
# Creates a batch of tasks and adds them to a queue.
|
|
1767
|
+
#
|
|
1768
|
+
# All tasks must be for the same queue.
|
|
1769
|
+
# A maximum of 100 tasks can be created in a single batch.
|
|
1770
|
+
#
|
|
1771
|
+
# @overload batch_create_tasks(request, options = nil)
|
|
1772
|
+
# Pass arguments to `batch_create_tasks` via a request object, either of type
|
|
1773
|
+
# {::Google::Cloud::Tasks::V2::BatchCreateTasksRequest} or an equivalent Hash.
|
|
1774
|
+
#
|
|
1775
|
+
# @param request [::Google::Cloud::Tasks::V2::BatchCreateTasksRequest, ::Hash]
|
|
1776
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1777
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1778
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1779
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1780
|
+
#
|
|
1781
|
+
# @overload batch_create_tasks(parent: nil, requests: nil, request_id: nil)
|
|
1782
|
+
# Pass arguments to `batch_create_tasks` via keyword arguments. Note that at
|
|
1783
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1784
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1785
|
+
#
|
|
1786
|
+
# @param parent [::String]
|
|
1787
|
+
# Required. The queue name. For example:
|
|
1788
|
+
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
|
1789
|
+
#
|
|
1790
|
+
# The queue must already exist.
|
|
1791
|
+
# @param requests [::Array<::Google::Cloud::Tasks::V2::CreateTaskRequest, ::Hash>]
|
|
1792
|
+
# Required. The list of requests to create tasks.
|
|
1793
|
+
# The queue specified in parent field of each CreateTaskRequest will be
|
|
1794
|
+
# the same. This validation happens on the client side as well as in the
|
|
1795
|
+
# handler.
|
|
1796
|
+
# BatchCreateTasksRequest.parent will also be the same value as the
|
|
1797
|
+
# individual CreateTaskRequest.parent.
|
|
1798
|
+
# The maximum number of requests is 100.
|
|
1799
|
+
# @param request_id [::String]
|
|
1800
|
+
# Optional. This field will be used to identify the long running operation,
|
|
1801
|
+
# avoiding duplication when user retries. If not provided, then a UUID will
|
|
1802
|
+
# be generated at server side.
|
|
1803
|
+
#
|
|
1804
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1805
|
+
# @yieldparam response [::Gapic::Operation]
|
|
1806
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1807
|
+
#
|
|
1808
|
+
# @return [::Gapic::Operation]
|
|
1809
|
+
#
|
|
1810
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1811
|
+
#
|
|
1812
|
+
# @example Basic example
|
|
1813
|
+
# require "google/cloud/tasks/v2"
|
|
1814
|
+
#
|
|
1815
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1816
|
+
# client = Google::Cloud::Tasks::V2::CloudTasks::Client.new
|
|
1817
|
+
#
|
|
1818
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1819
|
+
# request = Google::Cloud::Tasks::V2::BatchCreateTasksRequest.new
|
|
1820
|
+
#
|
|
1821
|
+
# # Call the batch_create_tasks method.
|
|
1822
|
+
# result = client.batch_create_tasks request
|
|
1823
|
+
#
|
|
1824
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1825
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1826
|
+
# # Here is how to wait for a response.
|
|
1827
|
+
# result.wait_until_done! timeout: 60
|
|
1828
|
+
# if result.response?
|
|
1829
|
+
# p result.response
|
|
1830
|
+
# else
|
|
1831
|
+
# puts "No response received."
|
|
1832
|
+
# end
|
|
1833
|
+
#
|
|
1834
|
+
def batch_create_tasks request, options = nil
|
|
1835
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1836
|
+
|
|
1837
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::BatchCreateTasksRequest
|
|
1838
|
+
|
|
1839
|
+
# Converts hash and nil to an options object
|
|
1840
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1841
|
+
|
|
1842
|
+
# Customize the options with defaults
|
|
1843
|
+
metadata = @config.rpcs.batch_create_tasks.metadata.to_h
|
|
1844
|
+
|
|
1845
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1846
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1847
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1848
|
+
gapic_version: ::Google::Cloud::Tasks::V2::VERSION
|
|
1849
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1850
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1851
|
+
|
|
1852
|
+
header_params = {}
|
|
1853
|
+
if request.parent
|
|
1854
|
+
header_params["parent"] = request.parent
|
|
1855
|
+
end
|
|
1856
|
+
|
|
1857
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1858
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1859
|
+
|
|
1860
|
+
options.apply_defaults timeout: @config.rpcs.batch_create_tasks.timeout,
|
|
1861
|
+
metadata: metadata,
|
|
1862
|
+
retry_policy: @config.rpcs.batch_create_tasks.retry_policy
|
|
1863
|
+
|
|
1864
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1865
|
+
metadata: @config.metadata,
|
|
1866
|
+
retry_policy: @config.retry_policy
|
|
1867
|
+
|
|
1868
|
+
@cloud_tasks_stub.call_rpc :batch_create_tasks, request, options: options do |response, operation|
|
|
1869
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
1870
|
+
yield response, operation if block_given?
|
|
1871
|
+
throw :response, response
|
|
1872
|
+
end
|
|
1873
|
+
rescue ::GRPC::BadStatus => e
|
|
1874
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1875
|
+
end
|
|
1876
|
+
|
|
1737
1877
|
##
|
|
1738
1878
|
# Deletes a task.
|
|
1739
1879
|
#
|
|
@@ -1824,6 +1964,115 @@ module Google
|
|
|
1824
1964
|
raise ::Google::Cloud::Error.from_error(e)
|
|
1825
1965
|
end
|
|
1826
1966
|
|
|
1967
|
+
##
|
|
1968
|
+
# Deletes a batch of tasks.
|
|
1969
|
+
# This is a non-atomic operation: if deletion fails for some tasks, it
|
|
1970
|
+
# can still succeed for others. The metadata field of
|
|
1971
|
+
# google.longrunning.Operation contains details of failed deletions.
|
|
1972
|
+
# A maximum of 1000 tasks can be deleted in a batch.
|
|
1973
|
+
#
|
|
1974
|
+
# @overload batch_delete_tasks(request, options = nil)
|
|
1975
|
+
# Pass arguments to `batch_delete_tasks` via a request object, either of type
|
|
1976
|
+
# {::Google::Cloud::Tasks::V2::BatchDeleteTasksRequest} or an equivalent Hash.
|
|
1977
|
+
#
|
|
1978
|
+
# @param request [::Google::Cloud::Tasks::V2::BatchDeleteTasksRequest, ::Hash]
|
|
1979
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1980
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1981
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1982
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1983
|
+
#
|
|
1984
|
+
# @overload batch_delete_tasks(parent: nil, names: nil, request_id: nil)
|
|
1985
|
+
# Pass arguments to `batch_delete_tasks` via keyword arguments. Note that at
|
|
1986
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1987
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1988
|
+
#
|
|
1989
|
+
# @param parent [::String]
|
|
1990
|
+
# Required. The queue name. For example:
|
|
1991
|
+
# Format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
|
1992
|
+
# @param names [::Array<::String>]
|
|
1993
|
+
# Required. The names of the tasks to delete.
|
|
1994
|
+
# A maximum of 1000 tasks can be deleted in a batch.
|
|
1995
|
+
# For example:
|
|
1996
|
+
# Format:
|
|
1997
|
+
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
|
|
1998
|
+
# @param request_id [::String]
|
|
1999
|
+
# Optional. This field will be used to identify the long running operation,
|
|
2000
|
+
# avoiding duplication when user retries. If not provided, then a UUID will
|
|
2001
|
+
# be generated at server side.
|
|
2002
|
+
#
|
|
2003
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
2004
|
+
# @yieldparam response [::Gapic::Operation]
|
|
2005
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
2006
|
+
#
|
|
2007
|
+
# @return [::Gapic::Operation]
|
|
2008
|
+
#
|
|
2009
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
2010
|
+
#
|
|
2011
|
+
# @example Basic example
|
|
2012
|
+
# require "google/cloud/tasks/v2"
|
|
2013
|
+
#
|
|
2014
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2015
|
+
# client = Google::Cloud::Tasks::V2::CloudTasks::Client.new
|
|
2016
|
+
#
|
|
2017
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2018
|
+
# request = Google::Cloud::Tasks::V2::BatchDeleteTasksRequest.new
|
|
2019
|
+
#
|
|
2020
|
+
# # Call the batch_delete_tasks method.
|
|
2021
|
+
# result = client.batch_delete_tasks request
|
|
2022
|
+
#
|
|
2023
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
2024
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
2025
|
+
# # Here is how to wait for a response.
|
|
2026
|
+
# result.wait_until_done! timeout: 60
|
|
2027
|
+
# if result.response?
|
|
2028
|
+
# p result.response
|
|
2029
|
+
# else
|
|
2030
|
+
# puts "No response received."
|
|
2031
|
+
# end
|
|
2032
|
+
#
|
|
2033
|
+
def batch_delete_tasks request, options = nil
|
|
2034
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2035
|
+
|
|
2036
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::BatchDeleteTasksRequest
|
|
2037
|
+
|
|
2038
|
+
# Converts hash and nil to an options object
|
|
2039
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2040
|
+
|
|
2041
|
+
# Customize the options with defaults
|
|
2042
|
+
metadata = @config.rpcs.batch_delete_tasks.metadata.to_h
|
|
2043
|
+
|
|
2044
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2045
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2046
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2047
|
+
gapic_version: ::Google::Cloud::Tasks::V2::VERSION
|
|
2048
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2049
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2050
|
+
|
|
2051
|
+
header_params = {}
|
|
2052
|
+
if request.parent
|
|
2053
|
+
header_params["parent"] = request.parent
|
|
2054
|
+
end
|
|
2055
|
+
|
|
2056
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
2057
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
2058
|
+
|
|
2059
|
+
options.apply_defaults timeout: @config.rpcs.batch_delete_tasks.timeout,
|
|
2060
|
+
metadata: metadata,
|
|
2061
|
+
retry_policy: @config.rpcs.batch_delete_tasks.retry_policy
|
|
2062
|
+
|
|
2063
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2064
|
+
metadata: @config.metadata,
|
|
2065
|
+
retry_policy: @config.retry_policy
|
|
2066
|
+
|
|
2067
|
+
@cloud_tasks_stub.call_rpc :batch_delete_tasks, request, options: options do |response, operation|
|
|
2068
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
2069
|
+
yield response, operation if block_given?
|
|
2070
|
+
throw :response, response
|
|
2071
|
+
end
|
|
2072
|
+
rescue ::GRPC::BadStatus => e
|
|
2073
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2074
|
+
end
|
|
2075
|
+
|
|
1827
2076
|
##
|
|
1828
2077
|
# Forces a task to run now.
|
|
1829
2078
|
#
|
|
@@ -1837,10 +2086,6 @@ module Google
|
|
|
1837
2086
|
# retry a failed task after a fix has been made or to manually force a task
|
|
1838
2087
|
# to be dispatched now.
|
|
1839
2088
|
#
|
|
1840
|
-
# The dispatched task is returned. That is, the task that is returned
|
|
1841
|
-
# contains the [status][Task.status] after the task is dispatched but
|
|
1842
|
-
# before the task is received by its target.
|
|
1843
|
-
#
|
|
1844
2089
|
# If Cloud Tasks receives a successful response from the task's
|
|
1845
2090
|
# target, then the task will be deleted; otherwise the task's
|
|
1846
2091
|
# {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} will be reset to
|
|
@@ -1948,6 +2193,187 @@ module Google
|
|
|
1948
2193
|
raise ::Google::Cloud::Error.from_error(e)
|
|
1949
2194
|
end
|
|
1950
2195
|
|
|
2196
|
+
##
|
|
2197
|
+
# Creates or Updates a CMEK config.
|
|
2198
|
+
#
|
|
2199
|
+
# Updates the Customer Managed Encryption Key associated with the Cloud Tasks
|
|
2200
|
+
# location (Creates if the key does not already exist). All new tasks created
|
|
2201
|
+
# in the location will be encrypted at-rest with the KMS-key provided in the
|
|
2202
|
+
# config.
|
|
2203
|
+
#
|
|
2204
|
+
# @overload update_cmek_config(request, options = nil)
|
|
2205
|
+
# Pass arguments to `update_cmek_config` via a request object, either of type
|
|
2206
|
+
# {::Google::Cloud::Tasks::V2::UpdateCmekConfigRequest} or an equivalent Hash.
|
|
2207
|
+
#
|
|
2208
|
+
# @param request [::Google::Cloud::Tasks::V2::UpdateCmekConfigRequest, ::Hash]
|
|
2209
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2210
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2211
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2212
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
2213
|
+
#
|
|
2214
|
+
# @overload update_cmek_config(cmek_config: nil, update_mask: nil)
|
|
2215
|
+
# Pass arguments to `update_cmek_config` via keyword arguments. Note that at
|
|
2216
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2217
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2218
|
+
#
|
|
2219
|
+
# @param cmek_config [::Google::Cloud::Tasks::V2::CmekConfig, ::Hash]
|
|
2220
|
+
# Required. The config to update. Its name attribute distinguishes it.
|
|
2221
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
2222
|
+
# List of fields to be updated in this request.
|
|
2223
|
+
#
|
|
2224
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
2225
|
+
# @yieldparam response [::Google::Cloud::Tasks::V2::CmekConfig]
|
|
2226
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
2227
|
+
#
|
|
2228
|
+
# @return [::Google::Cloud::Tasks::V2::CmekConfig]
|
|
2229
|
+
#
|
|
2230
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
2231
|
+
#
|
|
2232
|
+
# @example Basic example
|
|
2233
|
+
# require "google/cloud/tasks/v2"
|
|
2234
|
+
#
|
|
2235
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2236
|
+
# client = Google::Cloud::Tasks::V2::CloudTasks::Client.new
|
|
2237
|
+
#
|
|
2238
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2239
|
+
# request = Google::Cloud::Tasks::V2::UpdateCmekConfigRequest.new
|
|
2240
|
+
#
|
|
2241
|
+
# # Call the update_cmek_config method.
|
|
2242
|
+
# result = client.update_cmek_config request
|
|
2243
|
+
#
|
|
2244
|
+
# # The returned object is of type Google::Cloud::Tasks::V2::CmekConfig.
|
|
2245
|
+
# p result
|
|
2246
|
+
#
|
|
2247
|
+
def update_cmek_config request, options = nil
|
|
2248
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2249
|
+
|
|
2250
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::UpdateCmekConfigRequest
|
|
2251
|
+
|
|
2252
|
+
# Converts hash and nil to an options object
|
|
2253
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2254
|
+
|
|
2255
|
+
# Customize the options with defaults
|
|
2256
|
+
metadata = @config.rpcs.update_cmek_config.metadata.to_h
|
|
2257
|
+
|
|
2258
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2259
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2260
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2261
|
+
gapic_version: ::Google::Cloud::Tasks::V2::VERSION
|
|
2262
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2263
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2264
|
+
|
|
2265
|
+
header_params = {}
|
|
2266
|
+
if request.cmek_config&.name
|
|
2267
|
+
header_params["cmek_config.name"] = request.cmek_config.name
|
|
2268
|
+
end
|
|
2269
|
+
|
|
2270
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
2271
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
2272
|
+
|
|
2273
|
+
options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout,
|
|
2274
|
+
metadata: metadata,
|
|
2275
|
+
retry_policy: @config.rpcs.update_cmek_config.retry_policy
|
|
2276
|
+
|
|
2277
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2278
|
+
metadata: @config.metadata,
|
|
2279
|
+
retry_policy: @config.retry_policy
|
|
2280
|
+
|
|
2281
|
+
@cloud_tasks_stub.call_rpc :update_cmek_config, request, options: options do |response, operation|
|
|
2282
|
+
yield response, operation if block_given?
|
|
2283
|
+
end
|
|
2284
|
+
rescue ::GRPC::BadStatus => e
|
|
2285
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2286
|
+
end
|
|
2287
|
+
|
|
2288
|
+
##
|
|
2289
|
+
# Gets the CMEK config.
|
|
2290
|
+
#
|
|
2291
|
+
# Gets the Customer Managed Encryption Key configured with the Cloud Tasks
|
|
2292
|
+
# location. By default there is no kms_key configured.
|
|
2293
|
+
#
|
|
2294
|
+
# @overload get_cmek_config(request, options = nil)
|
|
2295
|
+
# Pass arguments to `get_cmek_config` via a request object, either of type
|
|
2296
|
+
# {::Google::Cloud::Tasks::V2::GetCmekConfigRequest} or an equivalent Hash.
|
|
2297
|
+
#
|
|
2298
|
+
# @param request [::Google::Cloud::Tasks::V2::GetCmekConfigRequest, ::Hash]
|
|
2299
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2300
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2301
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2302
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
2303
|
+
#
|
|
2304
|
+
# @overload get_cmek_config(name: nil)
|
|
2305
|
+
# Pass arguments to `get_cmek_config` via keyword arguments. Note that at
|
|
2306
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2307
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2308
|
+
#
|
|
2309
|
+
# @param name [::String]
|
|
2310
|
+
# Required. The config. For example:
|
|
2311
|
+
# `projects/PROJECT_ID/locations/LOCATION_ID/CmekConfig`
|
|
2312
|
+
#
|
|
2313
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
2314
|
+
# @yieldparam response [::Google::Cloud::Tasks::V2::CmekConfig]
|
|
2315
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
2316
|
+
#
|
|
2317
|
+
# @return [::Google::Cloud::Tasks::V2::CmekConfig]
|
|
2318
|
+
#
|
|
2319
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
2320
|
+
#
|
|
2321
|
+
# @example Basic example
|
|
2322
|
+
# require "google/cloud/tasks/v2"
|
|
2323
|
+
#
|
|
2324
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2325
|
+
# client = Google::Cloud::Tasks::V2::CloudTasks::Client.new
|
|
2326
|
+
#
|
|
2327
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2328
|
+
# request = Google::Cloud::Tasks::V2::GetCmekConfigRequest.new
|
|
2329
|
+
#
|
|
2330
|
+
# # Call the get_cmek_config method.
|
|
2331
|
+
# result = client.get_cmek_config request
|
|
2332
|
+
#
|
|
2333
|
+
# # The returned object is of type Google::Cloud::Tasks::V2::CmekConfig.
|
|
2334
|
+
# p result
|
|
2335
|
+
#
|
|
2336
|
+
def get_cmek_config request, options = nil
|
|
2337
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2338
|
+
|
|
2339
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetCmekConfigRequest
|
|
2340
|
+
|
|
2341
|
+
# Converts hash and nil to an options object
|
|
2342
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2343
|
+
|
|
2344
|
+
# Customize the options with defaults
|
|
2345
|
+
metadata = @config.rpcs.get_cmek_config.metadata.to_h
|
|
2346
|
+
|
|
2347
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2348
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2349
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2350
|
+
gapic_version: ::Google::Cloud::Tasks::V2::VERSION
|
|
2351
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2352
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2353
|
+
|
|
2354
|
+
header_params = {}
|
|
2355
|
+
if request.name
|
|
2356
|
+
header_params["name"] = request.name
|
|
2357
|
+
end
|
|
2358
|
+
|
|
2359
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
2360
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
2361
|
+
|
|
2362
|
+
options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout,
|
|
2363
|
+
metadata: metadata,
|
|
2364
|
+
retry_policy: @config.rpcs.get_cmek_config.retry_policy
|
|
2365
|
+
|
|
2366
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2367
|
+
metadata: @config.metadata,
|
|
2368
|
+
retry_policy: @config.retry_policy
|
|
2369
|
+
|
|
2370
|
+
@cloud_tasks_stub.call_rpc :get_cmek_config, request, options: options do |response, operation|
|
|
2371
|
+
yield response, operation if block_given?
|
|
2372
|
+
end
|
|
2373
|
+
rescue ::GRPC::BadStatus => e
|
|
2374
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2375
|
+
end
|
|
2376
|
+
|
|
1951
2377
|
##
|
|
1952
2378
|
# Configuration class for the CloudTasks API.
|
|
1953
2379
|
#
|
|
@@ -2204,15 +2630,35 @@ module Google
|
|
|
2204
2630
|
#
|
|
2205
2631
|
attr_reader :create_task
|
|
2206
2632
|
##
|
|
2633
|
+
# RPC-specific configuration for `batch_create_tasks`
|
|
2634
|
+
# @return [::Gapic::Config::Method]
|
|
2635
|
+
#
|
|
2636
|
+
attr_reader :batch_create_tasks
|
|
2637
|
+
##
|
|
2207
2638
|
# RPC-specific configuration for `delete_task`
|
|
2208
2639
|
# @return [::Gapic::Config::Method]
|
|
2209
2640
|
#
|
|
2210
2641
|
attr_reader :delete_task
|
|
2211
2642
|
##
|
|
2643
|
+
# RPC-specific configuration for `batch_delete_tasks`
|
|
2644
|
+
# @return [::Gapic::Config::Method]
|
|
2645
|
+
#
|
|
2646
|
+
attr_reader :batch_delete_tasks
|
|
2647
|
+
##
|
|
2212
2648
|
# RPC-specific configuration for `run_task`
|
|
2213
2649
|
# @return [::Gapic::Config::Method]
|
|
2214
2650
|
#
|
|
2215
2651
|
attr_reader :run_task
|
|
2652
|
+
##
|
|
2653
|
+
# RPC-specific configuration for `update_cmek_config`
|
|
2654
|
+
# @return [::Gapic::Config::Method]
|
|
2655
|
+
#
|
|
2656
|
+
attr_reader :update_cmek_config
|
|
2657
|
+
##
|
|
2658
|
+
# RPC-specific configuration for `get_cmek_config`
|
|
2659
|
+
# @return [::Gapic::Config::Method]
|
|
2660
|
+
#
|
|
2661
|
+
attr_reader :get_cmek_config
|
|
2216
2662
|
|
|
2217
2663
|
# @private
|
|
2218
2664
|
def initialize parent_rpcs = nil
|
|
@@ -2244,10 +2690,18 @@ module Google
|
|
|
2244
2690
|
@get_task = ::Gapic::Config::Method.new get_task_config
|
|
2245
2691
|
create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task
|
|
2246
2692
|
@create_task = ::Gapic::Config::Method.new create_task_config
|
|
2693
|
+
batch_create_tasks_config = parent_rpcs.batch_create_tasks if parent_rpcs.respond_to? :batch_create_tasks
|
|
2694
|
+
@batch_create_tasks = ::Gapic::Config::Method.new batch_create_tasks_config
|
|
2247
2695
|
delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task
|
|
2248
2696
|
@delete_task = ::Gapic::Config::Method.new delete_task_config
|
|
2697
|
+
batch_delete_tasks_config = parent_rpcs.batch_delete_tasks if parent_rpcs.respond_to? :batch_delete_tasks
|
|
2698
|
+
@batch_delete_tasks = ::Gapic::Config::Method.new batch_delete_tasks_config
|
|
2249
2699
|
run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task
|
|
2250
2700
|
@run_task = ::Gapic::Config::Method.new run_task_config
|
|
2701
|
+
update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config
|
|
2702
|
+
@update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config
|
|
2703
|
+
get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config
|
|
2704
|
+
@get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config
|
|
2251
2705
|
|
|
2252
2706
|
yield self if block_given?
|
|
2253
2707
|
end
|