OLD | NEW |
(Empty) | |
| 1 library googleapis_beta.taskqueue.v1beta2; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 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 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** Lets you access a Google App Engine Pull Task Queue over REST. */ |
| 17 class TaskqueueApi { |
| 18 /** Manage your Tasks and Taskqueues */ |
| 19 static const TaskqueueScope = "https://www.googleapis.com/auth/taskqueue"; |
| 20 |
| 21 /** Consume Tasks from your Taskqueues */ |
| 22 static const TaskqueueConsumerScope = "https://www.googleapis.com/auth/taskque
ue.consumer"; |
| 23 |
| 24 |
| 25 final common_internal.ApiRequester _requester; |
| 26 |
| 27 TaskqueuesResourceApi get taskqueues => new TaskqueuesResourceApi(_requester); |
| 28 TasksResourceApi get tasks => new TasksResourceApi(_requester); |
| 29 |
| 30 TaskqueueApi(http.Client client) : |
| 31 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/taskqueue/v1beta2/projects/"); |
| 32 } |
| 33 |
| 34 |
| 35 /** Not documented yet. */ |
| 36 class TaskqueuesResourceApi { |
| 37 final common_internal.ApiRequester _requester; |
| 38 |
| 39 TaskqueuesResourceApi(common_internal.ApiRequester client) : |
| 40 _requester = client; |
| 41 |
| 42 /** |
| 43 * Get detailed information about a TaskQueue. |
| 44 * |
| 45 * Request parameters: |
| 46 * |
| 47 * [project] - The project under which the queue lies. |
| 48 * |
| 49 * [taskqueue] - The id of the taskqueue to get the properties of. |
| 50 * |
| 51 * [getStats] - Whether to get stats. Optional. |
| 52 * |
| 53 * Completes with a [TaskQueue]. |
| 54 * |
| 55 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 56 * error. |
| 57 * |
| 58 * If the used [http.Client] completes with an error when making a REST call, |
| 59 * this method will complete with the same error. |
| 60 */ |
| 61 async.Future<TaskQueue> get(core.String project, core.String taskqueue, {core.
bool getStats}) { |
| 62 var _url = null; |
| 63 var _queryParams = new core.Map(); |
| 64 var _uploadMedia = null; |
| 65 var _uploadOptions = null; |
| 66 var _downloadOptions = common.DownloadOptions.Metadata; |
| 67 var _body = null; |
| 68 |
| 69 if (project == null) { |
| 70 throw new core.ArgumentError("Parameter project is required."); |
| 71 } |
| 72 if (taskqueue == null) { |
| 73 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 74 } |
| 75 if (getStats != null) { |
| 76 _queryParams["getStats"] = ["${getStats}"]; |
| 77 } |
| 78 |
| 79 |
| 80 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue'); |
| 81 |
| 82 var _response = _requester.request(_url, |
| 83 "GET", |
| 84 body: _body, |
| 85 queryParams: _queryParams, |
| 86 uploadOptions: _uploadOptions, |
| 87 uploadMedia: _uploadMedia, |
| 88 downloadOptions: _downloadOptions); |
| 89 return _response.then((data) => new TaskQueue.fromJson(data)); |
| 90 } |
| 91 |
| 92 } |
| 93 |
| 94 |
| 95 /** Not documented yet. */ |
| 96 class TasksResourceApi { |
| 97 final common_internal.ApiRequester _requester; |
| 98 |
| 99 TasksResourceApi(common_internal.ApiRequester client) : |
| 100 _requester = client; |
| 101 |
| 102 /** |
| 103 * Delete a task from a TaskQueue. |
| 104 * |
| 105 * Request parameters: |
| 106 * |
| 107 * [project] - The project under which the queue lies. |
| 108 * |
| 109 * [taskqueue] - The taskqueue to delete a task from. |
| 110 * |
| 111 * [task] - The id of the task to delete. |
| 112 * |
| 113 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 114 * error. |
| 115 * |
| 116 * If the used [http.Client] completes with an error when making a REST call, |
| 117 * this method will complete with the same error. |
| 118 */ |
| 119 async.Future delete(core.String project, core.String taskqueue, core.String ta
sk) { |
| 120 var _url = null; |
| 121 var _queryParams = new core.Map(); |
| 122 var _uploadMedia = null; |
| 123 var _uploadOptions = null; |
| 124 var _downloadOptions = common.DownloadOptions.Metadata; |
| 125 var _body = null; |
| 126 |
| 127 if (project == null) { |
| 128 throw new core.ArgumentError("Parameter project is required."); |
| 129 } |
| 130 if (taskqueue == null) { |
| 131 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 132 } |
| 133 if (task == null) { |
| 134 throw new core.ArgumentError("Parameter task is required."); |
| 135 } |
| 136 |
| 137 _downloadOptions = null; |
| 138 |
| 139 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); |
| 140 |
| 141 var _response = _requester.request(_url, |
| 142 "DELETE", |
| 143 body: _body, |
| 144 queryParams: _queryParams, |
| 145 uploadOptions: _uploadOptions, |
| 146 uploadMedia: _uploadMedia, |
| 147 downloadOptions: _downloadOptions); |
| 148 return _response.then((data) => null); |
| 149 } |
| 150 |
| 151 /** |
| 152 * Get a particular task from a TaskQueue. |
| 153 * |
| 154 * Request parameters: |
| 155 * |
| 156 * [project] - The project under which the queue lies. |
| 157 * |
| 158 * [taskqueue] - The taskqueue in which the task belongs. |
| 159 * |
| 160 * [task] - The task to get properties of. |
| 161 * |
| 162 * Completes with a [Task]. |
| 163 * |
| 164 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 165 * error. |
| 166 * |
| 167 * If the used [http.Client] completes with an error when making a REST call, |
| 168 * this method will complete with the same error. |
| 169 */ |
| 170 async.Future<Task> get(core.String project, core.String taskqueue, core.String
task) { |
| 171 var _url = null; |
| 172 var _queryParams = new core.Map(); |
| 173 var _uploadMedia = null; |
| 174 var _uploadOptions = null; |
| 175 var _downloadOptions = common.DownloadOptions.Metadata; |
| 176 var _body = null; |
| 177 |
| 178 if (project == null) { |
| 179 throw new core.ArgumentError("Parameter project is required."); |
| 180 } |
| 181 if (taskqueue == null) { |
| 182 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 183 } |
| 184 if (task == null) { |
| 185 throw new core.ArgumentError("Parameter task is required."); |
| 186 } |
| 187 |
| 188 |
| 189 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); |
| 190 |
| 191 var _response = _requester.request(_url, |
| 192 "GET", |
| 193 body: _body, |
| 194 queryParams: _queryParams, |
| 195 uploadOptions: _uploadOptions, |
| 196 uploadMedia: _uploadMedia, |
| 197 downloadOptions: _downloadOptions); |
| 198 return _response.then((data) => new Task.fromJson(data)); |
| 199 } |
| 200 |
| 201 /** |
| 202 * Insert a new task in a TaskQueue |
| 203 * |
| 204 * [request] - The metadata request object. |
| 205 * |
| 206 * Request parameters: |
| 207 * |
| 208 * [project] - The project under which the queue lies |
| 209 * |
| 210 * [taskqueue] - The taskqueue to insert the task into |
| 211 * |
| 212 * Completes with a [Task]. |
| 213 * |
| 214 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 215 * error. |
| 216 * |
| 217 * If the used [http.Client] completes with an error when making a REST call, |
| 218 * this method will complete with the same error. |
| 219 */ |
| 220 async.Future<Task> insert(Task request, core.String project, core.String taskq
ueue) { |
| 221 var _url = null; |
| 222 var _queryParams = new core.Map(); |
| 223 var _uploadMedia = null; |
| 224 var _uploadOptions = null; |
| 225 var _downloadOptions = common.DownloadOptions.Metadata; |
| 226 var _body = null; |
| 227 |
| 228 if (request != null) { |
| 229 _body = convert.JSON.encode((request).toJson()); |
| 230 } |
| 231 if (project == null) { |
| 232 throw new core.ArgumentError("Parameter project is required."); |
| 233 } |
| 234 if (taskqueue == null) { |
| 235 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 236 } |
| 237 |
| 238 |
| 239 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks'; |
| 240 |
| 241 var _response = _requester.request(_url, |
| 242 "POST", |
| 243 body: _body, |
| 244 queryParams: _queryParams, |
| 245 uploadOptions: _uploadOptions, |
| 246 uploadMedia: _uploadMedia, |
| 247 downloadOptions: _downloadOptions); |
| 248 return _response.then((data) => new Task.fromJson(data)); |
| 249 } |
| 250 |
| 251 /** |
| 252 * Lease 1 or more tasks from a TaskQueue. |
| 253 * |
| 254 * Request parameters: |
| 255 * |
| 256 * [project] - The project under which the queue lies. |
| 257 * |
| 258 * [taskqueue] - The taskqueue to lease a task from. |
| 259 * |
| 260 * [numTasks] - The number of tasks to lease. |
| 261 * |
| 262 * [leaseSecs] - The lease in seconds. |
| 263 * |
| 264 * [groupByTag] - When true, all returned tasks will have the same tag |
| 265 * |
| 266 * [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 * the tag will be that of the oldest task by eta, i.e. the first available |
| 269 * tag |
| 270 * |
| 271 * Completes with a [Tasks]. |
| 272 * |
| 273 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 274 * error. |
| 275 * |
| 276 * If the used [http.Client] completes with an error when making a REST call, |
| 277 * this method will complete with the same error. |
| 278 */ |
| 279 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 _queryParams = new core.Map(); |
| 282 var _uploadMedia = null; |
| 283 var _uploadOptions = null; |
| 284 var _downloadOptions = common.DownloadOptions.Metadata; |
| 285 var _body = null; |
| 286 |
| 287 if (project == null) { |
| 288 throw new core.ArgumentError("Parameter project is required."); |
| 289 } |
| 290 if (taskqueue == null) { |
| 291 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 292 } |
| 293 if (numTasks == null) { |
| 294 throw new core.ArgumentError("Parameter numTasks is required."); |
| 295 } |
| 296 _queryParams["numTasks"] = ["${numTasks}"]; |
| 297 if (leaseSecs == null) { |
| 298 throw new core.ArgumentError("Parameter leaseSecs is required."); |
| 299 } |
| 300 _queryParams["leaseSecs"] = ["${leaseSecs}"]; |
| 301 if (groupByTag != null) { |
| 302 _queryParams["groupByTag"] = ["${groupByTag}"]; |
| 303 } |
| 304 if (tag != null) { |
| 305 _queryParams["tag"] = [tag]; |
| 306 } |
| 307 |
| 308 |
| 309 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/lease'; |
| 310 |
| 311 var _response = _requester.request(_url, |
| 312 "POST", |
| 313 body: _body, |
| 314 queryParams: _queryParams, |
| 315 uploadOptions: _uploadOptions, |
| 316 uploadMedia: _uploadMedia, |
| 317 downloadOptions: _downloadOptions); |
| 318 return _response.then((data) => new Tasks.fromJson(data)); |
| 319 } |
| 320 |
| 321 /** |
| 322 * List Tasks in a TaskQueue |
| 323 * |
| 324 * Request parameters: |
| 325 * |
| 326 * [project] - The project under which the queue lies. |
| 327 * |
| 328 * [taskqueue] - The id of the taskqueue to list tasks from. |
| 329 * |
| 330 * Completes with a [Tasks2]. |
| 331 * |
| 332 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 333 * error. |
| 334 * |
| 335 * If the used [http.Client] completes with an error when making a REST call, |
| 336 * this method will complete with the same error. |
| 337 */ |
| 338 async.Future<Tasks2> list(core.String project, core.String taskqueue) { |
| 339 var _url = null; |
| 340 var _queryParams = new core.Map(); |
| 341 var _uploadMedia = null; |
| 342 var _uploadOptions = null; |
| 343 var _downloadOptions = common.DownloadOptions.Metadata; |
| 344 var _body = null; |
| 345 |
| 346 if (project == null) { |
| 347 throw new core.ArgumentError("Parameter project is required."); |
| 348 } |
| 349 if (taskqueue == null) { |
| 350 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 351 } |
| 352 |
| 353 |
| 354 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks'; |
| 355 |
| 356 var _response = _requester.request(_url, |
| 357 "GET", |
| 358 body: _body, |
| 359 queryParams: _queryParams, |
| 360 uploadOptions: _uploadOptions, |
| 361 uploadMedia: _uploadMedia, |
| 362 downloadOptions: _downloadOptions); |
| 363 return _response.then((data) => new Tasks2.fromJson(data)); |
| 364 } |
| 365 |
| 366 /** |
| 367 * Update tasks that are leased out of a TaskQueue. This method supports patch |
| 368 * semantics. |
| 369 * |
| 370 * [request] - The metadata request object. |
| 371 * |
| 372 * Request parameters: |
| 373 * |
| 374 * [project] - The project under which the queue lies. |
| 375 * |
| 376 * [taskqueue] - null |
| 377 * |
| 378 * [task] - null |
| 379 * |
| 380 * [newLeaseSeconds] - The new lease in seconds. |
| 381 * |
| 382 * Completes with a [Task]. |
| 383 * |
| 384 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 385 * error. |
| 386 * |
| 387 * If the used [http.Client] completes with an error when making a REST call, |
| 388 * this method will complete with the same error. |
| 389 */ |
| 390 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 _queryParams = new core.Map(); |
| 393 var _uploadMedia = null; |
| 394 var _uploadOptions = null; |
| 395 var _downloadOptions = common.DownloadOptions.Metadata; |
| 396 var _body = null; |
| 397 |
| 398 if (request != null) { |
| 399 _body = convert.JSON.encode((request).toJson()); |
| 400 } |
| 401 if (project == null) { |
| 402 throw new core.ArgumentError("Parameter project is required."); |
| 403 } |
| 404 if (taskqueue == null) { |
| 405 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 406 } |
| 407 if (task == null) { |
| 408 throw new core.ArgumentError("Parameter task is required."); |
| 409 } |
| 410 if (newLeaseSeconds == null) { |
| 411 throw new core.ArgumentError("Parameter newLeaseSeconds is required."); |
| 412 } |
| 413 _queryParams["newLeaseSeconds"] = ["${newLeaseSeconds}"]; |
| 414 |
| 415 |
| 416 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); |
| 417 |
| 418 var _response = _requester.request(_url, |
| 419 "PATCH", |
| 420 body: _body, |
| 421 queryParams: _queryParams, |
| 422 uploadOptions: _uploadOptions, |
| 423 uploadMedia: _uploadMedia, |
| 424 downloadOptions: _downloadOptions); |
| 425 return _response.then((data) => new Task.fromJson(data)); |
| 426 } |
| 427 |
| 428 /** |
| 429 * Update tasks that are leased out of a TaskQueue. |
| 430 * |
| 431 * [request] - The metadata request object. |
| 432 * |
| 433 * Request parameters: |
| 434 * |
| 435 * [project] - The project under which the queue lies. |
| 436 * |
| 437 * [taskqueue] - null |
| 438 * |
| 439 * [task] - null |
| 440 * |
| 441 * [newLeaseSeconds] - The new lease in seconds. |
| 442 * |
| 443 * Completes with a [Task]. |
| 444 * |
| 445 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 446 * error. |
| 447 * |
| 448 * If the used [http.Client] completes with an error when making a REST call, |
| 449 * this method will complete with the same error. |
| 450 */ |
| 451 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 _queryParams = new core.Map(); |
| 454 var _uploadMedia = null; |
| 455 var _uploadOptions = null; |
| 456 var _downloadOptions = common.DownloadOptions.Metadata; |
| 457 var _body = null; |
| 458 |
| 459 if (request != null) { |
| 460 _body = convert.JSON.encode((request).toJson()); |
| 461 } |
| 462 if (project == null) { |
| 463 throw new core.ArgumentError("Parameter project is required."); |
| 464 } |
| 465 if (taskqueue == null) { |
| 466 throw new core.ArgumentError("Parameter taskqueue is required."); |
| 467 } |
| 468 if (task == null) { |
| 469 throw new core.ArgumentError("Parameter task is required."); |
| 470 } |
| 471 if (newLeaseSeconds == null) { |
| 472 throw new core.ArgumentError("Parameter newLeaseSeconds is required."); |
| 473 } |
| 474 _queryParams["newLeaseSeconds"] = ["${newLeaseSeconds}"]; |
| 475 |
| 476 |
| 477 _url = common_internal.Escaper.ecapeVariable('$project') + '/taskqueues/' +
common_internal.Escaper.ecapeVariable('$taskqueue') + '/tasks/' + common_interna
l.Escaper.ecapeVariable('$task'); |
| 478 |
| 479 var _response = _requester.request(_url, |
| 480 "POST", |
| 481 body: _body, |
| 482 queryParams: _queryParams, |
| 483 uploadOptions: _uploadOptions, |
| 484 uploadMedia: _uploadMedia, |
| 485 downloadOptions: _downloadOptions); |
| 486 return _response.then((data) => new Task.fromJson(data)); |
| 487 } |
| 488 |
| 489 } |
| 490 |
| 491 |
| 492 |
| 493 /** Not documented yet. */ |
| 494 class Task { |
| 495 /** Time (in seconds since the epoch) at which the task was enqueued. */ |
| 496 core.String enqueueTimestamp; |
| 497 |
| 498 /** Name of the task. */ |
| 499 core.String id; |
| 500 |
| 501 /** The kind of object returned, in this case set to task. */ |
| 502 core.String kind; |
| 503 |
| 504 /** |
| 505 * Time (in seconds since the epoch) at which the task lease will expire. This |
| 506 * value is 0 if the task isnt currently leased out to a worker. |
| 507 */ |
| 508 core.String leaseTimestamp; |
| 509 |
| 510 /** |
| 511 * A bag of bytes which is the task payload. The payload on the JSON side is |
| 512 * always Base64 encoded. |
| 513 */ |
| 514 core.String payloadBase64; |
| 515 |
| 516 /** Name of the queue that the task is in. */ |
| 517 core.String queueName; |
| 518 |
| 519 /** The number of leases applied to this task. */ |
| 520 core.int retryCount; |
| 521 |
| 522 /** |
| 523 * Tag for the task, could be used later to lease tasks grouped by a specific |
| 524 * tag. |
| 525 */ |
| 526 core.String tag; |
| 527 |
| 528 |
| 529 Task(); |
| 530 |
| 531 Task.fromJson(core.Map _json) { |
| 532 if (_json.containsKey("enqueueTimestamp")) { |
| 533 enqueueTimestamp = _json["enqueueTimestamp"]; |
| 534 } |
| 535 if (_json.containsKey("id")) { |
| 536 id = _json["id"]; |
| 537 } |
| 538 if (_json.containsKey("kind")) { |
| 539 kind = _json["kind"]; |
| 540 } |
| 541 if (_json.containsKey("leaseTimestamp")) { |
| 542 leaseTimestamp = _json["leaseTimestamp"]; |
| 543 } |
| 544 if (_json.containsKey("payloadBase64")) { |
| 545 payloadBase64 = _json["payloadBase64"]; |
| 546 } |
| 547 if (_json.containsKey("queueName")) { |
| 548 queueName = _json["queueName"]; |
| 549 } |
| 550 if (_json.containsKey("retry_count")) { |
| 551 retryCount = _json["retry_count"]; |
| 552 } |
| 553 if (_json.containsKey("tag")) { |
| 554 tag = _json["tag"]; |
| 555 } |
| 556 } |
| 557 |
| 558 core.Map toJson() { |
| 559 var _json = new core.Map(); |
| 560 if (enqueueTimestamp != null) { |
| 561 _json["enqueueTimestamp"] = enqueueTimestamp; |
| 562 } |
| 563 if (id != null) { |
| 564 _json["id"] = id; |
| 565 } |
| 566 if (kind != null) { |
| 567 _json["kind"] = kind; |
| 568 } |
| 569 if (leaseTimestamp != null) { |
| 570 _json["leaseTimestamp"] = leaseTimestamp; |
| 571 } |
| 572 if (payloadBase64 != null) { |
| 573 _json["payloadBase64"] = payloadBase64; |
| 574 } |
| 575 if (queueName != null) { |
| 576 _json["queueName"] = queueName; |
| 577 } |
| 578 if (retryCount != null) { |
| 579 _json["retry_count"] = retryCount; |
| 580 } |
| 581 if (tag != null) { |
| 582 _json["tag"] = tag; |
| 583 } |
| 584 return _json; |
| 585 } |
| 586 } |
| 587 |
| 588 |
| 589 /** ACLs that are applicable to this TaskQueue object. */ |
| 590 class TaskQueueAcl { |
| 591 /** |
| 592 * Email addresses of users who are "admins" of the TaskQueue. This means they |
| 593 * can control the queue, eg set ACLs for the queue. |
| 594 */ |
| 595 core.List<core.String> adminEmails; |
| 596 |
| 597 /** |
| 598 * Email addresses of users who can "consume" tasks from the TaskQueue. This |
| 599 * means they can Dequeue and Delete tasks from the queue. |
| 600 */ |
| 601 core.List<core.String> consumerEmails; |
| 602 |
| 603 /** |
| 604 * Email addresses of users who can "produce" tasks into the TaskQueue. This |
| 605 * means they can Insert tasks into the queue. |
| 606 */ |
| 607 core.List<core.String> producerEmails; |
| 608 |
| 609 |
| 610 TaskQueueAcl(); |
| 611 |
| 612 TaskQueueAcl.fromJson(core.Map _json) { |
| 613 if (_json.containsKey("adminEmails")) { |
| 614 adminEmails = _json["adminEmails"]; |
| 615 } |
| 616 if (_json.containsKey("consumerEmails")) { |
| 617 consumerEmails = _json["consumerEmails"]; |
| 618 } |
| 619 if (_json.containsKey("producerEmails")) { |
| 620 producerEmails = _json["producerEmails"]; |
| 621 } |
| 622 } |
| 623 |
| 624 core.Map toJson() { |
| 625 var _json = new core.Map(); |
| 626 if (adminEmails != null) { |
| 627 _json["adminEmails"] = adminEmails; |
| 628 } |
| 629 if (consumerEmails != null) { |
| 630 _json["consumerEmails"] = consumerEmails; |
| 631 } |
| 632 if (producerEmails != null) { |
| 633 _json["producerEmails"] = producerEmails; |
| 634 } |
| 635 return _json; |
| 636 } |
| 637 } |
| 638 |
| 639 |
| 640 /** Statistics for the TaskQueue object in question. */ |
| 641 class TaskQueueStats { |
| 642 /** Number of tasks leased in the last hour. */ |
| 643 core.String leasedLastHour; |
| 644 |
| 645 /** Number of tasks leased in the last minute. */ |
| 646 core.String leasedLastMinute; |
| 647 |
| 648 /** |
| 649 * The timestamp (in seconds since the epoch) of the oldest unfinished task. |
| 650 */ |
| 651 core.String oldestTask; |
| 652 |
| 653 /** Number of tasks in the queue. */ |
| 654 core.int totalTasks; |
| 655 |
| 656 |
| 657 TaskQueueStats(); |
| 658 |
| 659 TaskQueueStats.fromJson(core.Map _json) { |
| 660 if (_json.containsKey("leasedLastHour")) { |
| 661 leasedLastHour = _json["leasedLastHour"]; |
| 662 } |
| 663 if (_json.containsKey("leasedLastMinute")) { |
| 664 leasedLastMinute = _json["leasedLastMinute"]; |
| 665 } |
| 666 if (_json.containsKey("oldestTask")) { |
| 667 oldestTask = _json["oldestTask"]; |
| 668 } |
| 669 if (_json.containsKey("totalTasks")) { |
| 670 totalTasks = _json["totalTasks"]; |
| 671 } |
| 672 } |
| 673 |
| 674 core.Map toJson() { |
| 675 var _json = new core.Map(); |
| 676 if (leasedLastHour != null) { |
| 677 _json["leasedLastHour"] = leasedLastHour; |
| 678 } |
| 679 if (leasedLastMinute != null) { |
| 680 _json["leasedLastMinute"] = leasedLastMinute; |
| 681 } |
| 682 if (oldestTask != null) { |
| 683 _json["oldestTask"] = oldestTask; |
| 684 } |
| 685 if (totalTasks != null) { |
| 686 _json["totalTasks"] = totalTasks; |
| 687 } |
| 688 return _json; |
| 689 } |
| 690 } |
| 691 |
| 692 |
| 693 /** Not documented yet. */ |
| 694 class TaskQueue { |
| 695 /** ACLs that are applicable to this TaskQueue object. */ |
| 696 TaskQueueAcl acl; |
| 697 |
| 698 /** Name of the taskqueue. */ |
| 699 core.String id; |
| 700 |
| 701 /** The kind of REST object returned, in this case taskqueue. */ |
| 702 core.String kind; |
| 703 |
| 704 /** |
| 705 * The number of times we should lease out tasks before giving up on them. If |
| 706 * unset we lease them out forever until a worker deletes the task. |
| 707 */ |
| 708 core.int maxLeases; |
| 709 |
| 710 /** Statistics for the TaskQueue object in question. */ |
| 711 TaskQueueStats stats; |
| 712 |
| 713 |
| 714 TaskQueue(); |
| 715 |
| 716 TaskQueue.fromJson(core.Map _json) { |
| 717 if (_json.containsKey("acl")) { |
| 718 acl = new TaskQueueAcl.fromJson(_json["acl"]); |
| 719 } |
| 720 if (_json.containsKey("id")) { |
| 721 id = _json["id"]; |
| 722 } |
| 723 if (_json.containsKey("kind")) { |
| 724 kind = _json["kind"]; |
| 725 } |
| 726 if (_json.containsKey("maxLeases")) { |
| 727 maxLeases = _json["maxLeases"]; |
| 728 } |
| 729 if (_json.containsKey("stats")) { |
| 730 stats = new TaskQueueStats.fromJson(_json["stats"]); |
| 731 } |
| 732 } |
| 733 |
| 734 core.Map toJson() { |
| 735 var _json = new core.Map(); |
| 736 if (acl != null) { |
| 737 _json["acl"] = (acl).toJson(); |
| 738 } |
| 739 if (id != null) { |
| 740 _json["id"] = id; |
| 741 } |
| 742 if (kind != null) { |
| 743 _json["kind"] = kind; |
| 744 } |
| 745 if (maxLeases != null) { |
| 746 _json["maxLeases"] = maxLeases; |
| 747 } |
| 748 if (stats != null) { |
| 749 _json["stats"] = (stats).toJson(); |
| 750 } |
| 751 return _json; |
| 752 } |
| 753 } |
| 754 |
| 755 |
| 756 /** Not documented yet. */ |
| 757 class Tasks { |
| 758 /** The actual list of tasks returned as a result of the lease operation. */ |
| 759 core.List<Task> items; |
| 760 |
| 761 /** The kind of object returned, a list of tasks. */ |
| 762 core.String kind; |
| 763 |
| 764 |
| 765 Tasks(); |
| 766 |
| 767 Tasks.fromJson(core.Map _json) { |
| 768 if (_json.containsKey("items")) { |
| 769 items = _json["items"].map((value) => new Task.fromJson(value)).toList(); |
| 770 } |
| 771 if (_json.containsKey("kind")) { |
| 772 kind = _json["kind"]; |
| 773 } |
| 774 } |
| 775 |
| 776 core.Map toJson() { |
| 777 var _json = new core.Map(); |
| 778 if (items != null) { |
| 779 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 780 } |
| 781 if (kind != null) { |
| 782 _json["kind"] = kind; |
| 783 } |
| 784 return _json; |
| 785 } |
| 786 } |
| 787 |
| 788 |
| 789 /** Not documented yet. */ |
| 790 class Tasks2 { |
| 791 /** The actual list of tasks currently active in the TaskQueue. */ |
| 792 core.List<Task> items; |
| 793 |
| 794 /** The kind of object returned, a list of tasks. */ |
| 795 core.String kind; |
| 796 |
| 797 |
| 798 Tasks2(); |
| 799 |
| 800 Tasks2.fromJson(core.Map _json) { |
| 801 if (_json.containsKey("items")) { |
| 802 items = _json["items"].map((value) => new Task.fromJson(value)).toList(); |
| 803 } |
| 804 if (_json.containsKey("kind")) { |
| 805 kind = _json["kind"]; |
| 806 } |
| 807 } |
| 808 |
| 809 core.Map toJson() { |
| 810 var _json = new core.Map(); |
| 811 if (items != null) { |
| 812 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 813 } |
| 814 if (kind != null) { |
| 815 _json["kind"] = kind; |
| 816 } |
| 817 return _json; |
| 818 } |
| 819 } |
| 820 |
| 821 |
OLD | NEW |