google-cloud-tasks-v2beta3 0.19.0 → 0.20.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: 32b472b1e322bd36a8d8c5e2eda22fcfe7ab5659047752d4fa65d8fe94221ecf
4
- data.tar.gz: 4220122bd240832d6112b36e75e0d165e6cdf0b2b127a96e1a704de52a4cf9db
3
+ metadata.gz: ce6b9bf4c97e42fc1b916d60232fb7f99f0ebc01b2d592dbb074b9fc8b56eb9e
4
+ data.tar.gz: 7378e8f4109496e221ce0fcc1e882dc9feb1e15925d19adbb6c6c6ae26937e84
5
5
  SHA512:
6
- metadata.gz: b3abafabd2ec548cbbdac3f88258442ce7990907cb552443beaa4fe46577c8e3caf7dbec90fb6d3cc181e4c39d71a1e6f7b213eb55656114c32065da5a9aa119
7
- data.tar.gz: baa93a9539fc1c162b06af1d7f9d2cc36530f2081fd795027699f12fff1d5505fd2944189993119ab68336671240afcd2ff47ac757f3926dbc1614ba3ac32628
6
+ metadata.gz: ef83463f9a3c2dba1b8fb0ef66597458be9db4af8ab0bec9c1384fc56a5cf2ae16c35afa4f8c5de96b9b24e076897cff3302e9decde66c03c875b3ec6df9dc03
7
+ data.tar.gz: 17cd4223a160653abb9383cf1931a8e32472f7f15d806d1af74b1e481fb2095cbb98021ba3ed56b3bdb2c75e2694342572af96d5627d6622359f52bb7c8a988d
@@ -128,6 +128,16 @@ 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
+ default_config.rpcs.update_cmek_config.retry_policy = {
133
+ initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14]
134
+ }
135
+
136
+ default_config.rpcs.get_cmek_config.timeout = 20.0
137
+ default_config.rpcs.get_cmek_config.retry_policy = {
138
+ initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14]
139
+ }
140
+
131
141
  default_config
132
142
  end
133
143
  yield @configure if block_given?
@@ -207,6 +217,13 @@ module Google
207
217
  @quota_project_id = @config.quota_project
208
218
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
209
219
 
