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.
@@ -24,6 +24,44 @@ module Google
24
24
  module CloudTasks
25
25
  # Path helper methods for the CloudTasks API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified CmekConfig resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/cmekConfig`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ #
37
+ # @return [::String]
38
+ def cmek_config_path project:, location:
39
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/locations/#{location}/cmekConfig"
42
+ end
43
+
44
+ ##
45
+ # Create a fully-qualified CryptoKey resource string.
46
+ #
47
+ # The resource will be in the following format:
48
+ #
49
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
50
+ #
51
+ # @param project [String]
52
+ # @param location [String]
53
+ # @param key_ring [String]
54
+ # @param crypto_key [String]
55
+ #
56
+ # @return [::String]
57
+ def crypto_key_path project:, location:, key_ring:, crypto_key:
58
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
59
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
60
+ raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
61
+
62
+ "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
63
+ end
64
+
27
65
  ##
28
66
  # Create a fully-qualified Location resource string.
29
67
  #
@@ -130,6 +130,16 @@ module Google
130
130
 
131
131
  default_config.rpcs.run_task.timeout = 20.0
132
132
 
133
+ default_config.rpcs.update_cmek_config.timeout = 20.0
134
+ default_config.rpcs.update_cmek_config.retry_policy = {
135
+ initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14]
136
+ }
137
+
138
+ default_config.rpcs.get_cmek_config.timeout = 20.0
139
+ default_config.rpcs.get_cmek_config.retry_policy = {
140
+ initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14]
141
+ }
142
+
133
143
  default_config
134
144
  end
135
145
  yield @configure if block_given?
@@ -204,6 +214,13 @@ module Google
204
214
  @quota_project_id = @config.quota_project
205
215
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
206
216
 
