OLD | NEW |
1 library googleapis.gmail.v1; | 1 library googleapis.gmail.v1; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import "package:crypto/crypto.dart" as crypto; | 8 import "package:crypto/crypto.dart" as crypto; |
9 import 'package:http/http.dart' as http; | 9 import 'package:http/http.dart' as http; |
10 import '../src/common_internal.dart' as common_internal; | 10 import '../src/common_internal.dart' as common_internal; |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 /** | 1468 /** |
1469 * Gets the specified thread. | 1469 * Gets the specified thread. |
1470 * | 1470 * |
1471 * Request parameters: | 1471 * Request parameters: |
1472 * | 1472 * |
1473 * [userId] - The user's email address. The special value me can be used to | 1473 * [userId] - The user's email address. The special value me can be used to |
1474 * indicate the authenticated user. | 1474 * indicate the authenticated user. |
1475 * | 1475 * |
1476 * [id] - The ID of the thread to retrieve. | 1476 * [id] - The ID of the thread to retrieve. |
1477 * | 1477 * |
| 1478 * [format] - The format to return the messages in. |
| 1479 * Possible string values are: |
| 1480 * - "full" |
| 1481 * - "metadata" |
| 1482 * - "minimal" |
| 1483 * |
| 1484 * [metadataHeaders] - When given and format is METADATA, only include headers |
| 1485 * specified. |
| 1486 * |
1478 * Completes with a [Thread]. | 1487 * Completes with a [Thread]. |
1479 * | 1488 * |
1480 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1489 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
1481 * error. | 1490 * error. |
1482 * | 1491 * |
1483 * If the used [http.Client] completes with an error when making a REST call, | 1492 * If the used [http.Client] completes with an error when making a REST call, |
1484 * this method will complete with the same error. | 1493 * this method will complete with the same error. |
1485 */ | 1494 */ |
1486 async.Future<Thread> get(core.String userId, core.String id) { | 1495 async.Future<Thread> get(core.String userId, core.String id, {core.String form
at, core.List<core.String> metadataHeaders}) { |
1487 var _url = null; | 1496 var _url = null; |
1488 var _queryParams = new core.Map(); | 1497 var _queryParams = new core.Map(); |
1489 var _uploadMedia = null; | 1498 var _uploadMedia = null; |
1490 var _uploadOptions = null; | 1499 var _uploadOptions = null; |
1491 var _downloadOptions = common.DownloadOptions.Metadata; | 1500 var _downloadOptions = common.DownloadOptions.Metadata; |
1492 var _body = null; | 1501 var _body = null; |
1493 | 1502 |
1494 if (userId == null) { | 1503 if (userId == null) { |
1495 throw new core.ArgumentError("Parameter userId is required."); | 1504 throw new core.ArgumentError("Parameter userId is required."); |
1496 } | 1505 } |
1497 if (id == null) { | 1506 if (id == null) { |
1498 throw new core.ArgumentError("Parameter id is required."); | 1507 throw new core.ArgumentError("Parameter id is required."); |
1499 } | 1508 } |
| 1509 if (format != null) { |
| 1510 _queryParams["format"] = [format]; |
| 1511 } |
| 1512 if (metadataHeaders != null) { |
| 1513 _queryParams["metadataHeaders"] = metadataHeaders; |
| 1514 } |
1500 | 1515 |
1501 | 1516 |
1502 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads/' + comm
on_internal.Escaper.ecapeVariable('$id'); | 1517 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads/' + comm
on_internal.Escaper.ecapeVariable('$id'); |
1503 | 1518 |
1504 var _response = _requester.request(_url, | 1519 var _response = _requester.request(_url, |
1505 "GET", | 1520 "GET", |
1506 body: _body, | 1521 body: _body, |
1507 queryParams: _queryParams, | 1522 queryParams: _queryParams, |
1508 uploadOptions: _uploadOptions, | 1523 uploadOptions: _uploadOptions, |
1509 uploadMedia: _uploadMedia, | 1524 uploadMedia: _uploadMedia, |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 _json["messages"] = messages.map((value) => (value).toJson()).toList(); | 2573 _json["messages"] = messages.map((value) => (value).toJson()).toList(); |
2559 } | 2574 } |
2560 if (snippet != null) { | 2575 if (snippet != null) { |
2561 _json["snippet"] = snippet; | 2576 _json["snippet"] = snippet; |
2562 } | 2577 } |
2563 return _json; | 2578 return _json; |
2564 } | 2579 } |
2565 } | 2580 } |
2566 | 2581 |
2567 | 2582 |
OLD | NEW |