google-api-client 0.13.6 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +56 -0
  3. data/generated/google/apis/adsense_v1_4.rb +1 -1
  4. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  5. data/generated/google/apis/androiddeviceprovisioning_v1.rb +3 -3
  6. data/generated/google/apis/androiddeviceprovisioning_v1/service.rb +3 -3
  7. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  8. data/generated/google/apis/androidmanagement_v1.rb +1 -1
  9. data/generated/google/apis/androidmanagement_v1/classes.rb +8 -0
  10. data/generated/google/apis/androidmanagement_v1/representations.rb +1 -0
  11. data/generated/google/apis/androidpublisher_v1.rb +1 -1
  12. data/generated/google/apis/androidpublisher_v1_1.rb +1 -1
  13. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  14. data/generated/google/apis/androidpublisher_v2/classes.rb +1 -0
  15. data/generated/google/apis/androidpublisher_v2/service.rb +1 -1
  16. data/generated/google/apis/appstate_v1.rb +1 -1
  17. data/generated/google/apis/bigquery_v2.rb +1 -1
  18. data/generated/google/apis/bigquery_v2/classes.rb +6 -0
  19. data/generated/google/apis/bigquery_v2/representations.rb +1 -0
  20. data/generated/google/apis/bigquerydatatransfer_v1.rb +2 -2
  21. data/generated/google/apis/bigquerydatatransfer_v1/classes.rb +19 -69
  22. data/generated/google/apis/bigquerydatatransfer_v1/representations.rb +3 -41
  23. data/generated/google/apis/bigquerydatatransfer_v1/service.rb +17 -149
  24. data/generated/google/apis/calendar_v3.rb +1 -1
  25. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  26. data/generated/google/apis/cloudfunctions_v1.rb +1 -1
  27. data/generated/google/apis/cloudfunctions_v1/classes.rb +7 -0
  28. data/generated/google/apis/cloudfunctions_v1/representations.rb +1 -0
  29. data/generated/google/apis/cloudfunctions_v1beta2.rb +1 -1
  30. data/generated/google/apis/cloudfunctions_v1beta2/classes.rb +30 -0
  31. data/generated/google/apis/cloudfunctions_v1beta2/representations.rb +4 -0
  32. data/generated/google/apis/{toolresults_v1beta3firstparty.rb → cloudtasks_v2beta2.rb} +13 -9
  33. data/generated/google/apis/cloudtasks_v2beta2/classes.rb +1709 -0
  34. data/generated/google/apis/cloudtasks_v2beta2/representations.rb +585 -0
  35. data/generated/google/apis/cloudtasks_v2beta2/service.rb +1016 -0
  36. data/generated/google/apis/cloudtrace_v2.rb +1 -4
  37. data/generated/google/apis/cloudtrace_v2/classes.rb +0 -78
  38. data/generated/google/apis/cloudtrace_v2/representations.rb +0 -43
  39. data/generated/google/apis/cloudtrace_v2/service.rb +0 -101
  40. data/generated/google/apis/compute_alpha.rb +1 -1
  41. data/generated/google/apis/compute_alpha/classes.rb +833 -120
  42. data/generated/google/apis/compute_alpha/representations.rb +263 -26
  43. data/generated/google/apis/compute_alpha/service.rb +795 -107
  44. data/generated/google/apis/compute_beta.rb +1 -1
  45. data/generated/google/apis/compute_beta/classes.rb +5329 -524
  46. data/generated/google/apis/compute_beta/representations.rb +2241 -36
  47. data/generated/google/apis/compute_beta/service.rb +5 -5
  48. data/generated/google/apis/compute_v1.rb +1 -1
  49. data/generated/google/apis/compute_v1/classes.rb +4 -5
  50. data/generated/google/apis/container_v1.rb +1 -1
  51. data/generated/google/apis/container_v1/classes.rb +12 -0
  52. data/generated/google/apis/container_v1/representations.rb +1 -0
  53. data/generated/google/apis/container_v1beta1.rb +1 -1
  54. data/generated/google/apis/container_v1beta1/classes.rb +54 -0
  55. data/generated/google/apis/container_v1beta1/representations.rb +18 -0
  56. data/generated/google/apis/content_v2.rb +1 -1
  57. data/generated/google/apis/content_v2sandbox.rb +1 -1
  58. data/generated/google/apis/dataflow_v1b3.rb +1 -1
  59. data/generated/google/apis/dataflow_v1b3/classes.rb +6 -39
  60. data/generated/google/apis/dataflow_v1b3/representations.rb +1 -16
  61. data/generated/google/apis/deploymentmanager_alpha.rb +1 -1
  62. data/generated/google/apis/deploymentmanager_alpha/classes.rb +71 -3
  63. data/generated/google/apis/deploymentmanager_alpha/representations.rb +32 -0
  64. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  65. data/generated/google/apis/deploymentmanager_v2/service.rb +1 -1
  66. data/generated/google/apis/deploymentmanager_v2beta.rb +1 -1
  67. data/generated/google/apis/deploymentmanager_v2beta/classes.rb +39 -3
  68. data/generated/google/apis/deploymentmanager_v2beta/representations.rb +16 -0
  69. data/generated/google/apis/dlp_v2beta1.rb +1 -1
  70. data/generated/google/apis/dlp_v2beta1/classes.rb +1605 -49
  71. data/generated/google/apis/dlp_v2beta1/representations.rb +832 -30
  72. data/generated/google/apis/dlp_v2beta1/service.rb +62 -0
  73. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  74. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  75. data/generated/google/apis/games_management_v1management.rb +1 -1
  76. data/generated/google/apis/games_v1.rb +1 -1
  77. data/generated/google/apis/gmail_v1.rb +1 -1
  78. data/generated/google/apis/gmail_v1/classes.rb +0 -36
  79. data/generated/google/apis/gmail_v1/representations.rb +0 -16
  80. data/generated/google/apis/language_v1.rb +1 -1
  81. data/generated/google/apis/language_v1/classes.rb +74 -0
  82. data/generated/google/apis/language_v1/representations.rb +35 -0
  83. data/generated/google/apis/language_v1/service.rb +31 -0
  84. data/generated/google/apis/language_v1beta1.rb +1 -1
  85. data/generated/google/apis/language_v1beta2.rb +1 -1
  86. data/generated/google/apis/ml_v1.rb +1 -1
  87. data/generated/google/apis/ml_v1/classes.rb +3 -0
  88. data/generated/google/apis/people_v1.rb +1 -1
  89. data/generated/google/apis/people_v1/classes.rb +8 -0
  90. data/generated/google/apis/people_v1/representations.rb +1 -0
  91. data/generated/google/apis/plus_domains_v1/service.rb +1 -1
  92. data/generated/google/apis/plus_v1/service.rb +1 -1
  93. data/generated/google/apis/servicecontrol_v1.rb +1 -1
  94. data/generated/google/apis/servicecontrol_v1/classes.rb +35 -6
  95. data/generated/google/apis/servicecontrol_v1/representations.rb +16 -1
  96. data/generated/google/apis/servicemanagement_v1.rb +1 -1
  97. data/generated/google/apis/servicemanagement_v1/classes.rb +1 -1
  98. data/generated/google/apis/serviceuser_v1.rb +1 -1
  99. data/generated/google/apis/serviceuser_v1/classes.rb +1 -1
  100. data/generated/google/apis/sourcerepo_v1.rb +4 -1
  101. data/generated/google/apis/sourcerepo_v1/classes.rb +45 -204
  102. data/generated/google/apis/sourcerepo_v1/representations.rb +10 -90
  103. data/generated/google/apis/storage_v1beta1.rb +1 -1
  104. data/generated/google/apis/storage_v1beta1/service.rb +1 -1
  105. data/generated/google/apis/storage_v1beta2.rb +1 -1
  106. data/generated/google/apis/storage_v1beta2/service.rb +1 -1
  107. data/generated/google/apis/streetviewpublish_v1.rb +1 -1
  108. data/generated/google/apis/streetviewpublish_v1/classes.rb +5 -3
  109. data/generated/google/apis/streetviewpublish_v1/service.rb +6 -4
  110. data/generated/google/apis/toolresults_v1beta3.rb +1 -1
  111. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  112. data/generated/google/apis/youtube_analytics_v1beta1.rb +1 -1
  113. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  114. data/generated/google/apis/youtube_v3.rb +1 -1
  115. data/generated/google/apis/youtube_v3/classes.rb +22 -85
  116. data/generated/google/apis/youtube_v3/representations.rb +3 -46
  117. data/generated/google/apis/youtube_v3/service.rb +11 -1
  118. data/lib/google/apis/version.rb +1 -1
  119. metadata +6 -6
  120. data/generated/google/apis/toolresults_v1beta3firstparty/classes.rb +0 -2630
  121. data/generated/google/apis/toolresults_v1beta3firstparty/representations.rb +0 -886
  122. data/generated/google/apis/toolresults_v1beta3firstparty/service.rb +0 -1336
