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.script.v1; | 3 library googleapis.script.v1; |
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' show |
13 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client script/v1'; | 15 const core.String USER_AGENT = 'dart-api-client script/v1'; |
16 | 16 |
17 /** Executes Google Apps Script projects. */ | 17 /** Executes functions in Google Apps Script projects. */ |
18 class ScriptApi { | 18 class ScriptApi { |
19 /** Read, send, delete, and manage your email */ | 19 /** Read, send, delete, and manage your email */ |
20 static const MailGoogleComScope = "https://mail.google.com/"; | 20 static const MailGoogleComScope = "https://mail.google.com/"; |
21 | 21 |
22 /** Manage your calendars */ | 22 /** Manage your calendars */ |
23 static const WwwGoogleComCalendarFeedsScope = "https://www.google.com/calendar
/feeds"; | 23 static const WwwGoogleComCalendarFeedsScope = "https://www.google.com/calendar
/feeds"; |
24 | 24 |
25 /** Manage your contacts */ | 25 /** Manage your contacts */ |
26 static const WwwGoogleComM8FeedsScope = "https://www.google.com/m8/feeds"; | 26 static const WwwGoogleComM8FeedsScope = "https://www.google.com/m8/feeds"; |
27 | 27 |
(...skipping 45 matching lines...) Loading... |
73 * least one of the scopes listed in the [Authorization](#authorization) | 73 * least one of the scopes listed in the [Authorization](#authorization) |
74 * section; script projects that do not require authorization cannot be | 74 * section; script projects that do not require authorization cannot be |
75 * executed through this API. To find the correct scopes to include in the | 75 * executed through this API. To find the correct scopes to include in the |
76 * authentication token, open the project in the script editor, then select | 76 * authentication token, open the project in the script editor, then select |
77 * **File > Project properties** and click the **Scopes** tab. | 77 * **File > Project properties** and click the **Scopes** tab. |
78 * | 78 * |
79 * [request] - The metadata request object. | 79 * [request] - The metadata request object. |
80 * | 80 * |
81 * Request parameters: | 81 * Request parameters: |
82 * | 82 * |
83 * [scriptId] - The project key of the script to be executed. To find the | 83 * [scriptId] - The script ID of the script to be executed. To find the script |
84 * project key, open | 84 * ID, open |
85 * the project in the script editor and select **File > Project properties**. | 85 * the project in the script editor and select **File > Project properties**. |
86 * | 86 * |
87 * Completes with a [Operation]. | 87 * Completes with a [Operation]. |
88 * | 88 * |
89 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 89 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
90 * error. | 90 * error. |
91 * | 91 * |
92 * If the used [http.Client] completes with an error when making a REST call, | 92 * If the used [http.Client] completes with an error when making a REST call, |
93 * this method will complete with the same error. | 93 * this method will complete with the same error. |
94 */ | 94 */ |
(...skipping 193 matching lines...) Loading... |
288 core.Map<core.String, core.Object> toJson() { | 288 core.Map<core.String, core.Object> toJson() { |
289 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 289 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
290 if (result != null) { | 290 if (result != null) { |
291 _json["result"] = result; | 291 _json["result"] = result; |
292 } | 292 } |
293 return _json; | 293 return _json; |
294 } | 294 } |
295 } | 295 } |
296 | 296 |
297 /** | 297 /** |
298 * A request to retrieve the results from a collection of requests, | |
299 * specified by the operation resource names. | |
300 */ | |
301 class JoinAsyncRequest { | |
302 /** | |
303 * List of operation resource names that we want to join, | |
304 * as returned from a call to RunAsync. | |
305 */ | |
306 core.List<core.String> names; | |
307 /** | |
308 * The script id which specifies the script which all processes in the names | |
309 * field must be from. | |
310 */ | |
311 core.String scriptId; | |
312 /** Timeout for information retrieval in milliseconds. */ | |
313 core.String timeout; | |
314 | |
315 JoinAsyncRequest(); | |
316 | |
317 JoinAsyncRequest.fromJson(core.Map _json) { | |
318 if (_json.containsKey("names")) { | |
319 names = _json["names"]; | |
320 } | |
321 if (_json.containsKey("scriptId")) { | |
322 scriptId = _json["scriptId"]; | |
323 } | |
324 if (_json.containsKey("timeout")) { | |
325 timeout = _json["timeout"]; | |
326 } | |
327 } | |
328 | |
329 core.Map<core.String, core.Object> toJson() { | |
330 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
331 if (names != null) { | |
332 _json["names"] = names; | |
333 } | |
334 if (scriptId != null) { | |
335 _json["scriptId"] = scriptId; | |
336 } | |
337 if (timeout != null) { | |
338 _json["timeout"] = timeout; | |
339 } | |
340 return _json; | |
341 } | |
342 } | |
343 | |
344 /** An object that provides the return value for the JoinAsync method. */ | |
345 class JoinAsyncResponse { | |
346 /** | |
347 * The return values for each script function, in a map of operation resource | |
348 * names to the Operation containing the result of the process. The response | |
349 * will contain either an error or the result of the script function. | |
350 */ | |
351 core.Map<core.String, Operation> results; | |
352 | |
353 JoinAsyncResponse(); | |
354 | |
355 JoinAsyncResponse.fromJson(core.Map _json) { | |
356 if (_json.containsKey("results")) { | |
357 results = commons.mapMap<core.Map<core.String, core.Object>, Operation>(_j
son["results"], (core.Map<core.String, core.Object> item) => new Operation.fromJ
son(item)); | |
358 } | |
359 } | |
360 | |
361 core.Map<core.String, core.Object> toJson() { | |
362 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
363 if (results != null) { | |
364 _json["results"] = commons.mapMap<Operation, core.Map<core.String, core.Ob
ject>>(results, (Operation item) => (item).toJson()); | |
365 } | |
366 return _json; | |
367 } | |
368 } | |
369 | |
370 /** | |
371 * The response will not arrive until the function finishes executing. The | 298 * The response will not arrive until the function finishes executing. The |
372 * maximum runtime is listed in the guide to [limitations in Apps | 299 * maximum runtime is listed in the guide to [limitations in Apps |
373 * Script](https://developers.google.com/apps-script/guides/services/quotas#curr
ent_limitations). | 300 * Script](https://developers.google.com/apps-script/guides/services/quotas#curr
ent_limitations). |
374 * <p>If the script function returns successfully, the `response` field will | 301 * <p>If the script function returns successfully, the `response` field will |
375 * contain an `ExecutionResponse` object with the function's return value in the | 302 * contain an `ExecutionResponse` object with the function's return value in the |
376 * object's `result` field.</p> | 303 * object's `result` field.</p> |
377 * <p>If the script function (or Apps Script itself) throws an exception, the | 304 * <p>If the script function (or Apps Script itself) throws an exception, the |
378 * `error` field will contain a `Status` object. The `Status` object's `details` | 305 * `error` field will contain a `Status` object. The `Status` object's `details` |
379 * field will contain an array with a single `ExecutionError` object that | 306 * field will contain an array with a single `ExecutionError` object that |
380 * provides information about the nature of the error.</p> | 307 * provides information about the nature of the error.</p> |
381 * <p>If the `run` call itself fails (for example, because of a malformed | 308 * <p>If the `run` call itself fails (for example, because of a malformed |
382 * request or an authorization error), the method will return an HTTP response | 309 * request or an authorization error), the method will return an HTTP response |
383 * code in the 4XX range with a different format for the response body. Client | 310 * code in the 4XX range with a different format for the response body. Client |
384 * libraries will automatically convert a 4XX response into an exception | 311 * libraries will automatically convert a 4XX response into an exception |
385 * class.</p> | 312 * class.</p> |
386 */ | 313 */ |
387 class Operation { | 314 class Operation { |
388 /** This field is not used. */ | 315 /** |
| 316 * This field is only used with asynchronous executions and indicates whether |
| 317 * or not the script execution has completed. A completed execution has a |
| 318 * populated response field containing the `ExecutionResponse` from function |
| 319 * that was executed. |
| 320 */ |
389 core.bool done; | 321 core.bool done; |
390 /** | 322 /** |
391 * If a `run` call succeeds but the script function (or Apps Script itself) | 323 * If a `run` call succeeds but the script function (or Apps Script itself) |
392 * throws an exception, this field will contain a `Status` object. The | 324 * throws an exception, this field will contain a `Status` object. The |
393 * `Status` object's `details` field will contain an array with a single | 325 * `Status` object's `details` field will contain an array with a single |
394 * `ExecutionError` object that provides information about the nature of the | 326 * `ExecutionError` object that provides information about the nature of the |
395 * error. | 327 * error. |
396 */ | 328 */ |
397 Status error; | 329 Status error; |
398 /** | 330 /** |
399 * This field is not used. | 331 * This field is not used. |
400 * | 332 * |
401 * The values for Object must be JSON objects. It can consist of `num`, | 333 * The values for Object must be JSON objects. It can consist of `num`, |
402 * `String`, `bool` and `null` as well as `Map` and `List` values. | 334 * `String`, `bool` and `null` as well as `Map` and `List` values. |
403 */ | 335 */ |
404 core.Map<core.String, core.Object> metadata; | 336 core.Map<core.String, core.Object> metadata; |
405 /** This field is not used. */ | 337 /** |
| 338 * This field is only used with asynchronous executions and contains a unique |
| 339 * identifier that can be used to subsequently invoke a `get` `cancel` or |
| 340 * `join` on the asynchronous script execution identified by this name. |
| 341 */ |
406 core.String name; | 342 core.String name; |
407 /** | 343 /** |
408 * If the script function returns successfully, this field will contain an | 344 * If the script function returns successfully, this field will contain an |
409 * `ExecutionResponse` object with the function's return value as the object's | 345 * `ExecutionResponse` object with the function's return value as the object's |
410 * `result` field. | 346 * `result` field. |
411 * | 347 * |
412 * The values for Object must be JSON objects. It can consist of `num`, | 348 * The values for Object must be JSON objects. It can consist of `num`, |
413 * `String`, `bool` and `null` as well as `Map` and `List` values. | 349 * `String`, `bool` and `null` as well as `Map` and `List` values. |
414 */ | 350 */ |
415 core.Map<core.String, core.Object> response; | 351 core.Map<core.String, core.Object> response; |
(...skipping 70 matching lines...) Loading... |
486 } | 422 } |
487 | 423 |
488 /** | 424 /** |
489 * If a `run` call succeeds but the script function (or Apps Script itself) | 425 * If a `run` call succeeds but the script function (or Apps Script itself) |
490 * throws an exception, the response body's `error` field will contain this | 426 * throws an exception, the response body's `error` field will contain this |
491 * `Status` object. | 427 * `Status` object. |
492 */ | 428 */ |
493 class Status { | 429 class Status { |
494 /** | 430 /** |
495 * The status code. For this API, this value will always be 3, corresponding | 431 * The status code. For this API, this value will always be 3, corresponding |
496 * to an INVALID_ARGUMENT error. | 432 * to an <code>INVALID_ARGUMENT</code> error. |
497 */ | 433 */ |
498 core.int code; | 434 core.int code; |
499 /** | 435 /** |
500 * An array that contains a single `ExecutionError` object that provides | 436 * An array that contains a single `ExecutionError` object that provides |
501 * information about the nature of the error. | 437 * information about the nature of the error. |
502 * | 438 * |
503 * The values for Object must be JSON objects. It can consist of `num`, | 439 * The values for Object must be JSON objects. It can consist of `num`, |
504 * `String`, `bool` and `null` as well as `Map` and `List` values. | 440 * `String`, `bool` and `null` as well as `Map` and `List` values. |
505 */ | 441 */ |
506 core.List<core.Map<core.String, core.Object>> details; | 442 core.List<core.Map<core.String, core.Object>> details; |
(...skipping 26 matching lines...) Loading... |
533 } | 469 } |
534 if (details != null) { | 470 if (details != null) { |
535 _json["details"] = details; | 471 _json["details"] = details; |
536 } | 472 } |
537 if (message != null) { | 473 if (message != null) { |
538 _json["message"] = message; | 474 _json["message"] = message; |
539 } | 475 } |
540 return _json; | 476 return _json; |
541 } | 477 } |
542 } | 478 } |
OLD | NEW |