220
+ @operations_client = Operations.new do |config|
221
+ config.credentials = credentials
222
+ config.quota_project = @quota_project_id
223
+ config.endpoint = @config.endpoint
224
+ config.universe_domain = @config.universe_domain
225
+ end
226
+
210
227
  @cloud_tasks_stub = ::Gapic::ServiceStub.new(
211
228
  ::Google::Cloud::Tasks::V2beta3::CloudTasks::Stub,
212
229
  credentials: credentials,
@@ -238,6 +255,13 @@ module Google
238
255
  end
239
256
  end
240
257
 
258
+ ##
259
+ # Get the associated client for long-running operations.
260
+ #
261
+ # @return [::Google::Cloud::Tasks::V2beta3::CloudTasks::Operations]
262
+ #
263
+ attr_reader :operations_client
264
+
241
265
  ##
242
266
  # Get the associated client for mix-in of the Locations.
243
267
  #
@@ -698,8 +722,15 @@ module Google
698
722
  #
699
723
  # This command will delete the queue even if it has tasks in it.
700
724
  #
701
- # Note: If you delete a queue, a queue with the same name can't be created
702
- # for 7 days.
725
+ # Note : If you delete a queue, you may be prevented from creating a new
726
+ # queue with the same name as the deleted queue for a tombstone window of up
727
+ # to 3 days. During this window, the CreateQueue operation may appear to
728
+ # recreate the queue, but this can be misleading. If you attempt to create
729
+ # a queue with the same name as one that is in the tombstone window, run
730
+ # GetQueue to confirm that the queue creation was successful. If GetQueue
731
+ # returns 200 response code, your queue was successfully created with the
732
+ # name of the previously deleted queue. Otherwise, your queue did not
733
+ # successfully recreate.
703
734
  #
704
735
  # WARNING: Using this method may have unintended side effects if you are
705
736
  # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
@@ -1513,6 +1544,10 @@ module Google
1513
1544
  ##
1514
1545
  # Gets a task.
1515
1546
  #
1547
+ # After a task is successfully executed or has exhausted its retry attempts,
1548
+ # the task is deleted. A `GetTask` request for a deleted task returns a
1549
+ # `NOT_FOUND` error.
1550
+ #
1516
1551
  # @overload get_task(request, options = nil)
1517
1552
  # Pass arguments to `get_task` via a request object, either of type
1518
1553
  # {::Google::Cloud::Tasks::V2beta3::GetTaskRequest} or an equivalent Hash.
@@ -1656,11 +1691,10 @@ module Google
1656
1691
  # a task's ID is identical to that of an existing task or a task
1657
1692
  # that was deleted or executed recently then the call will fail
1658
1693
  # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1659
- # If the task's queue was created using Cloud Tasks, then another task with
1660
- # the same name can't be created for ~1 hour after the original task was
1661
- # deleted or executed. If the task's queue was created using queue.yaml or
1662
- # queue.xml, then another task with the same name can't be created
1663
- # for ~9 days after the original task was deleted or executed.
1694
+ # The IDs of deleted tasks are not immediately available for reuse. It can
1695
+ # take up to 24 hours (or 9 days if the task's queue was created using a
1696
+ # queue.yaml or queue.xml) for the task ID to be released and made available
1697
+ # again.
1664
1698
  #
1665
1699
  # Because there is an extra lookup cost to identify duplicate task
1666
1700
  # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}
@@ -1750,6 +1784,119 @@ module Google
1750
1784
  raise ::Google::Cloud::Error.from_error(e)
1751
1785
  end
1752
1786
 
1787
+ ##
1788
+ # Creates a batch of tasks and adds them to a queue.
1789
+ # This call is not atomic.
1790
+ #
1791
+ # All tasks must be for the same queue.
1792
+ # A maximum of 100 tasks can be created in a single batch.
1793
+ #
1794
+ # @overload batch_create_tasks(request, options = nil)
1795
+ # Pass arguments to `batch_create_tasks` via a request object, either of type
1796
+ # {::Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest} or an equivalent Hash.
1797
+ #
1798
+ # @param request [::Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest, ::Hash]
1799
+ # A request object representing the call parameters. Required. To specify no
1800
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1801
+ # @param options [::Gapic::CallOptions, ::Hash]
1802
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1803
+ #
1804
+ # @overload batch_create_tasks(parent: nil, requests: nil, request_id: nil)
1805
+ # Pass arguments to `batch_create_tasks` via keyword arguments. Note that at
1806
+ # least one keyword argument is required. To specify no parameters, or to keep all
1807
+ # the default parameter values, pass an empty Hash as a request object (see above).
1808
+ #
1809
+ # @param parent [::String]
1810
+ # Required. The queue name. For example:
1811
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
1812
+ #
1813
+ # The queue must already exist.
1814
+ # @param requests [::Array<::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Hash>]
1815
+ # Required. The list of requests to create tasks.
1816
+ # The queue specified in parent field of each CreateTaskRequest will be
1817
+ # the same. This validation happens on the client side as well as in the
1818
+ # handler.
1819
+ # BatchCreateTasksRequest.parent will also be the same value as the
1820
+ # individual CreateTaskRequest.parent .
1821
+ # The maximum number of requests is 100.
1822
+ # @param request_id [::String]
1823
+ # Optional. This field will be used to identify the long running operation,
1824
+ # avoiding duplication when user retries. If not provided, then a UUID will
1825
+ # be generated at server side.
1826
+ #
1827
+ # @yield [response, operation] Access the result along with the RPC operation
1828
+ # @yieldparam response [::Gapic::Operation]
1829
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1830
+ #
1831
+ # @return [::Gapic::Operation]
1832
+ #
1833
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1834
+ #
1835
+ # @example Basic example
1836
+ # require "google/cloud/tasks/v2beta3"
1837
+ #
1838
+ # # Create a client object. The client can be reused for multiple calls.
1839
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new
1840
+ #
1841
+ # # Create a request. To set request fields, pass in keyword arguments.
1842
+ # request = Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest.new
1843
+ #
1844
+ # # Call the batch_create_tasks method.
1845
+ # result = client.batch_create_tasks request
1846
+ #
1847
+ # # The returned object is of type Gapic::Operation. You can use it to
1848
+ # # check the status of an operation, cancel it, or wait for results.
1849
+ # # Here is how to wait for a response.
1850
+ # result.wait_until_done! timeout: 60
1851
+ # if result.response?
1852
+ # p result.response
1853
+ # else
1854
+ # puts "No response received."
1855
+ # end
1856
+ #
1857
+ def batch_create_tasks request, options = nil
1858
+ raise ::ArgumentError, "request must be provided" if request.nil?
1859
+
1860
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest
1861
+
1862
+ # Converts hash and nil to an options object
1863
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1864
+
1865
+ # Customize the options with defaults
1866
+ metadata = @config.rpcs.batch_create_tasks.metadata.to_h
1867
+
1868
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1869
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1870
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1871
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION
1872
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1873
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1874
+
1875
+ header_params = {}
1876
+ if request.parent
1877
+ header_params["parent"] = request.parent
1878
+ end
1879
+
1880
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1881
+ metadata[:"x-goog-request-params"] ||= request_params_header
1882
+
1883
+ options.apply_defaults timeout: @config.rpcs.batch_create_tasks.timeout,
1884
+ metadata: metadata,
1885
+ retry_policy: @config.rpcs.batch_create_tasks.retry_policy
1886
+
1887
+ options.apply_defaults timeout: @config.timeout,
1888
+ metadata: @config.metadata,
1889
+ retry_policy: @config.retry_policy
1890
+
1891
+ @cloud_tasks_stub.call_rpc :batch_create_tasks, request, options: options do |response, operation|
1892
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1893
+ yield response, operation if block_given?
1894
+ throw :response, response
1895
+ end
1896
+ rescue ::GRPC::BadStatus => e
1897
+ raise ::Google::Cloud::Error.from_error(e)
1898
+ end
1899
+
1753
1900
  ##
1754
1901
  # Deletes a task.
1755
1902
  #
@@ -1840,6 +1987,115 @@ module Google
1840
1987
  raise ::Google::Cloud::Error.from_error(e)
1841
1988
  end
1842
1989
 
1990
+ ##
1991
+ # Deletes a batch of tasks.
1992
+ # This is a non-atomic operation: if deletion fails for some tasks, it
1993
+ # can still succeed for others. The metadata field of
1994
+ # google.longrunning.Operation contains details of failed deletions.
1995
+ # A maximum of 1000 tasks can be deleted in a batch.
1996
+ #
1997
+ # @overload batch_delete_tasks(request, options = nil)
1998
+ # Pass arguments to `batch_delete_tasks` via a request object, either of type
1999
+ # {::Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest} or an equivalent Hash.
2000
+ #
2001
+ # @param request [::Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest, ::Hash]
2002
+ # A request object representing the call parameters. Required. To specify no
2003
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2004
+ # @param options [::Gapic::CallOptions, ::Hash]
2005
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2006
+ #
2007
+ # @overload batch_delete_tasks(parent: nil, names: nil, request_id: nil)
2008
+ # Pass arguments to `batch_delete_tasks` via keyword arguments. Note that at
2009
+ # least one keyword argument is required. To specify no parameters, or to keep all
2010
+ # the default parameter values, pass an empty Hash as a request object (see above).
2011
+ #
2012
+ # @param parent [::String]
2013
+ # Required. The queue name. For example:
2014
+ # Format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
2015
+ # @param names [::Array<::String>]
2016
+ # Required. The names of the tasks to delete.
2017
+ # A maximum of 1000 tasks can be deleted in a batch.
2018
+ # For example:
2019
+ # Format:
2020
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2021
+ # @param request_id [::String]
2022
+ # Optional. This field will be used to identify the long running operation,
2023
+ # avoiding duplication when user retries. If not provided, then a UUID will
2024
+ # be generated at server side.
2025
+ #
2026
+ # @yield [response, operation] Access the result along with the RPC operation
2027
+ # @yieldparam response [::Gapic::Operation]
2028
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2029
+ #
2030
+ # @return [::Gapic::Operation]
2031
+ #
2032
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2033
+ #
2034
+ # @example Basic example
2035
+ # require "google/cloud/tasks/v2beta3"
2036
+ #
2037
+ # # Create a client object. The client can be reused for multiple calls.
2038
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new
2039
+ #
2040
+ # # Create a request. To set request fields, pass in keyword arguments.
2041
+ # request = Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest.new
2042
+ #
2043
+ # # Call the batch_delete_tasks method.
2044
+ # result = client.batch_delete_tasks request
2045
+ #
2046
+ # # The returned object is of type Gapic::Operation. You can use it to
2047
+ # # check the status of an operation, cancel it, or wait for results.
2048
+ # # Here is how to wait for a response.
2049
+ # result.wait_until_done! timeout: 60
2050
+ # if result.response?
2051
+ # p result.response
2052
+ # else
2053
+ # puts "No response received."
2054
+ # end
2055
+ #
2056
+ def batch_delete_tasks request, options = nil
2057
+ raise ::ArgumentError, "request must be provided" if request.nil?
2058
+
2059
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest
2060
+
2061
+ # Converts hash and nil to an options object
2062
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2063
+
2064
+ # Customize the options with defaults
2065
+ metadata = @config.rpcs.batch_delete_tasks.metadata.to_h
2066
+
2067
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2068
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2069
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2070
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION
2071
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2072
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2073
+
2074
+ header_params = {}
2075
+ if request.parent
2076
+ header_params["parent"] = request.parent
2077
+ end
2078
+
2079
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2080
+ metadata[:"x-goog-request-params"] ||= request_params_header
2081
+
2082
+ options.apply_defaults timeout: @config.rpcs.batch_delete_tasks.timeout,
2083
+ metadata: metadata,
2084
+ retry_policy: @config.rpcs.batch_delete_tasks.retry_policy
2085
+
2086
+ options.apply_defaults timeout: @config.timeout,
2087
+ metadata: @config.metadata,
2088
+ retry_policy: @config.retry_policy
2089
+
2090
+ @cloud_tasks_stub.call_rpc :batch_delete_tasks, request, options: options do |response, operation|
2091
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2092
+ yield response, operation if block_given?
2093
+ throw :response, response
2094
+ end
2095
+ rescue ::GRPC::BadStatus => e
2096
+ raise ::Google::Cloud::Error.from_error(e)
2097
+ end
2098
+
1843
2099
  ##
1844
2100
  # Forces a task to run now.
1845
2101
  #
@@ -1854,8 +2110,8 @@ module Google
1854
2110
  # a task to be dispatched now.
1855
2111
  #
1856
2112
  # The dispatched task is returned. That is, the task that is returned
1857
- # contains the [status][Task.status] after the task is dispatched but
1858
- # before the task is received by its target.
2113
+ # contains the {::Google::Cloud::Tasks::V2beta3::Task#first_attempt status} after
2114
+ # the task is dispatched but before the task is received by its target.
1859
2115
  #
1860
2116
  # If Cloud Tasks receives a successful response from the task's
1861
2117
  # target, then the task will be deleted; otherwise the task's
@@ -1966,6 +2222,187 @@ module Google
1966
2222
  raise ::Google::Cloud::Error.from_error(e)
1967
2223
  end
1968
2224
 
2225
+ ##
2226
+ # Creates or Updates a CMEK config.
2227
+ #
2228
+ # Updates the Customer Managed Encryption Key associated with the Cloud Tasks
2229
+ # location (Creates if the key does not already exist). All new tasks created
2230
+ # in the location will be encrypted at-rest with the KMS-key provided in the
2231
+ # config.
2232
+ #
2233
+ # @overload update_cmek_config(request, options = nil)
2234
+ # Pass arguments to `update_cmek_config` via a request object, either of type
2235
+ # {::Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest} or an equivalent Hash.
2236
+ #
2237
+ # @param request [::Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest, ::Hash]
2238
+ # A request object representing the call parameters. Required. To specify no
2239
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2240
+ # @param options [::Gapic::CallOptions, ::Hash]
2241
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2242
+ #
2243
+ # @overload update_cmek_config(cmek_config: nil, update_mask: nil)
2244
+ # Pass arguments to `update_cmek_config` via keyword arguments. Note that at
2245
+ # least one keyword argument is required. To specify no parameters, or to keep all
2246
+ # the default parameter values, pass an empty Hash as a request object (see above).
2247
+ #
2248
+ # @param cmek_config [::Google::Cloud::Tasks::V2beta3::CmekConfig, ::Hash]
2249
+ # Required. The config to update. Its name attribute distinguishes it.
2250
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2251
+ # List of fields to be updated in this request.
2252
+ #
2253
+ # @yield [response, operation] Access the result along with the RPC operation
2254
+ # @yieldparam response [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2255
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2256
+ #
2257
+ # @return [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2258
+ #
2259
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2260
+ #
2261
+ # @example Basic example
2262
+ # require "google/cloud/tasks/v2beta3"
2263
+ #
2264
+ # # Create a client object. The client can be reused for multiple calls.
2265
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new
2266
+ #
2267
+ # # Create a request. To set request fields, pass in keyword arguments.
2268
+ # request = Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest.new
2269
+ #
2270
+ # # Call the update_cmek_config method.
2271
+ # result = client.update_cmek_config request
2272
+ #
2273
+ # # The returned object is of type Google::Cloud::Tasks::V2beta3::CmekConfig.
2274
+ # p result
2275
+ #
2276
+ def update_cmek_config request, options = nil
2277
+ raise ::ArgumentError, "request must be provided" if request.nil?
2278
+
2279
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest
2280
+
2281
+ # Converts hash and nil to an options object
2282
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2283
+
2284
+ # Customize the options with defaults
2285
+ metadata = @config.rpcs.update_cmek_config.metadata.to_h
2286
+
2287
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2288
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2289
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2290
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION
2291
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2292
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2293
+
2294
+ header_params = {}
2295
+ if request.cmek_config&.name
2296
+ header_params["cmek_config.name"] = request.cmek_config.name
2297
+ end
2298
+
2299
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2300
+ metadata[:"x-goog-request-params"] ||= request_params_header
2301
+
2302
+ options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout,
2303
+ metadata: metadata,
2304
+ retry_policy: @config.rpcs.update_cmek_config.retry_policy
2305
+
2306
+ options.apply_defaults timeout: @config.timeout,
2307
+ metadata: @config.metadata,
2308
+ retry_policy: @config.retry_policy
2309
+
2310
+ @cloud_tasks_stub.call_rpc :update_cmek_config, request, options: options do |response, operation|
2311
+ yield response, operation if block_given?
2312
+ end
2313
+ rescue ::GRPC::BadStatus => e
2314
+ raise ::Google::Cloud::Error.from_error(e)
2315
+ end
2316
+
2317
+ ##
2318
+ # Gets the CMEK config.
2319
+ #
2320
+ # Gets the Customer Managed Encryption Key configured with the Cloud Tasks
2321
+ # lcoation. By default there is no kms_key configured.
2322
+ #
2323
+ # @overload get_cmek_config(request, options = nil)
2324
+ # Pass arguments to `get_cmek_config` via a request object, either of type
2325
+ # {::Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest} or an equivalent Hash.
2326
+ #
2327
+ # @param request [::Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest, ::Hash]
2328
+ # A request object representing the call parameters. Required. To specify no
2329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2330
+ # @param options [::Gapic::CallOptions, ::Hash]
2331
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2332
+ #
2333
+ # @overload get_cmek_config(name: nil)
2334
+ # Pass arguments to `get_cmek_config` via keyword arguments. Note that at
2335
+ # least one keyword argument is required. To specify no parameters, or to keep all
2336
+ # the default parameter values, pass an empty Hash as a request object (see above).
2337
+ #
2338
+ # @param name [::String]
2339
+ # Required. The config resource name. For example:
2340
+ # projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig`
2341
+ #
2342
+ # @yield [response, operation] Access the result along with the RPC operation
2343
+ # @yieldparam response [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2345
+ #
2346
+ # @return [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2347
+ #
2348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2349
+ #
2350
+ # @example Basic example
2351
+ # require "google/cloud/tasks/v2beta3"
2352
+ #
2353
+ # # Create a client object. The client can be reused for multiple calls.
2354
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new
2355
+ #
2356
+ # # Create a request. To set request fields, pass in keyword arguments.
2357
+ # request = Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest.new
2358
+ #
2359
+ # # Call the get_cmek_config method.
2360
+ # result = client.get_cmek_config request
2361
+ #
2362
+ # # The returned object is of type Google::Cloud::Tasks::V2beta3::CmekConfig.
2363
+ # p result
2364
+ #
2365
+ def get_cmek_config request, options = nil
2366
+ raise ::ArgumentError, "request must be provided" if request.nil?
2367
+
2368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest
2369
+
2370
+ # Converts hash and nil to an options object
2371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2372
+
2373
+ # Customize the options with defaults
2374
+ metadata = @config.rpcs.get_cmek_config.metadata.to_h
2375
+
2376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2377
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2379
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION
2380
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2381
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2382
+
2383
+ header_params = {}
2384
+ if request.name
2385
+ header_params["name"] = request.name
2386
+ end
2387
+
2388
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2389
+ metadata[:"x-goog-request-params"] ||= request_params_header
2390
+
2391
+ options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout,
2392
+ metadata: metadata,
2393
+ retry_policy: @config.rpcs.get_cmek_config.retry_policy
2394
+
2395
+ options.apply_defaults timeout: @config.timeout,
2396
+ metadata: @config.metadata,
2397
+ retry_policy: @config.retry_policy
2398
+
2399
+ @cloud_tasks_stub.call_rpc :get_cmek_config, request, options: options do |response, operation|
2400
+ yield response, operation if block_given?
2401
+ end
2402
+ rescue ::GRPC::BadStatus => e
2403
+ raise ::Google::Cloud::Error.from_error(e)
2404
+ end
2405
+
1969
2406
  ##
1970
2407
  # Configuration class for the CloudTasks API.
1971
2408
  #
@@ -2222,15 +2659,35 @@ module Google
2222
2659
  #
2223
2660
  attr_reader :create_task
2224
2661
  ##
2662
+ # RPC-specific configuration for `batch_create_tasks`
2663
+ # @return [::Gapic::Config::Method]
2664
+ #
2665
+ attr_reader :batch_create_tasks
2666
+ ##
2225
2667
  # RPC-specific configuration for `delete_task`
2226
2668
  # @return [::Gapic::Config::Method]
2227
2669
  #
2228
2670
  attr_reader :delete_task
2229
2671
  ##
2672
+ # RPC-specific configuration for `batch_delete_tasks`
2673
+ # @return [::Gapic::Config::Method]
2674
+ #
2675
+ attr_reader :batch_delete_tasks
2676
+ ##
2230
2677
  # RPC-specific configuration for `run_task`
2231
2678
  # @return [::Gapic::Config::Method]
2232
2679
  #
2233
2680
  attr_reader :run_task
2681
+ ##
2682
+ # RPC-specific configuration for `update_cmek_config`
2683
+ # @return [::Gapic::Config::Method]
2684
+ #
2685
+ attr_reader :update_cmek_config
2686
+ ##
2687
+ # RPC-specific configuration for `get_cmek_config`
2688
+ # @return [::Gapic::Config::Method]
2689
+ #
2690
+ attr_reader :get_cmek_config
2234
2691
 
2235
2692
  # @private
2236
2693
  def initialize parent_rpcs = nil
@@ -2262,10 +2719,18 @@ module Google
2262
2719
  @get_task = ::Gapic::Config::Method.new get_task_config
2263
2720
  create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task
2264
2721
  @create_task = ::Gapic::Config::Method.new create_task_config
2722
+ batch_create_tasks_config = parent_rpcs.batch_create_tasks if parent_rpcs.respond_to? :batch_create_tasks
2723
+ @batch_create_tasks = ::Gapic::Config::Method.new batch_create_tasks_config
2265
2724
  delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task
2266
2725
  @delete_task = ::Gapic::Config::Method.new delete_task_config
2726
+ batch_delete_tasks_config = parent_rpcs.batch_delete_tasks if parent_rpcs.respond_to? :batch_delete_tasks
2727
+ @batch_delete_tasks = ::Gapic::Config::Method.new batch_delete_tasks_config
2267
2728
  run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task
2268
2729
  @run_task = ::Gapic::Config::Method.new run_task_config
2730
+ update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config
2731
+ @update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config
2732
+ get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config
2733
+ @get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config
2269
2734
 
2270
2735
  yield self if block_given?
2271
2736
  end