@@ -0,0 +1,1016 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CloudtasksV2beta2
23
+ # Cloud Tasks API
24
+ #
25
+ # Manages the execution of large numbers of distributed requests. Cloud Tasks is
26
+ # in Alpha.
27
+ #
28
+ # @example
29
+ # require 'google/apis/cloudtasks_v2beta2'
30
+ #
31
+ # Cloudtasks = Google::Apis::CloudtasksV2beta2 # Alias the module
32
+ # service = Cloudtasks::CloudTasksService.new
33
+ #
34
+ # @see https://cloud.google.com/cloud-tasks/
35
+ class CloudTasksService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://cloudtasks.googleapis.com/', '')
48
+ @batch_path = 'batch'
49
+ end
50
+
51
+ # Get information about a location.
52
+ # @param [String] name
53
+ # Resource name for the location.
54
+ # @param [String] fields
55
+ # Selector specifying which fields to include in a partial response.
56
+ # @param [String] quota_user
57
+ # Available to use for quota purposes for server-side applications. Can be any
58
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
59
+ # @param [Google::Apis::RequestOptions] options
60
+ # Request-specific options
61
+ #
62
+ # @yield [result, err] Result & error if block supplied
63
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Location] parsed result object
64
+ # @yieldparam err [StandardError] error object if request failed
65
+ #
66
+ # @return [Google::Apis::CloudtasksV2beta2::Location]
67
+ #
68
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
69
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
70
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
71
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
72
+ command = make_simple_command(:get, 'v2beta2/{+name}', options)
73
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Location::Representation
74
+ command.response_class = Google::Apis::CloudtasksV2beta2::Location
75
+ command.params['name'] = name unless name.nil?
76
+ command.query['fields'] = fields unless fields.nil?
77
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
78
+ execute_or_queue_command(command, &block)
79
+ end
80
+
81
+ # Lists information about the supported locations for this service.
82
+ # @param [String] name
83
+ # The resource that owns the locations collection, if applicable.
84
+ # @param [String] filter
85
+ # The standard list filter.
86
+ # @param [Fixnum] page_size
87
+ # The standard list page size.
88
+ # @param [String] page_token
89
+ # The standard list page token.
90
+ # @param [String] fields
91
+ # Selector specifying which fields to include in a partial response.
92
+ # @param [String] quota_user
93
+ # Available to use for quota purposes for server-side applications. Can be any
94
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
95
+ # @param [Google::Apis::RequestOptions] options
96
+ # Request-specific options
97
+ #
98
+ # @yield [result, err] Result & error if block supplied
99
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::ListLocationsResponse] parsed result object
100
+ # @yieldparam err [StandardError] error object if request failed
101
+ #
102
+ # @return [Google::Apis::CloudtasksV2beta2::ListLocationsResponse]
103
+ #
104
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
105
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
106
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
107
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
108
+ command = make_simple_command(:get, 'v2beta2/{+name}/locations', options)
109
+ command.response_representation = Google::Apis::CloudtasksV2beta2::ListLocationsResponse::Representation
110
+ command.response_class = Google::Apis::CloudtasksV2beta2::ListLocationsResponse
111
+ command.params['name'] = name unless name.nil?
112
+ command.query['filter'] = filter unless filter.nil?
113
+ command.query['pageSize'] = page_size unless page_size.nil?
114
+ command.query['pageToken'] = page_token unless page_token.nil?
115
+ command.query['fields'] = fields unless fields.nil?
116
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
117
+ execute_or_queue_command(command, &block)
118
+ end
119
+
120
+ # Creates a queue.
121
+ # WARNING: This method is only available to whitelisted
122
+ # users. Using this method carries some risk. Read
123
+ # [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)
124
+ # carefully and then sign up for
125
+ # [whitelist access to this method](https://goo.gl/Fe5mUy).
126
+ # @param [String] parent
127
+ # Required.
128
+ # The location name in which the queue will be created.
129
+ # For example: `projects/PROJECT_ID/locations/LOCATION_ID`
130
+ # The list of allowed locations can be obtained by calling Cloud
131
+ # Tasks' implementation of
132
+ # google.cloud.location.Locations.ListLocations.
133
+ # @param [Google::Apis::CloudtasksV2beta2::Queue] queue_object
134
+ # @param [String] fields
135
+ # Selector specifying which fields to include in a partial response.
136
+ # @param [String] quota_user
137
+ # Available to use for quota purposes for server-side applications. Can be any
138
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
139
+ # @param [Google::Apis::RequestOptions] options
140
+ # Request-specific options
141
+ #
142
+ # @yield [result, err] Result & error if block supplied
143
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Queue] parsed result object
144
+ # @yieldparam err [StandardError] error object if request failed
145
+ #
146
+ # @return [Google::Apis::CloudtasksV2beta2::Queue]
147
+ #
148
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
149
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
150
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
151
+ def create_project_location_queue(parent, queue_object = nil, fields: nil, quota_user: nil, options: nil, &block)
152
+ command = make_simple_command(:post, 'v2beta2/{+parent}/queues', options)
153
+ command.request_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
154
+ command.request_object = queue_object
155
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
156
+ command.response_class = Google::Apis::CloudtasksV2beta2::Queue
157
+ command.params['parent'] = parent unless parent.nil?
158
+ command.query['fields'] = fields unless fields.nil?
159
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
160
+ execute_or_queue_command(command, &block)
161
+ end
162
+
163
+ # Deletes a queue.
164
+ # This command will delete the queue even if it has tasks in it.
165
+ # Note: If you delete a queue, a queue with the same name can't be created
166
+ # for 7 days.
167
+ # WARNING: This method is only available to whitelisted
168
+ # users. Using this method carries some risk. Read
169
+ # [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)
170
+ # carefully and then sign up for
171
+ # [whitelist access to this method](https://goo.gl/Fe5mUy).
172
+ # @param [String] name
173
+ # Required.
174
+ # The queue name. For example:
175
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
176
+ # @param [String] fields
177
+ # Selector specifying which fields to include in a partial response.
178
+ # @param [String] quota_user
179
+ # Available to use for quota purposes for server-side applications. Can be any
180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
181
+ # @param [Google::Apis::RequestOptions] options
182
+ # Request-specific options
183
+ #
184
+ # @yield [result, err] Result & error if block supplied
185
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Empty] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::CloudtasksV2beta2::Empty]
189
+ #
190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
193
+ def delete_project_location_queue(name, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:delete, 'v2beta2/{+name}', options)
195
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Empty::Representation
196
+ command.response_class = Google::Apis::CloudtasksV2beta2::Empty
197
+ command.params['name'] = name unless name.nil?
198
+ command.query['fields'] = fields unless fields.nil?
199
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
200
+ execute_or_queue_command(command, &block)
201
+ end
202
+
203
+ # Gets a queue.
204
+ # @param [String] name
205
+ # Required.
206
+ # The resource name of the queue. For example:
207
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
208
+ # @param [String] fields
209
+ # Selector specifying which fields to include in a partial response.
210
+ # @param [String] quota_user
211
+ # Available to use for quota purposes for server-side applications. Can be any
212
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
213
+ # @param [Google::Apis::RequestOptions] options
214
+ # Request-specific options
215
+ #
216
+ # @yield [result, err] Result & error if block supplied
217
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Queue] parsed result object
218
+ # @yieldparam err [StandardError] error object if request failed
219
+ #
220
+ # @return [Google::Apis::CloudtasksV2beta2::Queue]
221
+ #
222
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
223
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
224
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
225
+ def get_project_location_queue(name, fields: nil, quota_user: nil, options: nil, &block)
226
+ command = make_simple_command(:get, 'v2beta2/{+name}', options)
227
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
228
+ command.response_class = Google::Apis::CloudtasksV2beta2::Queue
229
+ command.params['name'] = name unless name.nil?
230
+ command.query['fields'] = fields unless fields.nil?
231
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
232
+ execute_or_queue_command(command, &block)
233
+ end
234
+
235
+ # Gets the access control policy for a Queue.
236
+ # Returns an empty policy if the resource exists and does not have a policy
237
+ # set.
238
+ # Authorization requires the following [Google IAM](/iam) permission on the
239
+ # specified resource parent:
240
+ # * `cloudtasks.queues.getIamPolicy`
241
+ # @param [String] resource
242
+ # REQUIRED: The resource for which the policy is being requested.
243
+ # See the operation documentation for the appropriate value for this field.
244
+ # @param [Google::Apis::CloudtasksV2beta2::GetIamPolicyRequest] get_iam_policy_request_object
245
+ # @param [String] fields
246
+ # Selector specifying which fields to include in a partial response.
247
+ # @param [String] quota_user
248
+ # Available to use for quota purposes for server-side applications. Can be any
249
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
250
+ # @param [Google::Apis::RequestOptions] options
251
+ # Request-specific options
252
+ #
253
+ # @yield [result, err] Result & error if block supplied
254
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Policy] parsed result object
255
+ # @yieldparam err [StandardError] error object if request failed
256
+ #
257
+ # @return [Google::Apis::CloudtasksV2beta2::Policy]
258
+ #
259
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
260
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
261
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
262
+ def get_queue_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
263
+ command = make_simple_command(:post, 'v2beta2/{+resource}:getIamPolicy', options)
264
+ command.request_representation = Google::Apis::CloudtasksV2beta2::GetIamPolicyRequest::Representation
265
+ command.request_object = get_iam_policy_request_object
266
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Policy::Representation
267
+ command.response_class = Google::Apis::CloudtasksV2beta2::Policy
268
+ command.params['resource'] = resource unless resource.nil?
269
+ command.query['fields'] = fields unless fields.nil?
270
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
271
+ execute_or_queue_command(command, &block)
272
+ end
273
+
274
+ # Lists queues.
275
+ # Queues are returned in lexicographical order.
276
+ # @param [String] parent
277
+ # Required.
278
+ # The location name.
279
+ # For example: `projects/PROJECT_ID/locations/LOCATION_ID`
280
+ # @param [String] filter
281
+ # `filter` can be used to specify a subset of queues. Any Queue
282
+ # field can be used as a filter and several operators as supported.
283
+ # For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as
284
+ # described in
285
+ # [Stackdriver's Advanced Logs Filters](/logging/docs/view/advanced_filters).
286
+ # Sample filter "app_engine_http_target: *".
287
+ # Note that using filters might cause fewer queues than the
288
+ # requested_page size to be returned.
289
+ # @param [Fixnum] page_size
290
+ # Requested page size.
291
+ # The maximum page size is 9800. If unspecified, the page size will
292
+ # be the maximum. Fewer queues than requested might be returned,
293
+ # even if more queues exist; use
294
+ # ListQueuesResponse.next_page_token to determine if more
295
+ # queues exist.
296
+ # @param [String] page_token
297
+ # A token identifying the page of results to return.
298
+ # To request the first page results, page_token must be empty. To
299
+ # request the next page of results, page_token must be the value of
300
+ # ListQueuesResponse.next_page_token returned from the previous
301
+ # call to CloudTasks.ListQueues method. It is an error to
302
+ # switch the value of ListQueuesRequest.filter while iterating
303
+ # through pages.
304
+ # @param [String] fields
305
+ # Selector specifying which fields to include in a partial response.
306
+ # @param [String] quota_user
307
+ # Available to use for quota purposes for server-side applications. Can be any
308
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
309
+ # @param [Google::Apis::RequestOptions] options
310
+ # Request-specific options
311
+ #
312
+ # @yield [result, err] Result & error if block supplied
313
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::ListQueuesResponse] parsed result object
314
+ # @yieldparam err [StandardError] error object if request failed
315
+ #
316
+ # @return [Google::Apis::CloudtasksV2beta2::ListQueuesResponse]
317
+ #
318
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
319
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
320
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
321
+ def list_project_location_queues(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
322
+ command = make_simple_command(:get, 'v2beta2/{+parent}/queues', options)
323
+ command.response_representation = Google::Apis::CloudtasksV2beta2::ListQueuesResponse::Representation
324
+ command.response_class = Google::Apis::CloudtasksV2beta2::ListQueuesResponse
325
+ command.params['parent'] = parent unless parent.nil?
326
+ command.query['filter'] = filter unless filter.nil?
327
+ command.query['pageSize'] = page_size unless page_size.nil?
328
+ command.query['pageToken'] = page_token unless page_token.nil?
329
+ command.query['fields'] = fields unless fields.nil?
330
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
331
+ execute_or_queue_command(command, &block)
332
+ end
333
+
334
+ # Updates a queue.
335
+ # This method creates the queue if it does not exist and updates
336
+ # the queue if it does exist.
337
+ # WARNING: This method is only available to whitelisted
338
+ # users. Using this method carries some risk. Read
339
+ # [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)
340
+ # carefully and then sign up for
341
+ # [whitelist access to this method](https://goo.gl/Fe5mUy).
342
+ # @param [String] name
343
+ # The queue name.
344
+ # The queue name must have the following format:
345
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
346
+ # * `PROJECT_ID` can contain uppercase and lowercase letters,
347
+ # numbers, hyphens, colons, and periods; that is, it must match
348
+ # the regular expression: `[a-zA-Z\\d-:\\.]+`.
349
+ # * `QUEUE_ID` can contain uppercase and lowercase letters,
350
+ # numbers, and hyphens; that is, it must match the regular
351
+ # expression: `[a-zA-Z\\d-]+`. The maximum length is 100
352
+ # characters.
353
+ # Caller-specified and required in CreateQueueRequest, after which
354
+ # it becomes output only.
355
+ # @param [Google::Apis::CloudtasksV2beta2::Queue] queue_object
356
+ # @param [String] update_mask
357
+ # A mask used to specify which fields of the queue are being updated.
358
+ # If empty, then all fields will be updated.
359
+ # @param [String] fields
360
+ # Selector specifying which fields to include in a partial response.
361
+ # @param [String] quota_user
362
+ # Available to use for quota purposes for server-side applications. Can be any
363
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
364
+ # @param [Google::Apis::RequestOptions] options
365
+ # Request-specific options
366
+ #
367
+ # @yield [result, err] Result & error if block supplied
368
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Queue] parsed result object
369
+ # @yieldparam err [StandardError] error object if request failed
370
+ #
371
+ # @return [Google::Apis::CloudtasksV2beta2::Queue]
372
+ #
373
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
374
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
375
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
376
+ def patch_project_location_queue(name, queue_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
377
+ command = make_simple_command(:patch, 'v2beta2/{+name}', options)
378
+ command.request_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
379
+ command.request_object = queue_object
380
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
381
+ command.response_class = Google::Apis::CloudtasksV2beta2::Queue
382
+ command.params['name'] = name unless name.nil?
383
+ command.query['updateMask'] = update_mask unless update_mask.nil?
384
+ command.query['fields'] = fields unless fields.nil?
385
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
386
+ execute_or_queue_command(command, &block)
387
+ end
388
+
389
+ # Pauses the queue.
390
+ # If a queue is paused then the system will stop executing the
391
+ # tasks in the queue until it is resumed via
392
+ # CloudTasks.ResumeQueue. Tasks can still be added when the
393
+ # queue is paused. The state of the queue is stored in
394
+ # Queue.queue_state; if paused it will be set to
395
+ # Queue.QueueState.PAUSED.
396
+ # WARNING: This method is only available to whitelisted
397
+ # users. Using this method carries some risk. Read
398
+ # [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)
399
+ # carefully and then sign up for
400
+ # [whitelist access to this method](https://goo.gl/Fe5mUy).
401
+ # @param [String] name
402
+ # Required.
403
+ # The queue name. For example:
404
+ # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
405
+ # @param [Google::Apis::CloudtasksV2beta2::PauseQueueRequest] pause_queue_request_object
406
+ # @param [String] fields
407
+ # Selector specifying which fields to include in a partial response.
408
+ # @param [String] quota_user
409
+ # Available to use for quota purposes for server-side applications. Can be any
410
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
411
+ # @param [Google::Apis::RequestOptions] options
412
+ # Request-specific options
413
+ #
414
+ # @yield [result, err] Result & error if block supplied
415
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Queue] parsed result object
416
+ # @yieldparam err [StandardError] error object if request failed
417
+ #
418
+ # @return [Google::Apis::CloudtasksV2beta2::Queue]
419
+ #
420
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
421
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
422
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
423
+ def pause_queue(name, pause_queue_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
424
+ command = make_simple_command(:post, 'v2beta2/{+name}:pause', options)
425
+ command.request_representation = Google::Apis::CloudtasksV2beta2::PauseQueueRequest::Representation
426
+ command.request_object = pause_queue_request_object
427
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
428
+ command.response_class = Google::Apis::CloudtasksV2beta2::Queue
429
+ command.params['name'] = name unless name.nil?
430
+ command.query['fields'] = fields unless fields.nil?
431
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
432
+ execute_or_queue_command(command, &block)
433
+ end
434
+
435
+ # Purges a queue by deleting all of its tasks.
436
+ # All tasks created before this method is called are permanently deleted.
437
+ # Purge operations can take up to one minute to take effect. Tasks
438
+ # might be dispatched before the purge takes effect. A purge is irreversible.
439
+ # @param [String] name
440
+ # Required.
441
+ # The queue name. For example:
442
+ # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
443
+ # @param [Google::Apis::CloudtasksV2beta2::PurgeQueueRequest] purge_queue_request_object
444
+ # @param [String] fields
445
+ # Selector specifying which fields to include in a partial response.
446
+ # @param [String] quota_user
447
+ # Available to use for quota purposes for server-side applications. Can be any
448
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
449
+ # @param [Google::Apis::RequestOptions] options
450
+ # Request-specific options
451
+ #
452
+ # @yield [result, err] Result & error if block supplied
453
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Queue] parsed result object
454
+ # @yieldparam err [StandardError] error object if request failed
455
+ #
456
+ # @return [Google::Apis::CloudtasksV2beta2::Queue]
457
+ #
458
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
459
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
460
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
461
+ def purge_queue(name, purge_queue_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
462
+ command = make_simple_command(:post, 'v2beta2/{+name}:purge', options)
463
+ command.request_representation = Google::Apis::CloudtasksV2beta2::PurgeQueueRequest::Representation
464
+ command.request_object = purge_queue_request_object
465
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
466
+ command.response_class = Google::Apis::CloudtasksV2beta2::Queue
467
+ command.params['name'] = name unless name.nil?
468
+ command.query['fields'] = fields unless fields.nil?
469
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
470
+ execute_or_queue_command(command, &block)
471
+ end
472
+
473
+ # Resume a queue.
474
+ # This method resumes a queue after it has been
475
+ # Queue.QueueState.PAUSED or Queue.QueueState.DISABLED. The state of
476
+ # a queue is stored in Queue.queue_state; after calling this method it
477
+ # will be set to Queue.QueueState.RUNNING.
478
+ # WARNING: This method is only available to whitelisted
479
+ # users. Using this method carries some risk. Read
480
+ # [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)
481
+ # carefully and then sign up for
482
+ # [whitelist access to this method](https://goo.gl/Fe5mUy).
483
+ # WARNING: Resuming many high-QPS queues at the same time can
484
+ # lead to target overloading. If you are resuming high-QPS
485
+ # queues, follow the 500/50/5 pattern described in
486
+ # [Managing Cloud Tasks Scaling Risks](/cloud-tasks/pdfs/managing-cloud-tasks-
487
+ # scaling-risks-2017-06-05.pdf).
488
+ # @param [String] name
489
+ # Required.
490
+ # The queue name. For example:
491
+ # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
492
+ # @param [Google::Apis::CloudtasksV2beta2::ResumeQueueRequest] resume_queue_request_object
493
+ # @param [String] fields
494
+ # Selector specifying which fields to include in a partial response.
495
+ # @param [String] quota_user
496
+ # Available to use for quota purposes for server-side applications. Can be any
497
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
498
+ # @param [Google::Apis::RequestOptions] options
499
+ # Request-specific options
500
+ #
501
+ # @yield [result, err] Result & error if block supplied
502
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Queue] parsed result object
503
+ # @yieldparam err [StandardError] error object if request failed
504
+ #
505
+ # @return [Google::Apis::CloudtasksV2beta2::Queue]
506
+ #
507
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
508
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
509
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
510
+ def resume_queue(name, resume_queue_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
511
+ command = make_simple_command(:post, 'v2beta2/{+name}:resume', options)
512
+ command.request_representation = Google::Apis::CloudtasksV2beta2::ResumeQueueRequest::Representation
513
+ command.request_object = resume_queue_request_object
514
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Queue::Representation
515
+ command.response_class = Google::Apis::CloudtasksV2beta2::Queue
516
+ command.params['name'] = name unless name.nil?
517
+ command.query['fields'] = fields unless fields.nil?
518
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
519
+ execute_or_queue_command(command, &block)
520
+ end
521
+
522
+ # Sets the access control policy for a Queue. Replaces any existing
523
+ # policy.
524
+ # Authorization requires the following [Google IAM](/iam) permission on the
525
+ # specified resource parent:
526
+ # * `cloudtasks.queues.setIamPolicy`
527
+ # @param [String] resource
528
+ # REQUIRED: The resource for which the policy is being specified.
529
+ # See the operation documentation for the appropriate value for this field.
530
+ # @param [Google::Apis::CloudtasksV2beta2::SetIamPolicyRequest] set_iam_policy_request_object
531
+ # @param [String] fields
532
+ # Selector specifying which fields to include in a partial response.
533
+ # @param [String] quota_user
534
+ # Available to use for quota purposes for server-side applications. Can be any
535
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
536
+ # @param [Google::Apis::RequestOptions] options
537
+ # Request-specific options
538
+ #
539
+ # @yield [result, err] Result & error if block supplied
540
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Policy] parsed result object
541
+ # @yieldparam err [StandardError] error object if request failed
542
+ #
543
+ # @return [Google::Apis::CloudtasksV2beta2::Policy]
544
+ #
545
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
546
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
547
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
548
+ def set_queue_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
549
+ command = make_simple_command(:post, 'v2beta2/{+resource}:setIamPolicy', options)
550
+ command.request_representation = Google::Apis::CloudtasksV2beta2::SetIamPolicyRequest::Representation
551
+ command.request_object = set_iam_policy_request_object
552
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Policy::Representation
553
+ command.response_class = Google::Apis::CloudtasksV2beta2::Policy
554
+ command.params['resource'] = resource unless resource.nil?
555
+ command.query['fields'] = fields unless fields.nil?
556
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
557
+ execute_or_queue_command(command, &block)
558
+ end
559
+
560
+ # Returns permissions that a caller has on a Queue.
561
+ # If the resource does not exist, this will return an empty set of
562
+ # permissions, not a google.rpc.Code.NOT_FOUND error.
563
+ # Note: This operation is designed to be used for building permission-aware
564
+ # UIs and command-line tools, not for authorization checking. This operation
565
+ # may "fail open" without warning.
566
+ # @param [String] resource
567
+ # REQUIRED: The resource for which the policy detail is being requested.
568
+ # See the operation documentation for the appropriate value for this field.
569
+ # @param [Google::Apis::CloudtasksV2beta2::TestIamPermissionsRequest] test_iam_permissions_request_object
570
+ # @param [String] fields
571
+ # Selector specifying which fields to include in a partial response.
572
+ # @param [String] quota_user
573
+ # Available to use for quota purposes for server-side applications. Can be any
574
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
575
+ # @param [Google::Apis::RequestOptions] options
576
+ # Request-specific options
577
+ #
578
+ # @yield [result, err] Result & error if block supplied
579
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::TestIamPermissionsResponse] parsed result object
580
+ # @yieldparam err [StandardError] error object if request failed
581
+ #
582
+ # @return [Google::Apis::CloudtasksV2beta2::TestIamPermissionsResponse]
583
+ #
584
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
585
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
586
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
587
+ def test_queue_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
588
+ command = make_simple_command(:post, 'v2beta2/{+resource}:testIamPermissions', options)
589
+ command.request_representation = Google::Apis::CloudtasksV2beta2::TestIamPermissionsRequest::Representation
590
+ command.request_object = test_iam_permissions_request_object
591
+ command.response_representation = Google::Apis::CloudtasksV2beta2::TestIamPermissionsResponse::Representation
592
+ command.response_class = Google::Apis::CloudtasksV2beta2::TestIamPermissionsResponse
593
+ command.params['resource'] = resource unless resource.nil?
594
+ command.query['fields'] = fields unless fields.nil?
595
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
596
+ execute_or_queue_command(command, &block)
597
+ end
598
+
599
+ # Acknowledges a pull task.
600
+ # The lease holder, that is, the entity that received this task in
601
+ # a PullTasksResponse, must call this method to indicate that
602
+ # the work associated with the task has finished.
603
+ # The lease holder must acknowledge a task within the
604
+ # PullTasksRequest.lease_duration or the lease will expire and
605
+ # the task will become ready to be returned in a different
606
+ # PullTasksResponse. After the task is acknowledged, it will
607
+ # not be returned by a later CloudTasks.PullTasks,
608
+ # CloudTasks.GetTask, or CloudTasks.ListTasks.
609
+ # @param [String] name
610
+ # Required.
611
+ # The task name. For example:
612
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
613
+ # @param [Google::Apis::CloudtasksV2beta2::AcknowledgeTaskRequest] acknowledge_task_request_object
614
+ # @param [String] fields
615
+ # Selector specifying which fields to include in a partial response.
616
+ # @param [String] quota_user
617
+ # Available to use for quota purposes for server-side applications. Can be any
618
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
619
+ # @param [Google::Apis::RequestOptions] options
620
+ # Request-specific options
621
+ #
622
+ # @yield [result, err] Result & error if block supplied
623
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Empty] parsed result object
624
+ # @yieldparam err [StandardError] error object if request failed
625
+ #
626
+ # @return [Google::Apis::CloudtasksV2beta2::Empty]
627
+ #
628
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
629
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
630
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
631
+ def acknowledge_task(name, acknowledge_task_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
632
+ command = make_simple_command(:post, 'v2beta2/{+name}:acknowledge', options)
633
+ command.request_representation = Google::Apis::CloudtasksV2beta2::AcknowledgeTaskRequest::Representation
634
+ command.request_object = acknowledge_task_request_object
635
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Empty::Representation
636
+ command.response_class = Google::Apis::CloudtasksV2beta2::Empty
637
+ command.params['name'] = name unless name.nil?
638
+ command.query['fields'] = fields unless fields.nil?
639
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
640
+ execute_or_queue_command(command, &block)
641
+ end
642
+
643
+ # Cancel a pull task's lease.
644
+ # The lease holder can use this method to cancel a task's lease
645
+ # by setting Task.schedule_time to now. This will make the task
646
+ # available to be leased to the next caller of CloudTasks.PullTasks.
647
+ # @param [String] name
648
+ # Required.
649
+ # The task name. For example:
650
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
651
+ # @param [Google::Apis::CloudtasksV2beta2::CancelLeaseRequest] cancel_lease_request_object
652
+ # @param [String] fields
653
+ # Selector specifying which fields to include in a partial response.
654
+ # @param [String] quota_user
655
+ # Available to use for quota purposes for server-side applications. Can be any
656
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
657
+ # @param [Google::Apis::RequestOptions] options
658
+ # Request-specific options
659
+ #
660
+ # @yield [result, err] Result & error if block supplied
661
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Task] parsed result object
662
+ # @yieldparam err [StandardError] error object if request failed
663
+ #
664
+ # @return [Google::Apis::CloudtasksV2beta2::Task]
665
+ #
666
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
667
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
668
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
669
+ def cancel_task_lease(name, cancel_lease_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
670
+ command = make_simple_command(:post, 'v2beta2/{+name}:cancelLease', options)
671
+ command.request_representation = Google::Apis::CloudtasksV2beta2::CancelLeaseRequest::Representation
672
+ command.request_object = cancel_lease_request_object
673
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Task::Representation
674
+ command.response_class = Google::Apis::CloudtasksV2beta2::Task
675
+ command.params['name'] = name unless name.nil?
676
+ command.query['fields'] = fields unless fields.nil?
677
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
678
+ execute_or_queue_command(command, &block)
679
+ end
680
+
681
+ # Creates a task and adds it to a queue.
682
+ # To add multiple tasks at the same time, use
683
+ # [HTTP batching](/storage/docs/json_api/v1/how-tos/batch)
684
+ # or the batching documentation for your client library, for example
685
+ # https://developers.google.com/api-client-library/python/guide/batch.
686
+ # Tasks cannot be updated after creation; there is no UpdateTask command.
687
+ # @param [String] parent
688
+ # Required.
689
+ # The queue name. For example:
690
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
691
+ # The queue must already exist.
692
+ # @param [Google::Apis::CloudtasksV2beta2::CreateTaskRequest] create_task_request_object
693
+ # @param [String] fields
694
+ # Selector specifying which fields to include in a partial response.
695
+ # @param [String] quota_user
696
+ # Available to use for quota purposes for server-side applications. Can be any
697
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
698
+ # @param [Google::Apis::RequestOptions] options
699
+ # Request-specific options
700
+ #
701
+ # @yield [result, err] Result & error if block supplied
702
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Task] parsed result object
703
+ # @yieldparam err [StandardError] error object if request failed
704
+ #
705
+ # @return [Google::Apis::CloudtasksV2beta2::Task]
706
+ #
707
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
708
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
709
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
710
+ def create_task(parent, create_task_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
711
+ command = make_simple_command(:post, 'v2beta2/{+parent}/tasks', options)
712
+ command.request_representation = Google::Apis::CloudtasksV2beta2::CreateTaskRequest::Representation
713
+ command.request_object = create_task_request_object
714
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Task::Representation
715
+ command.response_class = Google::Apis::CloudtasksV2beta2::Task
716
+ command.params['parent'] = parent unless parent.nil?
717
+ command.query['fields'] = fields unless fields.nil?
718
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
719
+ execute_or_queue_command(command, &block)
720
+ end
721
+
722
+ # Deletes a task.
723
+ # A task can be deleted if it is scheduled or dispatched. A task
724
+ # cannot be deleted if it has completed successfully or permanently
725
+ # failed.
726
+ # @param [String] name
727
+ # Required.
728
+ # The task name. For example:
729
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
730
+ # @param [String] fields
731
+ # Selector specifying which fields to include in a partial response.
732
+ # @param [String] quota_user
733
+ # Available to use for quota purposes for server-side applications. Can be any
734
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
735
+ # @param [Google::Apis::RequestOptions] options
736
+ # Request-specific options
737
+ #
738
+ # @yield [result, err] Result & error if block supplied
739
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Empty] parsed result object
740
+ # @yieldparam err [StandardError] error object if request failed
741
+ #
742
+ # @return [Google::Apis::CloudtasksV2beta2::Empty]
743
+ #
744
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
745
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
746
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
747
+ def delete_project_location_queue_task(name, fields: nil, quota_user: nil, options: nil, &block)
748
+ command = make_simple_command(:delete, 'v2beta2/{+name}', options)
749
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Empty::Representation
750
+ command.response_class = Google::Apis::CloudtasksV2beta2::Empty
751
+ command.params['name'] = name unless name.nil?
752
+ command.query['fields'] = fields unless fields.nil?
753
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
754
+ execute_or_queue_command(command, &block)
755
+ end
756
+
757
+ # Gets a task.
758
+ # @param [String] name
759
+ # Required.
760
+ # The task name. For example:
761
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
762
+ # @param [String] response_view
763
+ # The response_view specifies which subset of the Task will be
764
+ # returned.
765
+ # By default response_view is Task.View.BASIC; not all
766
+ # information is retrieved by default because some data, such as
767
+ # payloads, might be desirable to return only when needed because
768
+ # of its large size or because of the sensitivity of data that it
769
+ # contains.
770
+ # Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView`
771
+ # [Google IAM](/iam/) permission on the
772
+ # Task.name resource.
773
+ # @param [String] fields
774
+ # Selector specifying which fields to include in a partial response.
775
+ # @param [String] quota_user
776
+ # Available to use for quota purposes for server-side applications. Can be any
777
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
778
+ # @param [Google::Apis::RequestOptions] options
779
+ # Request-specific options
780
+ #
781
+ # @yield [result, err] Result & error if block supplied
782
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Task] parsed result object
783
+ # @yieldparam err [StandardError] error object if request failed
784
+ #
785
+ # @return [Google::Apis::CloudtasksV2beta2::Task]
786
+ #
787
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
788
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
789
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
790
+ def get_project_location_queue_task(name, response_view: nil, fields: nil, quota_user: nil, options: nil, &block)
791
+ command = make_simple_command(:get, 'v2beta2/{+name}', options)
792
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Task::Representation
793
+ command.response_class = Google::Apis::CloudtasksV2beta2::Task
794
+ command.params['name'] = name unless name.nil?
795
+ command.query['responseView'] = response_view unless response_view.nil?
796
+ command.query['fields'] = fields unless fields.nil?
797
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
798
+ execute_or_queue_command(command, &block)
799
+ end
800
+
801
+ # Lists the tasks in a queue.
802
+ # By default response_view is Task.View.BASIC; not all
803
+ # information is retrieved by default due to performance
804
+ # considerations; ListTasksRequest.response_view controls the
805
+ # subset of information which is returned.
806
+ # @param [String] parent
807
+ # Required.
808
+ # The queue name. For example:
809
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
810
+ # @param [String] order_by
811
+ # Sort order used for the query. The fields supported for sorting
812
+ # are Task.schedule_time and PullMessage.tag. All results will be
813
+ # returned in ascending order. The default ordering is by
814
+ # Task.schedule_time.
815
+ # @param [Fixnum] page_size
816
+ # Requested page size. Fewer tasks than requested might be returned.
817
+ # The maximum page size is 1000. If unspecified, the page size will
818
+ # be the maximum. Fewer tasks than requested might be returned,
819
+ # even if more tasks exist; use
820
+ # ListTasksResponse.next_page_token to determine if more tasks
821
+ # exist.
822
+ # @param [String] page_token
823
+ # A token identifying the page of results to return.
824
+ # To request the first page results, page_token must be empty. To
825
+ # request the next page of results, page_token must be the value of
826
+ # ListTasksResponse.next_page_token returned from the previous
827
+ # call to CloudTasks.ListTasks method.
828
+ # The page token is valid for only 2 hours.
829
+ # @param [String] response_view
830
+ # The response_view specifies which subset of the Task will be
831
+ # returned.
832
+ # By default response_view is Task.View.BASIC; not all
833
+ # information is retrieved by default because some data, such as
834
+ # payloads, might be desirable to return only when needed because
835
+ # of its large size or because of the sensitivity of data that it
836
+ # contains.
837
+ # Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView`
838
+ # [Google IAM](/iam/) permission on the
839
+ # Task.name resource.
840
+ # @param [String] fields
841
+ # Selector specifying which fields to include in a partial response.
842
+ # @param [String] quota_user
843
+ # Available to use for quota purposes for server-side applications. Can be any
844
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
845
+ # @param [Google::Apis::RequestOptions] options
846
+ # Request-specific options
847
+ #
848
+ # @yield [result, err] Result & error if block supplied
849
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::ListTasksResponse] parsed result object
850
+ # @yieldparam err [StandardError] error object if request failed
851
+ #
852
+ # @return [Google::Apis::CloudtasksV2beta2::ListTasksResponse]
853
+ #
854
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
855
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
856
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
857
+ def list_project_location_queue_tasks(parent, order_by: nil, page_size: nil, page_token: nil, response_view: nil, fields: nil, quota_user: nil, options: nil, &block)
858
+ command = make_simple_command(:get, 'v2beta2/{+parent}/tasks', options)
859
+ command.response_representation = Google::Apis::CloudtasksV2beta2::ListTasksResponse::Representation
860
+ command.response_class = Google::Apis::CloudtasksV2beta2::ListTasksResponse
861
+ command.params['parent'] = parent unless parent.nil?
862
+ command.query['orderBy'] = order_by unless order_by.nil?
863
+ command.query['pageSize'] = page_size unless page_size.nil?
864
+ command.query['pageToken'] = page_token unless page_token.nil?
865
+ command.query['responseView'] = response_view unless response_view.nil?
866
+ command.query['fields'] = fields unless fields.nil?
867
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
868
+ execute_or_queue_command(command, &block)
869
+ end
870
+
871
+ # Pulls tasks from a pull queue and acquires a lease on them for a
872
+ # specified PullTasksRequest.lease_duration.
873
+ # This method is invoked by the lease holder to obtain the
874
+ # lease. The lease holder must acknowledge the task via
875
+ # CloudTasks.AcknowledgeTask after they have performed the work
876
+ # associated with the task.
877
+ # The payload is intended to store data that the lease holder needs
878
+ # to perform the work associated with the task. To return the
879
+ # payloads in the PullTasksResponse, set
880
+ # PullTasksRequest.response_view to Task.View.FULL.
881
+ # @param [String] name
882
+ # Required.
883
+ # The queue name. For example:
884
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
885
+ # @param [Google::Apis::CloudtasksV2beta2::PullTasksRequest] pull_tasks_request_object
886
+ # @param [String] fields
887
+ # Selector specifying which fields to include in a partial response.
888
+ # @param [String] quota_user
889
+ # Available to use for quota purposes for server-side applications. Can be any
890
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
891
+ # @param [Google::Apis::RequestOptions] options
892
+ # Request-specific options
893
+ #
894
+ # @yield [result, err] Result & error if block supplied
895
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::PullTasksResponse] parsed result object
896
+ # @yieldparam err [StandardError] error object if request failed
897
+ #
898
+ # @return [Google::Apis::CloudtasksV2beta2::PullTasksResponse]
899
+ #
900
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
901
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
902
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
903
+ def pull_tasks(name, pull_tasks_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
904
+ command = make_simple_command(:post, 'v2beta2/{+name}/tasks:pull', options)
905
+ command.request_representation = Google::Apis::CloudtasksV2beta2::PullTasksRequest::Representation
906
+ command.request_object = pull_tasks_request_object
907
+ command.response_representation = Google::Apis::CloudtasksV2beta2::PullTasksResponse::Representation
908
+ command.response_class = Google::Apis::CloudtasksV2beta2::PullTasksResponse
909
+ command.params['name'] = name unless name.nil?
910
+ command.query['fields'] = fields unless fields.nil?
911
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
912
+ execute_or_queue_command(command, &block)
913
+ end
914
+
915
+ # Renew the current lease of a pull task.
916
+ # The lease holder can use this method to extend the lease by a new
917
+ # duration, starting from now. The new task lease will be
918
+ # returned in Task.schedule_time.
919
+ # @param [String] name
920
+ # Required.
921
+ # The task name. For example:
922
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
923
+ # @param [Google::Apis::CloudtasksV2beta2::RenewLeaseRequest] renew_lease_request_object
924
+ # @param [String] fields
925
+ # Selector specifying which fields to include in a partial response.
926
+ # @param [String] quota_user
927
+ # Available to use for quota purposes for server-side applications. Can be any
928
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
929
+ # @param [Google::Apis::RequestOptions] options
930
+ # Request-specific options
931
+ #
932
+ # @yield [result, err] Result & error if block supplied
933
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Task] parsed result object
934
+ # @yieldparam err [StandardError] error object if request failed
935
+ #
936
+ # @return [Google::Apis::CloudtasksV2beta2::Task]
937
+ #
938
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
939
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
940
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
941
+ def renew_task_lease(name, renew_lease_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
942
+ command = make_simple_command(:post, 'v2beta2/{+name}:renewLease', options)
943
+ command.request_representation = Google::Apis::CloudtasksV2beta2::RenewLeaseRequest::Representation
944
+ command.request_object = renew_lease_request_object
945
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Task::Representation
946
+ command.response_class = Google::Apis::CloudtasksV2beta2::Task
947
+ command.params['name'] = name unless name.nil?
948
+ command.query['fields'] = fields unless fields.nil?
949
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
950
+ execute_or_queue_command(command, &block)
951
+ end
952
+
953
+ # Forces a task to run now.
954
+ # This command is meant to be used for manual debugging. For
955
+ # example, CloudTasks.RunTask can be used to retry a failed
956
+ # task after a fix has been made or to manually force a task to be
957
+ # dispatched now.
958
+ # When this method is called, Cloud Tasks will dispatch the task to its
959
+ # target, even if the queue is Queue.QueueState.PAUSED.
960
+ # The dispatched task is returned. That is, the task that is returned
961
+ # contains the Task.task_status after the task is dispatched but
962
+ # before the task is received by its target.
963
+ # If Cloud Tasks receives a successful response from the task's
964
+ # handler, then the task will be deleted; otherwise the task's
965
+ # Task.schedule_time will be reset to the time that
966
+ # CloudTasks.RunTask was called plus the retry delay specified
967
+ # in the queue and task's RetryConfig.
968
+ # CloudTasks.RunTask returns google.rpc.Code.NOT_FOUND when
969
+ # it is called on a task that has already succeeded or permanently
970
+ # failed. google.rpc.Code.FAILED_PRECONDITION is returned when
971
+ # CloudTasks.RunTask is called on task that is dispatched or
972
+ # already running.
973
+ # @param [String] name
974
+ # Required.
975
+ # The task name. For example:
976
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
977
+ # @param [Google::Apis::CloudtasksV2beta2::RunTaskRequest] run_task_request_object
978
+ # @param [String] fields
979
+ # Selector specifying which fields to include in a partial response.
980
+ # @param [String] quota_user
981
+ # Available to use for quota purposes for server-side applications. Can be any
982
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
983
+ # @param [Google::Apis::RequestOptions] options
984
+ # Request-specific options
985
+ #
986
+ # @yield [result, err] Result & error if block supplied
987
+ # @yieldparam result [Google::Apis::CloudtasksV2beta2::Task] parsed result object
988
+ # @yieldparam err [StandardError] error object if request failed
989
+ #
990
+ # @return [Google::Apis::CloudtasksV2beta2::Task]
991
+ #
992
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
993
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
994
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
995
+ def run_task(name, run_task_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
996
+ command = make_simple_command(:post, 'v2beta2/{+name}:run', options)
997
+ command.request_representation = Google::Apis::CloudtasksV2beta2::RunTaskRequest::Representation
998
+ command.request_object = run_task_request_object
999
+ command.response_representation = Google::Apis::CloudtasksV2beta2::Task::Representation
1000
+ command.response_class = Google::Apis::CloudtasksV2beta2::Task
1001
+ command.params['name'] = name unless name.nil?
1002
+ command.query['fields'] = fields unless fields.nil?
1003
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1004
+ execute_or_queue_command(command, &block)
1005
+ end
1006
+
1007
+ protected
1008
+
1009
+ def apply_command_defaults(command)
1010
+ command.query['key'] = key unless key.nil?
1011
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1012
+ end
1013
+ end
1014
+ end
1015
+ end
1016
+ end