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