217
+ @operations_client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Operations.new do |config|
218
+ config.credentials = credentials
219
+ config.quota_project = @quota_project_id
220
+ config.endpoint = @config.endpoint
221
+ config.universe_domain = @config.universe_domain
222
+ end
223
+
207
224
  @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.new(
208
225
  endpoint: @config.endpoint,
209
226
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
@@ -232,6 +249,13 @@ module Google
232
249
  end
233
250
  end
234
251
 
252
+ ##
253
+ # Get the associated client for long-running operations.
254
+ #
255
+ # @return [::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Operations]
256
+ #
257
+ attr_reader :operations_client
258
+
235
259
  ##
236
260
  # Get the associated client for mix-in of the Locations.
237
261
  #
@@ -664,8 +688,15 @@ module Google
664
688
  #
665
689
  # This command will delete the queue even if it has tasks in it.
666
690
  #
667
- # Note: If you delete a queue, a queue with the same name can't be created
668
- # for 7 days.
691
+ # Note : If you delete a queue, you may be prevented from creating a new
692
+ # queue with the same name as the deleted queue for a tombstone window of up
693
+ # to 3 days. During this window, the CreateQueue operation may appear to
694
+ # recreate the queue, but this can be misleading. If you attempt to create
695
+ # a queue with the same name as one that is in the tombstone window, run
696
+ # GetQueue to confirm that the queue creation was successful. If GetQueue
697
+ # returns 200 response code, your queue was successfully created with the
698
+ # name of the previously deleted queue. Otherwise, your queue did not
699
+ # successfully recreate.
669
700
  #
670
701
  # WARNING: Using this method may have unintended side effects if you are
671
702
  # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
@@ -1423,6 +1454,10 @@ module Google
1423
1454
  ##
1424
1455
  # Gets a task.
1425
1456
  #
1457
+ # After a task is successfully executed or has exhausted its retry attempts,
1458
+ # the task is deleted. A `GetTask` request for a deleted task returns a
1459
+ # `NOT_FOUND` error.
1460
+ #
1426
1461
  # @overload get_task(request, options = nil)
1427
1462
  # Pass arguments to `get_task` via a request object, either of type
1428
1463
  # {::Google::Cloud::Tasks::V2beta3::GetTaskRequest} or an equivalent Hash.
@@ -1559,11 +1594,10 @@ module Google
1559
1594
  # a task's ID is identical to that of an existing task or a task
1560
1595
  # that was deleted or executed recently then the call will fail
1561
1596
  # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1562
- # If the task's queue was created using Cloud Tasks, then another task with
1563
- # the same name can't be created for ~1 hour after the original task was
1564
- # deleted or executed. If the task's queue was created using queue.yaml or
1565
- # queue.xml, then another task with the same name can't be created
1566
- # for ~9 days after the original task was deleted or executed.
1597
+ # The IDs of deleted tasks are not immediately available for reuse. It can
1598
+ # take up to 24 hours (or 9 days if the task's queue was created using a
1599
+ # queue.yaml or queue.xml) for the task ID to be released and made available
1600
+ # again.
1567
1601
  #
1568
1602
  # Because there is an extra lookup cost to identify duplicate task
1569
1603
  # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#create_task CreateTask}
@@ -1646,6 +1680,112 @@ module Google
1646
1680
  raise ::Google::Cloud::Error.from_error(e)
1647
1681
  end
1648
1682
 
1683
+ ##
1684
+ # Creates a batch of tasks and adds them to a queue.
1685
+ # This call is not atomic.
1686
+ #
1687
+ # All tasks must be for the same queue.
1688
+ # A maximum of 100 tasks can be created in a single batch.
1689
+ #
1690
+ # @overload batch_create_tasks(request, options = nil)
1691
+ # Pass arguments to `batch_create_tasks` via a request object, either of type
1692
+ # {::Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest} or an equivalent Hash.
1693
+ #
1694
+ # @param request [::Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest, ::Hash]
1695
+ # A request object representing the call parameters. Required. To specify no
1696
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1697
+ # @param options [::Gapic::CallOptions, ::Hash]
1698
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1699
+ #
1700
+ # @overload batch_create_tasks(parent: nil, requests: nil, request_id: nil)
1701
+ # Pass arguments to `batch_create_tasks` via keyword arguments. Note that at
1702
+ # least one keyword argument is required. To specify no parameters, or to keep all
1703
+ # the default parameter values, pass an empty Hash as a request object (see above).
1704
+ #
1705
+ # @param parent [::String]
1706
+ # Required. The queue name. For example:
1707
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
1708
+ #
1709
+ # The queue must already exist.
1710
+ # @param requests [::Array<::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Hash>]
1711
+ # Required. The list of requests to create tasks.
1712
+ # The queue specified in parent field of each CreateTaskRequest will be
1713
+ # the same. This validation happens on the client side as well as in the
1714
+ # handler.
1715
+ # BatchCreateTasksRequest.parent will also be the same value as the
1716
+ # individual CreateTaskRequest.parent .
1717
+ # The maximum number of requests is 100.
1718
+ # @param request_id [::String]
1719
+ # Optional. This field will be used to identify the long running operation,
1720
+ # avoiding duplication when user retries. If not provided, then a UUID will
1721
+ # be generated at server side.
1722
+ # @yield [result, operation] Access the result along with the TransportOperation object
1723
+ # @yieldparam result [::Gapic::Operation]
1724
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1725
+ #
1726
+ # @return [::Gapic::Operation]
1727
+ #
1728
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1729
+ #
1730
+ # @example Basic example
1731
+ # require "google/cloud/tasks/v2beta3"
1732
+ #
1733
+ # # Create a client object. The client can be reused for multiple calls.
1734
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
1735
+ #
1736
+ # # Create a request. To set request fields, pass in keyword arguments.
1737
+ # request = Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest.new
1738
+ #
1739
+ # # Call the batch_create_tasks method.
1740
+ # result = client.batch_create_tasks request
1741
+ #
1742
+ # # The returned object is of type Gapic::Operation. You can use it to
1743
+ # # check the status of an operation, cancel it, or wait for results.
1744
+ # # Here is how to wait for a response.
1745
+ # result.wait_until_done! timeout: 60
1746
+ # if result.response?
1747
+ # p result.response
1748
+ # else
1749
+ # puts "No response received."
1750
+ # end
1751
+ #
1752
+ def batch_create_tasks request, options = nil
1753
+ raise ::ArgumentError, "request must be provided" if request.nil?
1754
+
1755
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BatchCreateTasksRequest
1756
+
1757
+ # Converts hash and nil to an options object
1758
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1759
+
1760
+ # Customize the options with defaults
1761
+ call_metadata = @config.rpcs.batch_create_tasks.metadata.to_h
1762
+
1763
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1764
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1766
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION,
1767
+ transports_version_send: [:rest]
1768
+
1769
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1770
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1771
+
1772
+ options.apply_defaults timeout: @config.rpcs.batch_create_tasks.timeout,
1773
+ metadata: call_metadata,
1774
+ retry_policy: @config.rpcs.batch_create_tasks.retry_policy
1775
+
1776
+ options.apply_defaults timeout: @config.timeout,
1777
+ metadata: @config.metadata,
1778
+ retry_policy: @config.retry_policy
1779
+
1780
+ @cloud_tasks_stub.batch_create_tasks request, options do |result, operation|
1781
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1782
+ yield result, operation if block_given?
1783
+ throw :response, result
1784
+ end
1785
+ rescue ::Gapic::Rest::Error => e
1786
+ raise ::Google::Cloud::Error.from_error(e)
1787
+ end
1788
+
1649
1789
  ##
1650
1790
  # Deletes a task.
1651
1791
  #
@@ -1729,6 +1869,108 @@ module Google
1729
1869
  raise ::Google::Cloud::Error.from_error(e)
1730
1870
  end
1731
1871
 
1872
+ ##
1873
+ # Deletes a batch of tasks.
1874
+ # This is a non-atomic operation: if deletion fails for some tasks, it
1875
+ # can still succeed for others. The metadata field of
1876
+ # google.longrunning.Operation contains details of failed deletions.
1877
+ # A maximum of 1000 tasks can be deleted in a batch.
1878
+ #
1879
+ # @overload batch_delete_tasks(request, options = nil)
1880
+ # Pass arguments to `batch_delete_tasks` via a request object, either of type
1881
+ # {::Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest} or an equivalent Hash.
1882
+ #
1883
+ # @param request [::Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest, ::Hash]
1884
+ # A request object representing the call parameters. Required. To specify no
1885
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1886
+ # @param options [::Gapic::CallOptions, ::Hash]
1887
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1888
+ #
1889
+ # @overload batch_delete_tasks(parent: nil, names: nil, request_id: nil)
1890
+ # Pass arguments to `batch_delete_tasks` via keyword arguments. Note that at
1891
+ # least one keyword argument is required. To specify no parameters, or to keep all
1892
+ # the default parameter values, pass an empty Hash as a request object (see above).
1893
+ #
1894
+ # @param parent [::String]
1895
+ # Required. The queue name. For example:
1896
+ # Format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
1897
+ # @param names [::Array<::String>]
1898
+ # Required. The names of the tasks to delete.
1899
+ # A maximum of 1000 tasks can be deleted in a batch.
1900
+ # For example:
1901
+ # Format:
1902
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1903
+ # @param request_id [::String]
1904
+ # Optional. This field will be used to identify the long running operation,
1905
+ # avoiding duplication when user retries. If not provided, then a UUID will
1906
+ # be generated at server side.
1907
+ # @yield [result, operation] Access the result along with the TransportOperation object
1908
+ # @yieldparam result [::Gapic::Operation]
1909
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1910
+ #
1911
+ # @return [::Gapic::Operation]
1912
+ #
1913
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1914
+ #
1915
+ # @example Basic example
1916
+ # require "google/cloud/tasks/v2beta3"
1917
+ #
1918
+ # # Create a client object. The client can be reused for multiple calls.
1919
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
1920
+ #
1921
+ # # Create a request. To set request fields, pass in keyword arguments.
1922
+ # request = Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest.new
1923
+ #
1924
+ # # Call the batch_delete_tasks method.
1925
+ # result = client.batch_delete_tasks request
1926
+ #
1927
+ # # The returned object is of type Gapic::Operation. You can use it to
1928
+ # # check the status of an operation, cancel it, or wait for results.
1929
+ # # Here is how to wait for a response.
1930
+ # result.wait_until_done! timeout: 60
1931
+ # if result.response?
1932
+ # p result.response
1933
+ # else
1934
+ # puts "No response received."
1935
+ # end
1936
+ #
1937
+ def batch_delete_tasks request, options = nil
1938
+ raise ::ArgumentError, "request must be provided" if request.nil?
1939
+
1940
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BatchDeleteTasksRequest
1941
+
1942
+ # Converts hash and nil to an options object
1943
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1944
+
1945
+ # Customize the options with defaults
1946
+ call_metadata = @config.rpcs.batch_delete_tasks.metadata.to_h
1947
+
1948
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1949
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1950
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1951
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION,
1952
+ transports_version_send: [:rest]
1953
+
1954
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1955
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1956
+
1957
+ options.apply_defaults timeout: @config.rpcs.batch_delete_tasks.timeout,
1958
+ metadata: call_metadata,
1959
+ retry_policy: @config.rpcs.batch_delete_tasks.retry_policy
1960
+
1961
+ options.apply_defaults timeout: @config.timeout,
1962
+ metadata: @config.metadata,
1963
+ retry_policy: @config.retry_policy
1964
+
1965
+ @cloud_tasks_stub.batch_delete_tasks request, options do |result, operation|
1966
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1967
+ yield result, operation if block_given?
1968
+ throw :response, result
1969
+ end
1970
+ rescue ::Gapic::Rest::Error => e
1971
+ raise ::Google::Cloud::Error.from_error(e)
1972
+ end
1973
+
1732
1974
  ##
1733
1975
  # Forces a task to run now.
1734
1976
  #
@@ -1743,8 +1985,8 @@ module Google
1743
1985
  # a task to be dispatched now.
1744
1986
  #
1745
1987
  # The dispatched task is returned. That is, the task that is returned
1746
- # contains the [status][Task.status] after the task is dispatched but
1747
- # before the task is received by its target.
1988
+ # contains the {::Google::Cloud::Tasks::V2beta3::Task#first_attempt status} after
1989
+ # the task is dispatched but before the task is received by its target.
1748
1990
  #
1749
1991
  # If Cloud Tasks receives a successful response from the task's
1750
1992
  # target, then the task will be deleted; otherwise the task's
@@ -1848,6 +2090,173 @@ module Google
1848
2090
  raise ::Google::Cloud::Error.from_error(e)
1849
2091
  end
1850
2092
 
2093
+ ##
2094
+ # Creates or Updates a CMEK config.
2095
+ #
2096
+ # Updates the Customer Managed Encryption Key associated with the Cloud Tasks
2097
+ # location (Creates if the key does not already exist). All new tasks created
2098
+ # in the location will be encrypted at-rest with the KMS-key provided in the
2099
+ # config.
2100
+ #
2101
+ # @overload update_cmek_config(request, options = nil)
2102
+ # Pass arguments to `update_cmek_config` via a request object, either of type
2103
+ # {::Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest} or an equivalent Hash.
2104
+ #
2105
+ # @param request [::Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest, ::Hash]
2106
+ # A request object representing the call parameters. Required. To specify no
2107
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2108
+ # @param options [::Gapic::CallOptions, ::Hash]
2109
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2110
+ #
2111
+ # @overload update_cmek_config(cmek_config: nil, update_mask: nil)
2112
+ # Pass arguments to `update_cmek_config` via keyword arguments. Note that at
2113
+ # least one keyword argument is required. To specify no parameters, or to keep all
2114
+ # the default parameter values, pass an empty Hash as a request object (see above).
2115
+ #
2116
+ # @param cmek_config [::Google::Cloud::Tasks::V2beta3::CmekConfig, ::Hash]
2117
+ # Required. The config to update. Its name attribute distinguishes it.
2118
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2119
+ # List of fields to be updated in this request.
2120
+ # @yield [result, operation] Access the result along with the TransportOperation object
2121
+ # @yieldparam result [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2122
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2123
+ #
2124
+ # @return [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2125
+ #
2126
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2127
+ #
2128
+ # @example Basic example
2129
+ # require "google/cloud/tasks/v2beta3"
2130
+ #
2131
+ # # Create a client object. The client can be reused for multiple calls.
2132
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
2133
+ #
2134
+ # # Create a request. To set request fields, pass in keyword arguments.
2135
+ # request = Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest.new
2136
+ #
2137
+ # # Call the update_cmek_config method.
2138
+ # result = client.update_cmek_config request
2139
+ #
2140
+ # # The returned object is of type Google::Cloud::Tasks::V2beta3::CmekConfig.
2141
+ # p result
2142
+ #
2143
+ def update_cmek_config request, options = nil
2144
+ raise ::ArgumentError, "request must be provided" if request.nil?
2145
+
2146
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::UpdateCmekConfigRequest
2147
+
2148
+ # Converts hash and nil to an options object
2149
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2150
+
2151
+ # Customize the options with defaults
2152
+ call_metadata = @config.rpcs.update_cmek_config.metadata.to_h
2153
+
2154
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2155
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2156
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2157
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION,
2158
+ transports_version_send: [:rest]
2159
+
2160
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2161
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2162
+
2163
+ options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout,
2164
+ metadata: call_metadata,
2165
+ retry_policy: @config.rpcs.update_cmek_config.retry_policy
2166
+
2167
+ options.apply_defaults timeout: @config.timeout,
2168
+ metadata: @config.metadata,
2169
+ retry_policy: @config.retry_policy
2170
+
2171
+ @cloud_tasks_stub.update_cmek_config request, options do |result, operation|
2172
+ yield result, operation if block_given?
2173
+ end
2174
+ rescue ::Gapic::Rest::Error => e
2175
+ raise ::Google::Cloud::Error.from_error(e)
2176
+ end
2177
+
2178
+ ##
2179
+ # Gets the CMEK config.
2180
+ #
2181
+ # Gets the Customer Managed Encryption Key configured with the Cloud Tasks
2182
+ # lcoation. By default there is no kms_key configured.
2183
+ #
2184
+ # @overload get_cmek_config(request, options = nil)
2185
+ # Pass arguments to `get_cmek_config` via a request object, either of type
2186
+ # {::Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest} or an equivalent Hash.
2187
+ #
2188
+ # @param request [::Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest, ::Hash]
2189
+ # A request object representing the call parameters. Required. To specify no
2190
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2191
+ # @param options [::Gapic::CallOptions, ::Hash]
2192
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2193
+ #
2194
+ # @overload get_cmek_config(name: nil)
2195
+ # Pass arguments to `get_cmek_config` via keyword arguments. Note that at
2196
+ # least one keyword argument is required. To specify no parameters, or to keep all
2197
+ # the default parameter values, pass an empty Hash as a request object (see above).
2198
+ #
2199
+ # @param name [::String]
2200
+ # Required. The config resource name. For example:
2201
+ # projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig`
2202
+ # @yield [result, operation] Access the result along with the TransportOperation object
2203
+ # @yieldparam result [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2204
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2205
+ #
2206
+ # @return [::Google::Cloud::Tasks::V2beta3::CmekConfig]
2207
+ #
2208
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2209
+ #
2210
+ # @example Basic example
2211
+ # require "google/cloud/tasks/v2beta3"
2212
+ #
2213
+ # # Create a client object. The client can be reused for multiple calls.
2214
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
2215
+ #
2216
+ # # Create a request. To set request fields, pass in keyword arguments.
2217
+ # request = Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest.new
2218
+ #
2219
+ # # Call the get_cmek_config method.
2220
+ # result = client.get_cmek_config request
2221
+ #
2222
+ # # The returned object is of type Google::Cloud::Tasks::V2beta3::CmekConfig.
2223
+ # p result
2224
+ #
2225
+ def get_cmek_config request, options = nil
2226
+ raise ::ArgumentError, "request must be provided" if request.nil?
2227
+
2228
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetCmekConfigRequest
2229
+
2230
+ # Converts hash and nil to an options object
2231
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2232
+
2233
+ # Customize the options with defaults
2234
+ call_metadata = @config.rpcs.get_cmek_config.metadata.to_h
2235
+
2236
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2237
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2238
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2239
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION,
2240
+ transports_version_send: [:rest]
2241
+
2242
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2243
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2244
+
2245
+ options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout,
2246
+ metadata: call_metadata,
2247
+ retry_policy: @config.rpcs.get_cmek_config.retry_policy
2248
+
2249
+ options.apply_defaults timeout: @config.timeout,
2250
+ metadata: @config.metadata,
2251
+ retry_policy: @config.retry_policy
2252
+
2253
+ @cloud_tasks_stub.get_cmek_config request, options do |result, operation|
2254
+ yield result, operation if block_given?
2255
+ end
2256
+ rescue ::Gapic::Rest::Error => e
2257
+ raise ::Google::Cloud::Error.from_error(e)
2258
+ end
2259
+
1851
2260
  ##
1852
2261
  # Configuration class for the CloudTasks REST API.
1853
2262
  #
@@ -2074,15 +2483,35 @@ module Google
2074
2483
  #
2075
2484
  attr_reader :create_task
2076
2485
  ##
2486
+ # RPC-specific configuration for `batch_create_tasks`
2487
+ # @return [::Gapic::Config::Method]
2488
+ #
2489
+ attr_reader :batch_create_tasks
2490
+ ##
2077
2491
  # RPC-specific configuration for `delete_task`
2078
2492
  # @return [::Gapic::Config::Method]
2079
2493
  #
2080
2494
  attr_reader :delete_task
2081
2495
  ##
2496
+ # RPC-specific configuration for `batch_delete_tasks`
2497
+ # @return [::Gapic::Config::Method]
2498
+ #
2499
+ attr_reader :batch_delete_tasks
2500
+ ##
2082
2501
  # RPC-specific configuration for `run_task`
2083
2502
  # @return [::Gapic::Config::Method]
2084
2503
  #
2085
2504
  attr_reader :run_task
2505
+ ##
2506
+ # RPC-specific configuration for `update_cmek_config`
2507
+ # @return [::Gapic::Config::Method]
2508
+ #
2509
+ attr_reader :update_cmek_config
2510
+ ##
2511
+ # RPC-specific configuration for `get_cmek_config`
2512
+ # @return [::Gapic::Config::Method]
2513
+ #
2514
+ attr_reader :get_cmek_config
2086
2515
 
2087
2516
  # @private
2088
2517
  def initialize parent_rpcs = nil
@@ -2114,10 +2543,18 @@ module Google
2114
2543
  @get_task = ::Gapic::Config::Method.new get_task_config
2115
2544
  create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task
2116
2545
  @create_task = ::Gapic::Config::Method.new create_task_config
2546
+ batch_create_tasks_config = parent_rpcs.batch_create_tasks if parent_rpcs.respond_to? :batch_create_tasks
2547
+ @batch_create_tasks = ::Gapic::Config::Method.new batch_create_tasks_config
2117
2548
  delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task
2118
2549
  @delete_task = ::Gapic::Config::Method.new delete_task_config
2550
+ batch_delete_tasks_config = parent_rpcs.batch_delete_tasks if parent_rpcs.respond_to? :batch_delete_tasks
2551
+ @batch_delete_tasks = ::Gapic::Config::Method.new batch_delete_tasks_config
2119
2552
  run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task
2120
2553
  @run_task = ::Gapic::Config::Method.new run_task_config
2554
+ update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config
2555
+ @update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config
2556
+ get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config
2557
+ @get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config
2121
2558
 
2122
2559
  yield self if block_given?
2123
2560
  end