OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
1 library googleapis_beta.taskqueue.v1beta2; | 3 library googleapis_beta.taskqueue.v1beta2; |
2 | 4 |
3 import "dart:core" as core; | 5 import 'dart:core' as core; |
4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
5 import "dart:async" as async; | 7 import 'dart:async' as async; |
6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
7 | 9 |
8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
10 import '../src/common_internal.dart' as common_internal; | |
11 import '../common/common.dart' as common; | |
12 | 13 |
13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError; |
| 16 |
| 17 const core.String USER_AGENT = 'dart-api-client taskqueue/v1beta2'; |
15 | 18 |
16 /** Lets you access a Google App Engine Pull Task Queue over REST. */ | 19 /** Lets you access a Google App Engine Pull Task Queue over REST. */ |
17 class TaskqueueApi { | 20 class TaskqueueApi { |
18 /** Manage your Tasks and Taskqueues */ | 21 /** Manage your Tasks and Taskqueues */ |
19 static const TaskqueueScope = "https://www.googleapis.com/auth/taskqueue"; | 22 static const TaskqueueScope = "https://www.googleapis.com/auth/taskqueue"; |
20 | 23 |
21 /** Consume Tasks from your Taskqueues */ | 24 /** Consume Tasks from your Taskqueues */ |
22 static const TaskqueueConsumerScope = "https://www.googleapis.com/auth/taskque
ue.consumer"; | 25 static const TaskqueueConsumerScope = "https://www.googleapis.com/auth/taskque
ue.consumer"; |
23 | 26 |
24 | 27 |
25 final common_internal.ApiRequester _requester; | 28 final commons.ApiRequester _requester; |
26 | 29 |
27 TaskqueuesResourceApi get taskqueues => new TaskqueuesResourceApi(_requester); | 30 TaskqueuesResourceApi get taskqueues => new TaskqueuesResourceApi(_requester); |
28 TasksResourceApi get tasks => new TasksResourceApi(_requester); | 31 TasksResourceApi get tasks => new TasksResourceApi(_requester); |
29 | 32 |
30 TaskqueueApi(http.Client client, {core.String rootUrl: "https://www.googleapis
.com/", core.String servicePath: "taskqueue/v1beta2/projects/"}) : | 33 TaskqueueApi(http.Client client, {core.String rootUrl: "https://www.googleapis
.com/", core.String servicePath: "taskqueue/v1beta2/projects/"}) : |
31 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 34 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
32 } | 35 } |
33 | 36 |
34 | 37 |
35 /** Not documented yet. */ | |
36 class TaskqueuesResourceApi { | 38 class TaskqueuesResourceApi { |
37 final common_internal.ApiRequester _requester; | 39 final commons.ApiRequester _requester; |
38 | 40 |
39 TaskqueuesResourceApi(common_internal.ApiRequester client) : | 41 TaskqueuesResourceApi(commons.ApiRequester client) : |
40 _requester = client; | 42 _requester = client; |
41 | 43 |
42 /** | 44 /** |
43 * Get detailed information about a TaskQueue. | 45 * Get detailed information about a TaskQueue. |
44 * | 46 * |
45 * Request parameters: | 47 * Request parameters: |
46 * | 48 * |
47 * [project] - The project under which the queue lies. | 49 * [project] - The project under which the queue lies. |
48 * | 50 * |
49 * [taskqueue] - The id of the taskqueue to get the properties of. | 51 * [taskqueue] - The id of the taskqueue to get the properties of. |
50 * | 52 * |
51 * [getStats] - Whether to get stats. Optional. | 53 * [getStats] - Whether to get stats. Optional. |
52 * | 54 * |
53 * Completes with a [TaskQueue]. | 55 * Completes with a [TaskQueue]. |
54 * | 56 * |
55 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
56 * error. | 58 * error. |
57 * | 59 * |
58 * If the used [http.Client] completes with an error when making a REST call, | 60 * If the used [http.Client] completes with an error when making a REST call, |
59 * this method will complete with the same error. | 61 * this method will complete with the same error. |
60 */ | 62 */ |
61 async.Future<TaskQueue> get(core.String project, core.String taskqueue, {core.
bool getStats}) { | 63 async.Future<TaskQueue> get(core.String project, core.String taskqueue, {core.
bool getStats}) { |
62 var _url = null; | 64 var _url = null; |
63 var _queryParams = new core.Map(); | 65 var _queryParams = new core.Map(); |
64 var _uploadMedia = null; | 66 var _uploadMedia = null; |
65 var _uploadOptions = null; | 67 var _uploadOptions = null; |
66 var _downloadOptions = common.DownloadOptions.Metadata; | 68 var _downloadOptions = commons.DownloadOptions.Metadata; |
67 var _body = null; | 69 var _body = null; |
68 | 70 |
69 if (project == null) { | 71 if (project == null) { |
70 throw new core.ArgumentError("Parameter project is required."); | 72 throw new core.ArgumentError("Parameter project is required."); |
71 } | 73 } |
72 if (taskqueue == null) { | 74 if (taskqueue == null) { |
73 throw new core.ArgumentError("Parameter taskqueue is required."); | 75 throw new core.ArgumentError("Parameter taskqueue is required."); |
74 } | 76 } |
75 if (getStats != null) { | 77 if (getStats != null) { |
76 _queryParams["getStats"] = ["${getStats}"]; | 78 _queryParams["getStats"] = ["${getStats}"]; |
77 } | 79 } |
78 | 80 |
79 | 81 |
80 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue'); | 82 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue'); |
81 | 83 |
82 var _response = _requester.request(_url, | 84 var _response = _requester.request(_url, |
83 "GET", | 85 "GET", |
84 body: _body, | 86 body: _body, |
85 queryParams: _queryParams, | 87 queryParams: _queryParams, |
86 uploadOptions: _uploadOptions, | 88 uploadOptions: _uploadOptions, |
87 uploadMedia: _uploadMedia, | 89 uploadMedia: _uploadMedia, |
88 downloadOptions: _downloadOptions); | 90 downloadOptions: _downloadOptions); |
89 return _response.then((data) => new TaskQueue.fromJson(data)); | 91 return _response.then((data) => new TaskQueue.fromJson(data)); |
90 } | 92 } |
91 | 93 |
92 } | 94 } |
93 | 95 |
94 | 96 |
95 /** Not documented yet. */ | |
96 class TasksResourceApi { | 97 class TasksResourceApi { |
97 final common_internal.ApiRequester _requester; | 98 final commons.ApiRequester _requester; |
98 | 99 |
99 TasksResourceApi(common_internal.ApiRequester client) : | 100 TasksResourceApi(commons.ApiRequester client) : |
100 _requester = client; | 101 _requester = client; |
101 | 102 |
102 /** | 103 /** |
103 * Delete a task from a TaskQueue. | 104 * Delete a task from a TaskQueue. |
104 * | 105 * |
105 * Request parameters: | 106 * Request parameters: |
106 * | 107 * |
107 * [project] - The project under which the queue lies. | 108 * [project] - The project under which the queue lies. |
108 * | 109 * |
109 * [taskqueue] - The taskqueue to delete a task from. | 110 * [taskqueue] - The taskqueue to delete a task from. |
110 * | 111 * |
111 * [task] - The id of the task to delete. | 112 * [task] - The id of the task to delete. |
112 * | 113 * |
113 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 114 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
114 * error. | 115 * error. |
115 * | 116 * |
116 * If the used [http.Client] completes with an error when making a REST call, | 117 * If the used [http.Client] completes with an error when making a REST call, |
117 * this method will complete with the same error. | 118 * this method will complete with the same error. |
118 */ | 119 */ |
119 async.Future delete(core.String project, core.String taskqueue, core.String ta
sk) { | 120 async.Future delete(core.String project, core.String taskqueue, core.String ta
sk) { |
120 var _url = null; | 121 var _url = null; |
121 var _queryParams = new core.Map(); | 122 var _queryParams = new core.Map(); |
122 var _uploadMedia = null; | 123 var _uploadMedia = null; |
123 var _uploadOptions = null; | 124 var _uploadOptions = null; |
124 var _downloadOptions = common.DownloadOptions.Metadata; | 125 var _downloadOptions = commons.DownloadOptions.Metadata; |
125 var _body = null; | 126 var _body = null; |
126 | 127 |
127 if (project == null) { | 128 if (project == null) { |
128 throw new core.ArgumentError("Parameter project is required."); | 129 throw new core.ArgumentError("Parameter project is required."); |
129 } | 130 } |
130 if (taskqueue == null) { | 131 if (taskqueue == null) { |
131 throw new core.ArgumentError("Parameter taskqueue is required."); | 132 throw new core.ArgumentError("Parameter taskqueue is required."); |
132 } | 133 } |
133 if (task == null) { | 134 if (task == null) { |
134 throw new core.ArgumentError("Parameter task is required."); | 135 throw new core.ArgumentError("Parameter task is required."); |
135 } | 136 } |
136 | 137 |
137 _downloadOptions = null; | 138 _downloadOptions = null; |
138 | 139 |
139 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); | 140 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue') + '/tasks/' + commons.Escaper.ecapeVariable(
'$task'); |
140 | 141 |
141 var _response = _requester.request(_url, | 142 var _response = _requester.request(_url, |
142 "DELETE", | 143 "DELETE", |
143 body: _body, | 144 body: _body, |
144 queryParams: _queryParams, | 145 queryParams: _queryParams, |
145 uploadOptions: _uploadOptions, | 146 uploadOptions: _uploadOptions, |
146 uploadMedia: _uploadMedia, | 147 uploadMedia: _uploadMedia, |
147 downloadOptions: _downloadOptions); | 148 downloadOptions: _downloadOptions); |
148 return _response.then((data) => null); | 149 return _response.then((data) => null); |
149 } | 150 } |
150 | 151 |
151 /** | 152 /** |
152 * Get a particular task from a TaskQueue. | 153 * Get a particular task from a TaskQueue. |
153 * | 154 * |
154 * Request parameters: | 155 * Request parameters: |
155 * | 156 * |
156 * [project] - The project under which the queue lies. | 157 * [project] - The project under which the queue lies. |
157 * | 158 * |
158 * [taskqueue] - The taskqueue in which the task belongs. | 159 * [taskqueue] - The taskqueue in which the task belongs. |
159 * | 160 * |
160 * [task] - The task to get properties of. | 161 * [task] - The task to get properties of. |
161 * | 162 * |
162 * Completes with a [Task]. | 163 * Completes with a [Task]. |
163 * | 164 * |
164 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 165 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
165 * error. | 166 * error. |
166 * | 167 * |
167 * If the used [http.Client] completes with an error when making a REST call, | 168 * If the used [http.Client] completes with an error when making a REST call, |
168 * this method will complete with the same error. | 169 * this method will complete with the same error. |
169 */ | 170 */ |
170 async.Future<Task> get(core.String project, core.String taskqueue, core.String
task) { | 171 async.Future<Task> get(core.String project, core.String taskqueue, core.String
task) { |
171 var _url = null; | 172 var _url = null; |
172 var _queryParams = new core.Map(); | 173 var _queryParams = new core.Map(); |
173 var _uploadMedia = null; | 174 var _uploadMedia = null; |
174 var _uploadOptions = null; | 175 var _uploadOptions = null; |
175 var _downloadOptions = common.DownloadOptions.Metadata; | 176 var _downloadOptions = commons.DownloadOptions.Metadata; |
176 var _body = null; | 177 var _body = null; |
177 | 178 |
178 if (project == null) { | 179 if (project == null) { |
179 throw new core.ArgumentError("Parameter project is required."); | 180 throw new core.ArgumentError("Parameter project is required."); |
180 } | 181 } |
181 if (taskqueue == null) { | 182 if (taskqueue == null) { |
182 throw new core.ArgumentError("Parameter taskqueue is required."); | 183 throw new core.ArgumentError("Parameter taskqueue is required."); |
183 } | 184 } |
184 if (task == null) { | 185 if (task == null) { |
185 throw new core.ArgumentError("Parameter task is required."); | 186 throw new core.ArgumentError("Parameter task is required."); |
186 } | 187 } |
187 | 188 |
188 | 189 |
189 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); | 190 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue') + '/tasks/' + commons.Escaper.ecapeVariable(
'$task'); |
190 | 191 |
191 var _response = _requester.request(_url, | 192 var _response = _requester.request(_url, |
192 "GET", | 193 "GET", |
193 body: _body, | 194 body: _body, |
194 queryParams: _queryParams, | 195 queryParams: _queryParams, |
195 uploadOptions: _uploadOptions, | 196 uploadOptions: _uploadOptions, |
196 uploadMedia: _uploadMedia, | 197 uploadMedia: _uploadMedia, |
197 downloadOptions: _downloadOptions); | 198 downloadOptions: _downloadOptions); |
198 return _response.then((data) => new Task.fromJson(data)); | 199 return _response.then((data) => new Task.fromJson(data)); |
199 } | 200 } |
200 | 201 |
201 /** | 202 /** |
202 * Insert a new task in a TaskQueue | 203 * Insert a new task in a TaskQueue |
203 * | 204 * |
204 * [request] - The metadata request object. | 205 * [request] - The metadata request object. |
205 * | 206 * |
206 * Request parameters: | 207 * Request parameters: |
207 * | 208 * |
208 * [project] - The project under which the queue lies | 209 * [project] - The project under which the queue lies |
209 * | 210 * |
210 * [taskqueue] - The taskqueue to insert the task into | 211 * [taskqueue] - The taskqueue to insert the task into |
211 * | 212 * |
212 * Completes with a [Task]. | 213 * Completes with a [Task]. |
213 * | 214 * |
214 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 215 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
215 * error. | 216 * error. |
216 * | 217 * |
217 * If the used [http.Client] completes with an error when making a REST call, | 218 * If the used [http.Client] completes with an error when making a REST call, |
218 * this method will complete with the same error. | 219 * this method will complete with the same error. |
219 */ | 220 */ |
220 async.Future<Task> insert(Task request, core.String project, core.String taskq
ueue) { | 221 async.Future<Task> insert(Task request, core.String project, core.String taskq
ueue) { |
221 var _url = null; | 222 var _url = null; |
222 var _queryParams = new core.Map(); | 223 var _queryParams = new core.Map(); |
223 var _uploadMedia = null; | 224 var _uploadMedia = null; |
224 var _uploadOptions = null; | 225 var _uploadOptions = null; |
225 var _downloadOptions = common.DownloadOptions.Metadata; | 226 var _downloadOptions = commons.DownloadOptions.Metadata; |
226 var _body = null; | 227 var _body = null; |
227 | 228 |
228 if (request != null) { | 229 if (request != null) { |
229 _body = convert.JSON.encode((request).toJson()); | 230 _body = convert.JSON.encode((request).toJson()); |
230 } | 231 } |
231 if (project == null) { | 232 if (project == null) { |
232 throw new core.ArgumentError("Parameter project is required."); | 233 throw new core.ArgumentError("Parameter project is required."); |
233 } | 234 } |
234 if (taskqueue == null) { | 235 if (taskqueue == null) { |
235 throw new core.ArgumentError("Parameter taskqueue is required."); | 236 throw new core.ArgumentError("Parameter taskqueue is required."); |
236 } | 237 } |
237 | 238 |
238 | 239 |
239 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks'; | 240 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue') + '/tasks'; |
240 | 241 |
241 var _response = _requester.request(_url, | 242 var _response = _requester.request(_url, |
242 "POST", | 243 "POST", |
243 body: _body, | 244 body: _body, |
244 queryParams: _queryParams, | 245 queryParams: _queryParams, |
245 uploadOptions: _uploadOptions, | 246 uploadOptions: _uploadOptions, |
246 uploadMedia: _uploadMedia, | 247 uploadMedia: _uploadMedia, |
247 downloadOptions: _downloadOptions); | 248 downloadOptions: _downloadOptions); |
248 return _response.then((data) => new Task.fromJson(data)); | 249 return _response.then((data) => new Task.fromJson(data)); |
249 } | 250 } |
(...skipping 13 matching lines...) Expand all Loading... |
263 * | 264 * |
264 * [groupByTag] - When true, all returned tasks will have the same tag | 265 * [groupByTag] - When true, all returned tasks will have the same tag |
265 * | 266 * |
266 * [tag] - The tag allowed for tasks in the response. Must only be specified | 267 * [tag] - The tag allowed for tasks in the response. Must only be specified |
267 * if group_by_tag is true. If group_by_tag is true and tag is not specified | 268 * if group_by_tag is true. If group_by_tag is true and tag is not specified |
268 * the tag will be that of the oldest task by eta, i.e. the first available | 269 * the tag will be that of the oldest task by eta, i.e. the first available |
269 * tag | 270 * tag |
270 * | 271 * |
271 * Completes with a [Tasks]. | 272 * Completes with a [Tasks]. |
272 * | 273 * |
273 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 274 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
274 * error. | 275 * error. |
275 * | 276 * |
276 * If the used [http.Client] completes with an error when making a REST call, | 277 * If the used [http.Client] completes with an error when making a REST call, |
277 * this method will complete with the same error. | 278 * this method will complete with the same error. |
278 */ | 279 */ |
279 async.Future<Tasks> lease(core.String project, core.String taskqueue, core.int
numTasks, core.int leaseSecs, {core.bool groupByTag, core.String tag}) { | 280 async.Future<Tasks> lease(core.String project, core.String taskqueue, core.int
numTasks, core.int leaseSecs, {core.bool groupByTag, core.String tag}) { |
280 var _url = null; | 281 var _url = null; |
281 var _queryParams = new core.Map(); | 282 var _queryParams = new core.Map(); |
282 var _uploadMedia = null; | 283 var _uploadMedia = null; |
283 var _uploadOptions = null; | 284 var _uploadOptions = null; |
284 var _downloadOptions = common.DownloadOptions.Metadata; | 285 var _downloadOptions = commons.DownloadOptions.Metadata; |
285 var _body = null; | 286 var _body = null; |
286 | 287 |
287 if (project == null) { | 288 if (project == null) { |
288 throw new core.ArgumentError("Parameter project is required."); | 289 throw new core.ArgumentError("Parameter project is required."); |
289 } | 290 } |
290 if (taskqueue == null) { | 291 if (taskqueue == null) { |
291 throw new core.ArgumentError("Parameter taskqueue is required."); | 292 throw new core.ArgumentError("Parameter taskqueue is required."); |
292 } | 293 } |
293 if (numTasks == null) { | 294 if (numTasks == null) { |
294 throw new core.ArgumentError("Parameter numTasks is required."); | 295 throw new core.ArgumentError("Parameter numTasks is required."); |
295 } | 296 } |
296 _queryParams["numTasks"] = ["${numTasks}"]; | 297 _queryParams["numTasks"] = ["${numTasks}"]; |
297 if (leaseSecs == null) { | 298 if (leaseSecs == null) { |
298 throw new core.ArgumentError("Parameter leaseSecs is required."); | 299 throw new core.ArgumentError("Parameter leaseSecs is required."); |
299 } | 300 } |
300 _queryParams["leaseSecs"] = ["${leaseSecs}"]; | 301 _queryParams["leaseSecs"] = ["${leaseSecs}"]; |
301 if (groupByTag != null) { | 302 if (groupByTag != null) { |
302 _queryParams["groupByTag"] = ["${groupByTag}"]; | 303 _queryParams["groupByTag"] = ["${groupByTag}"]; |
303 } | 304 } |
304 if (tag != null) { | 305 if (tag != null) { |
305 _queryParams["tag"] = [tag]; | 306 _queryParams["tag"] = [tag]; |
306 } | 307 } |
307 | 308 |
308 | 309 |
309 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/lease'; | 310 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue') + '/tasks/lease'; |
310 | 311 |
311 var _response = _requester.request(_url, | 312 var _response = _requester.request(_url, |
312 "POST", | 313 "POST", |
313 body: _body, | 314 body: _body, |
314 queryParams: _queryParams, | 315 queryParams: _queryParams, |
315 uploadOptions: _uploadOptions, | 316 uploadOptions: _uploadOptions, |
316 uploadMedia: _uploadMedia, | 317 uploadMedia: _uploadMedia, |
317 downloadOptions: _downloadOptions); | 318 downloadOptions: _downloadOptions); |
318 return _response.then((data) => new Tasks.fromJson(data)); | 319 return _response.then((data) => new Tasks.fromJson(data)); |
319 } | 320 } |
320 | 321 |
321 /** | 322 /** |
322 * List Tasks in a TaskQueue | 323 * List Tasks in a TaskQueue |
323 * | 324 * |
324 * Request parameters: | 325 * Request parameters: |
325 * | 326 * |
326 * [project] - The project under which the queue lies. | 327 * [project] - The project under which the queue lies. |
327 * | 328 * |
328 * [taskqueue] - The id of the taskqueue to list tasks from. | 329 * [taskqueue] - The id of the taskqueue to list tasks from. |
329 * | 330 * |
330 * Completes with a [Tasks2]. | 331 * Completes with a [Tasks2]. |
331 * | 332 * |
332 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 333 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
333 * error. | 334 * error. |
334 * | 335 * |
335 * If the used [http.Client] completes with an error when making a REST call, | 336 * If the used [http.Client] completes with an error when making a REST call, |
336 * this method will complete with the same error. | 337 * this method will complete with the same error. |
337 */ | 338 */ |
338 async.Future<Tasks2> list(core.String project, core.String taskqueue) { | 339 async.Future<Tasks2> list(core.String project, core.String taskqueue) { |
339 var _url = null; | 340 var _url = null; |
340 var _queryParams = new core.Map(); | 341 var _queryParams = new core.Map(); |
341 var _uploadMedia = null; | 342 var _uploadMedia = null; |
342 var _uploadOptions = null; | 343 var _uploadOptions = null; |
343 var _downloadOptions = common.DownloadOptions.Metadata; | 344 var _downloadOptions = commons.DownloadOptions.Metadata; |
344 var _body = null; | 345 var _body = null; |
345 | 346 |
346 if (project == null) { | 347 if (project == null) { |
347 throw new core.ArgumentError("Parameter project is required."); | 348 throw new core.ArgumentError("Parameter project is required."); |
348 } | 349 } |
349 if (taskqueue == null) { | 350 if (taskqueue == null) { |
350 throw new core.ArgumentError("Parameter taskqueue is required."); | 351 throw new core.ArgumentError("Parameter taskqueue is required."); |
351 } | 352 } |
352 | 353 |
353 | 354 |
354 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks'; | 355 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue') + '/tasks'; |
355 | 356 |
356 var _response = _requester.request(_url, | 357 var _response = _requester.request(_url, |
357 "GET", | 358 "GET", |
358 body: _body, | 359 body: _body, |
359 queryParams: _queryParams, | 360 queryParams: _queryParams, |
360 uploadOptions: _uploadOptions, | 361 uploadOptions: _uploadOptions, |
361 uploadMedia: _uploadMedia, | 362 uploadMedia: _uploadMedia, |
362 downloadOptions: _downloadOptions); | 363 downloadOptions: _downloadOptions); |
363 return _response.then((data) => new Tasks2.fromJson(data)); | 364 return _response.then((data) => new Tasks2.fromJson(data)); |
364 } | 365 } |
365 | 366 |
366 /** | 367 /** |
367 * Update tasks that are leased out of a TaskQueue. This method supports patch | 368 * Update tasks that are leased out of a TaskQueue. This method supports patch |
368 * semantics. | 369 * semantics. |
369 * | 370 * |
370 * [request] - The metadata request object. | 371 * [request] - The metadata request object. |
371 * | 372 * |
372 * Request parameters: | 373 * Request parameters: |
373 * | 374 * |
374 * [project] - The project under which the queue lies. | 375 * [project] - The project under which the queue lies. |
375 * | 376 * |
376 * [taskqueue] - null | 377 * [taskqueue] - null |
377 * | 378 * |
378 * [task] - null | 379 * [task] - null |
379 * | 380 * |
380 * [newLeaseSeconds] - The new lease in seconds. | 381 * [newLeaseSeconds] - The new lease in seconds. |
381 * | 382 * |
382 * Completes with a [Task]. | 383 * Completes with a [Task]. |
383 * | 384 * |
384 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 385 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
385 * error. | 386 * error. |
386 * | 387 * |
387 * If the used [http.Client] completes with an error when making a REST call, | 388 * If the used [http.Client] completes with an error when making a REST call, |
388 * this method will complete with the same error. | 389 * this method will complete with the same error. |
389 */ | 390 */ |
390 async.Future<Task> patch(Task request, core.String project, core.String taskqu
eue, core.String task, core.int newLeaseSeconds) { | 391 async.Future<Task> patch(Task request, core.String project, core.String taskqu
eue, core.String task, core.int newLeaseSeconds) { |
391 var _url = null; | 392 var _url = null; |
392 var _queryParams = new core.Map(); | 393 var _queryParams = new core.Map(); |
393 var _uploadMedia = null; | 394 var _uploadMedia = null; |
394 var _uploadOptions = null; | 395 var _uploadOptions = null; |
395 var _downloadOptions = common.DownloadOptions.Metadata; | 396 var _downloadOptions = commons.DownloadOptions.Metadata; |
396 var _body = null; | 397 var _body = null; |
397 | 398 |
398 if (request != null) { | 399 if (request != null) { |
399 _body = convert.JSON.encode((request).toJson()); | 400 _body = convert.JSON.encode((request).toJson()); |
400 } | 401 } |
401 if (project == null) { | 402 if (project == null) { |
402 throw new core.ArgumentError("Parameter project is required."); | 403 throw new core.ArgumentError("Parameter project is required."); |
403 } | 404 } |
404 if (taskqueue == null) { | 405 if (taskqueue == null) { |
405 throw new core.ArgumentError("Parameter taskqueue is required."); | 406 throw new core.ArgumentError("Parameter taskqueue is required."); |
406 } | 407 } |
407 if (task == null) { | 408 if (task == null) { |
408 throw new core.ArgumentError("Parameter task is required."); | 409 throw new core.ArgumentError("Parameter task is required."); |
409 } | 410 } |
410 if (newLeaseSeconds == null) { | 411 if (newLeaseSeconds == null) { |
411 throw new core.ArgumentError("Parameter newLeaseSeconds is required."); | 412 throw new core.ArgumentError("Parameter newLeaseSeconds is required."); |
412 } | 413 } |
413 _queryParams["newLeaseSeconds"] = ["${newLeaseSeconds}"]; | 414 _queryParams["newLeaseSeconds"] = ["${newLeaseSeconds}"]; |
414 | 415 |
415 | 416 |
416 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); | 417 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue') + '/tasks/' + commons.Escaper.ecapeVariable(
'$task'); |
417 | 418 |
418 var _response = _requester.request(_url, | 419 var _response = _requester.request(_url, |
419 "PATCH", | 420 "PATCH", |
420 body: _body, | 421 body: _body, |
421 queryParams: _queryParams, | 422 queryParams: _queryParams, |
422 uploadOptions: _uploadOptions, | 423 uploadOptions: _uploadOptions, |
423 uploadMedia: _uploadMedia, | 424 uploadMedia: _uploadMedia, |
424 downloadOptions: _downloadOptions); | 425 downloadOptions: _downloadOptions); |
425 return _response.then((data) => new Task.fromJson(data)); | 426 return _response.then((data) => new Task.fromJson(data)); |
426 } | 427 } |
427 | 428 |
428 /** | 429 /** |
429 * Update tasks that are leased out of a TaskQueue. | 430 * Update tasks that are leased out of a TaskQueue. |
430 * | 431 * |
431 * [request] - The metadata request object. | 432 * [request] - The metadata request object. |
432 * | 433 * |
433 * Request parameters: | 434 * Request parameters: |
434 * | 435 * |
435 * [project] - The project under which the queue lies. | 436 * [project] - The project under which the queue lies. |
436 * | 437 * |
437 * [taskqueue] - null | 438 * [taskqueue] - null |
438 * | 439 * |
439 * [task] - null | 440 * [task] - null |
440 * | 441 * |
441 * [newLeaseSeconds] - The new lease in seconds. | 442 * [newLeaseSeconds] - The new lease in seconds. |
442 * | 443 * |
443 * Completes with a [Task]. | 444 * Completes with a [Task]. |
444 * | 445 * |
445 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 446 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
446 * error. | 447 * error. |
447 * | 448 * |
448 * If the used [http.Client] completes with an error when making a REST call, | 449 * If the used [http.Client] completes with an error when making a REST call, |
449 * this method will complete with the same error. | 450 * this method will complete with the same error. |
450 */ | 451 */ |
451 async.Future<Task> update(Task request, core.String project, core.String taskq
ueue, core.String task, core.int newLeaseSeconds) { | 452 async.Future<Task> update(Task request, core.String project, core.String taskq
ueue, core.String task, core.int newLeaseSeconds) { |
452 var _url = null; | 453 var _url = null; |
453 var _queryParams = new core.Map(); | 454 var _queryParams = new core.Map(); |
454 var _uploadMedia = null; | 455 var _uploadMedia = null; |
455 var _uploadOptions = null; | 456 var _uploadOptions = null; |
456 var _downloadOptions = common.DownloadOptions.Metadata; | 457 var _downloadOptions = commons.DownloadOptions.Metadata; |
457 var _body = null; | 458 var _body = null; |
458 | 459 |
459 if (request != null) { | 460 if (request != null) { |
460 _body = convert.JSON.encode((request).toJson()); | 461 _body = convert.JSON.encode((request).toJson()); |
461 } | 462 } |
462 if (project == null) { | 463 if (project == null) { |
463 throw new core.ArgumentError("Parameter project is required."); | 464 throw new core.ArgumentError("Parameter project is required."); |
464 } | 465 } |
465 if (taskqueue == null) { | 466 if (taskqueue == null) { |
466 throw new core.ArgumentError("Parameter taskqueue is required."); | 467 throw new core.ArgumentError("Parameter taskqueue is required."); |
467 } | 468 } |
468 if (task == null) { | 469 if (task == null) { |
469 throw new core.ArgumentError("Parameter task is required."); | 470 throw new core.ArgumentError("Parameter task is required."); |
470 } | 471 } |
471 if (newLeaseSeconds == null) { | 472 if (newLeaseSeconds == null) { |
472 throw new core.ArgumentError("Parameter newLeaseSeconds is required."); | 473 throw new core.ArgumentError("Parameter newLeaseSeconds is required."); |
473 } | 474 } |
474 _queryParams["newLeaseSeconds"] = ["${newLeaseSeconds}"]; | 475 _queryParams["newLeaseSeconds"] = ["${newLeaseSeconds}"]; |
475 | 476 |
476 | 477 |
477 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); | 478 _url = commons.Escaper.ecapeVariable('$project') + '/taskqueues/' + commons.
Escaper.ecapeVariable('$taskqueue') + '/tasks/' + commons.Escaper.ecapeVariable(
'$task'); |
478 | 479 |
479 var _response = _requester.request(_url, | 480 var _response = _requester.request(_url, |
480 "POST", | 481 "POST", |
481 body: _body, | 482 body: _body, |
482 queryParams: _queryParams, | 483 queryParams: _queryParams, |
483 uploadOptions: _uploadOptions, | 484 uploadOptions: _uploadOptions, |
484 uploadMedia: _uploadMedia, | 485 uploadMedia: _uploadMedia, |
485 downloadOptions: _downloadOptions); | 486 downloadOptions: _downloadOptions); |
486 return _response.then((data) => new Task.fromJson(data)); | 487 return _response.then((data) => new Task.fromJson(data)); |
487 } | 488 } |
488 | 489 |
489 } | 490 } |
490 | 491 |
491 | 492 |
492 | 493 |
493 /** Not documented yet. */ | |
494 class Task { | 494 class Task { |
495 /** Time (in seconds since the epoch) at which the task was enqueued. */ | 495 /** Time (in seconds since the epoch) at which the task was enqueued. */ |
496 core.String enqueueTimestamp; | 496 core.String enqueueTimestamp; |
497 | 497 |
498 /** Name of the task. */ | 498 /** Name of the task. */ |
499 core.String id; | 499 core.String id; |
500 | 500 |
501 /** The kind of object returned, in this case set to task. */ | 501 /** The kind of object returned, in this case set to task. */ |
502 core.String kind; | 502 core.String kind; |
503 | 503 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 _json["oldestTask"] = oldestTask; | 683 _json["oldestTask"] = oldestTask; |
684 } | 684 } |
685 if (totalTasks != null) { | 685 if (totalTasks != null) { |
686 _json["totalTasks"] = totalTasks; | 686 _json["totalTasks"] = totalTasks; |
687 } | 687 } |
688 return _json; | 688 return _json; |
689 } | 689 } |
690 } | 690 } |
691 | 691 |
692 | 692 |
693 /** Not documented yet. */ | |
694 class TaskQueue { | 693 class TaskQueue { |
695 /** ACLs that are applicable to this TaskQueue object. */ | 694 /** ACLs that are applicable to this TaskQueue object. */ |
696 TaskQueueAcl acl; | 695 TaskQueueAcl acl; |
697 | 696 |
698 /** Name of the taskqueue. */ | 697 /** Name of the taskqueue. */ |
699 core.String id; | 698 core.String id; |
700 | 699 |
701 /** The kind of REST object returned, in this case taskqueue. */ | 700 /** The kind of REST object returned, in this case taskqueue. */ |
702 core.String kind; | 701 core.String kind; |
703 | 702 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 _json["maxLeases"] = maxLeases; | 745 _json["maxLeases"] = maxLeases; |
747 } | 746 } |
748 if (stats != null) { | 747 if (stats != null) { |
749 _json["stats"] = (stats).toJson(); | 748 _json["stats"] = (stats).toJson(); |
750 } | 749 } |
751 return _json; | 750 return _json; |
752 } | 751 } |
753 } | 752 } |
754 | 753 |
755 | 754 |
756 /** Not documented yet. */ | |
757 class Tasks { | 755 class Tasks { |
758 /** The actual list of tasks returned as a result of the lease operation. */ | 756 /** The actual list of tasks returned as a result of the lease operation. */ |
759 core.List<Task> items; | 757 core.List<Task> items; |
760 | 758 |
761 /** The kind of object returned, a list of tasks. */ | 759 /** The kind of object returned, a list of tasks. */ |
762 core.String kind; | 760 core.String kind; |
763 | 761 |
764 | 762 |
765 Tasks(); | 763 Tasks(); |
766 | 764 |
(...skipping 12 matching lines...) Expand all Loading... |
779 _json["items"] = items.map((value) => (value).toJson()).toList(); | 777 _json["items"] = items.map((value) => (value).toJson()).toList(); |
780 } | 778 } |
781 if (kind != null) { | 779 if (kind != null) { |
782 _json["kind"] = kind; | 780 _json["kind"] = kind; |
783 } | 781 } |
784 return _json; | 782 return _json; |
785 } | 783 } |
786 } | 784 } |
787 | 785 |
788 | 786 |
789 /** Not documented yet. */ | |
790 class Tasks2 { | 787 class Tasks2 { |
791 /** The actual list of tasks currently active in the TaskQueue. */ | 788 /** The actual list of tasks currently active in the TaskQueue. */ |
792 core.List<Task> items; | 789 core.List<Task> items; |
793 | 790 |
794 /** The kind of object returned, a list of tasks. */ | 791 /** The kind of object returned, a list of tasks. */ |
795 core.String kind; | 792 core.String kind; |
796 | 793 |
797 | 794 |
798 Tasks2(); | 795 Tasks2(); |
799 | 796 |
(...skipping 10 matching lines...) Expand all Loading... |
810 var _json = new core.Map(); | 807 var _json = new core.Map(); |
811 if (items != null) { | 808 if (items != null) { |
812 _json["items"] = items.map((value) => (value).toJson()).toList(); | 809 _json["items"] = items.map((value) => (value).toJson()).toList(); |
813 } | 810 } |
814 if (kind != null) { | 811 if (kind != null) { |
815 _json["kind"] = kind; | 812 _json["kind"] = kind; |
816 } | 813 } |
817 return _json; | 814 return _json; |
818 } | 815 } |
819 } | 816 } |
820 | |
821 | |
OLD | NEW |