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.gmail.v1; | 3 library googleapis.gmail.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; |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 "POST", | 977 "POST", |
978 body: _body, | 978 body: _body, |
979 queryParams: _queryParams, | 979 queryParams: _queryParams, |
980 uploadOptions: _uploadOptions, | 980 uploadOptions: _uploadOptions, |
981 uploadMedia: _uploadMedia, | 981 uploadMedia: _uploadMedia, |
982 downloadOptions: _downloadOptions); | 982 downloadOptions: _downloadOptions); |
983 return _response.then((data) => null); | 983 return _response.then((data) => null); |
984 } | 984 } |
985 | 985 |
986 /** | 986 /** |
| 987 * Modifies the labels on the specified messages. |
| 988 * |
| 989 * [request] - The metadata request object. |
| 990 * |
| 991 * Request parameters: |
| 992 * |
| 993 * [userId] - The user's email address. The special value me can be used to |
| 994 * indicate the authenticated user. |
| 995 * |
| 996 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 997 * error. |
| 998 * |
| 999 * If the used [http.Client] completes with an error when making a REST call, |
| 1000 * this method will complete with the same error. |
| 1001 */ |
| 1002 async.Future batchModify(BatchModifyMessagesRequest request, core.String userI
d) { |
| 1003 var _url = null; |
| 1004 var _queryParams = new core.Map(); |
| 1005 var _uploadMedia = null; |
| 1006 var _uploadOptions = null; |
| 1007 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1008 var _body = null; |
| 1009 |
| 1010 if (request != null) { |
| 1011 _body = convert.JSON.encode((request).toJson()); |
| 1012 } |
| 1013 if (userId == null) { |
| 1014 throw new core.ArgumentError("Parameter userId is required."); |
| 1015 } |
| 1016 |
| 1017 _downloadOptions = null; |
| 1018 |
| 1019 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/batchModify'; |
| 1020 |
| 1021 var _response = _requester.request(_url, |
| 1022 "POST", |
| 1023 body: _body, |
| 1024 queryParams: _queryParams, |
| 1025 uploadOptions: _uploadOptions, |
| 1026 uploadMedia: _uploadMedia, |
| 1027 downloadOptions: _downloadOptions); |
| 1028 return _response.then((data) => null); |
| 1029 } |
| 1030 |
| 1031 /** |
987 * Immediately and permanently deletes the specified message. This operation | 1032 * Immediately and permanently deletes the specified message. This operation |
988 * cannot be undone. Prefer messages.trash instead. | 1033 * cannot be undone. Prefer messages.trash instead. |
989 * | 1034 * |
990 * Request parameters: | 1035 * Request parameters: |
991 * | 1036 * |
992 * [userId] - The user's email address. The special value me can be used to | 1037 * [userId] - The user's email address. The special value me can be used to |
993 * indicate the authenticated user. | 1038 * indicate the authenticated user. |
994 * | 1039 * |
995 * [id] - The ID of the message to delete. | 1040 * [id] - The ID of the message to delete. |
996 * | 1041 * |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 * [labelIds] - Only return messages with labels that match all of the | 1314 * [labelIds] - Only return messages with labels that match all of the |
1270 * specified label IDs. | 1315 * specified label IDs. |
1271 * | 1316 * |
1272 * [maxResults] - Maximum number of messages to return. | 1317 * [maxResults] - Maximum number of messages to return. |
1273 * | 1318 * |
1274 * [pageToken] - Page token to retrieve a specific page of results in the | 1319 * [pageToken] - Page token to retrieve a specific page of results in the |
1275 * list. | 1320 * list. |
1276 * | 1321 * |
1277 * [q] - Only return messages matching the specified query. Supports the same | 1322 * [q] - Only return messages matching the specified query. Supports the same |
1278 * query format as the Gmail search box. For example, | 1323 * query format as the Gmail search box. For example, |
1279 * "from:someuser@example.com rfc822msgid: is:unread". | 1324 * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be |
| 1325 * used when accessing the api using the gmail.metadata scope. |
1280 * | 1326 * |
1281 * Completes with a [ListMessagesResponse]. | 1327 * Completes with a [ListMessagesResponse]. |
1282 * | 1328 * |
1283 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1329 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1284 * error. | 1330 * error. |
1285 * | 1331 * |
1286 * If the used [http.Client] completes with an error when making a REST call, | 1332 * If the used [http.Client] completes with an error when making a REST call, |
1287 * this method will complete with the same error. | 1333 * this method will complete with the same error. |
1288 */ | 1334 */ |
1289 async.Future<ListMessagesResponse> list(core.String userId, {core.bool include
SpamTrash, core.List<core.String> labelIds, core.int maxResults, core.String pag
eToken, core.String q}) { | 1335 async.Future<ListMessagesResponse> list(core.String userId, {core.bool include
SpamTrash, core.List<core.String> labelIds, core.int maxResults, core.String pag
eToken, core.String q}) { |
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2782 * [labelIds] - Only return threads with labels that match all of the | 2828 * [labelIds] - Only return threads with labels that match all of the |
2783 * specified label IDs. | 2829 * specified label IDs. |
2784 * | 2830 * |
2785 * [maxResults] - Maximum number of threads to return. | 2831 * [maxResults] - Maximum number of threads to return. |
2786 * | 2832 * |
2787 * [pageToken] - Page token to retrieve a specific page of results in the | 2833 * [pageToken] - Page token to retrieve a specific page of results in the |
2788 * list. | 2834 * list. |
2789 * | 2835 * |
2790 * [q] - Only return threads matching the specified query. Supports the same | 2836 * [q] - Only return threads matching the specified query. Supports the same |
2791 * query format as the Gmail search box. For example, | 2837 * query format as the Gmail search box. For example, |
2792 * "from:someuser@example.com rfc822msgid: is:unread". | 2838 * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be |
| 2839 * used when accessing the api using the gmail.metadata scope. |
2793 * | 2840 * |
2794 * Completes with a [ListThreadsResponse]. | 2841 * Completes with a [ListThreadsResponse]. |
2795 * | 2842 * |
2796 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2843 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
2797 * error. | 2844 * error. |
2798 * | 2845 * |
2799 * If the used [http.Client] completes with an error when making a REST call, | 2846 * If the used [http.Client] completes with an error when making a REST call, |
2800 * this method will complete with the same error. | 2847 * this method will complete with the same error. |
2801 */ | 2848 */ |
2802 async.Future<ListThreadsResponse> list(core.String userId, {core.bool includeS
pamTrash, core.List<core.String> labelIds, core.int maxResults, core.String page
Token, core.String q}) { | 2849 async.Future<ListThreadsResponse> list(core.String userId, {core.bool includeS
pamTrash, core.List<core.String> labelIds, core.int maxResults, core.String page
Token, core.String q}) { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3048 | 3095 |
3049 core.Map toJson() { | 3096 core.Map toJson() { |
3050 var _json = new core.Map(); | 3097 var _json = new core.Map(); |
3051 if (ids != null) { | 3098 if (ids != null) { |
3052 _json["ids"] = ids; | 3099 _json["ids"] = ids; |
3053 } | 3100 } |
3054 return _json; | 3101 return _json; |
3055 } | 3102 } |
3056 } | 3103 } |
3057 | 3104 |
| 3105 class BatchModifyMessagesRequest { |
| 3106 /** A list of label IDs to add to messages. */ |
| 3107 core.List<core.String> addLabelIds; |
| 3108 /** |
| 3109 * The IDs of the messages to modify. There is a limit of 1000 ids per |
| 3110 * request. |
| 3111 */ |
| 3112 core.List<core.String> ids; |
| 3113 /** A list of label IDs to remove from messages. */ |
| 3114 core.List<core.String> removeLabelIds; |
| 3115 |
| 3116 BatchModifyMessagesRequest(); |
| 3117 |
| 3118 BatchModifyMessagesRequest.fromJson(core.Map _json) { |
| 3119 if (_json.containsKey("addLabelIds")) { |
| 3120 addLabelIds = _json["addLabelIds"]; |
| 3121 } |
| 3122 if (_json.containsKey("ids")) { |
| 3123 ids = _json["ids"]; |
| 3124 } |
| 3125 if (_json.containsKey("removeLabelIds")) { |
| 3126 removeLabelIds = _json["removeLabelIds"]; |
| 3127 } |
| 3128 } |
| 3129 |
| 3130 core.Map toJson() { |
| 3131 var _json = new core.Map(); |
| 3132 if (addLabelIds != null) { |
| 3133 _json["addLabelIds"] = addLabelIds; |
| 3134 } |
| 3135 if (ids != null) { |
| 3136 _json["ids"] = ids; |
| 3137 } |
| 3138 if (removeLabelIds != null) { |
| 3139 _json["removeLabelIds"] = removeLabelIds; |
| 3140 } |
| 3141 return _json; |
| 3142 } |
| 3143 } |
| 3144 |
3058 /** A draft email in the user's mailbox. */ | 3145 /** A draft email in the user's mailbox. */ |
3059 class Draft { | 3146 class Draft { |
3060 /** The immutable ID of the draft. */ | 3147 /** The immutable ID of the draft. */ |
3061 core.String id; | 3148 core.String id; |
3062 /** The message content of the draft. */ | 3149 /** The message content of the draft. */ |
3063 Message message; | 3150 Message message; |
3064 | 3151 |
3065 Draft(); | 3152 Draft(); |
3066 | 3153 |
3067 Draft.fromJson(core.Map _json) { | 3154 Draft.fromJson(core.Map _json) { |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4093 * body data is contained in a separate attachment. | 4180 * body data is contained in a separate attachment. |
4094 */ | 4181 */ |
4095 core.String data; | 4182 core.String data; |
4096 core.List<core.int> get dataAsBytes { | 4183 core.List<core.int> get dataAsBytes { |
4097 return convert.BASE64.decode(data); | 4184 return convert.BASE64.decode(data); |
4098 } | 4185 } |
4099 | 4186 |
4100 void set dataAsBytes(core.List<core.int> _bytes) { | 4187 void set dataAsBytes(core.List<core.int> _bytes) { |
4101 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 4188 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
4102 } | 4189 } |
4103 /** Total number of bytes in the body of the message part. */ | 4190 /** Number of bytes for the message part data (encoding notwithstanding). */ |
4104 core.int size; | 4191 core.int size; |
4105 | 4192 |
4106 MessagePartBody(); | 4193 MessagePartBody(); |
4107 | 4194 |
4108 MessagePartBody.fromJson(core.Map _json) { | 4195 MessagePartBody.fromJson(core.Map _json) { |
4109 if (_json.containsKey("attachmentId")) { | 4196 if (_json.containsKey("attachmentId")) { |
4110 attachmentId = _json["attachmentId"]; | 4197 attachmentId = _json["attachmentId"]; |
4111 } | 4198 } |
4112 if (_json.containsKey("data")) { | 4199 if (_json.containsKey("data")) { |
4113 data = _json["data"]; | 4200 data = _json["data"]; |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 var _json = new core.Map(); | 4834 var _json = new core.Map(); |
4748 if (expiration != null) { | 4835 if (expiration != null) { |
4749 _json["expiration"] = expiration; | 4836 _json["expiration"] = expiration; |
4750 } | 4837 } |
4751 if (historyId != null) { | 4838 if (historyId != null) { |
4752 _json["historyId"] = historyId; | 4839 _json["historyId"] = historyId; |
4753 } | 4840 } |
4754 return _json; | 4841 return _json; |
4755 } | 4842 } |
4756 } | 4843 } |
OLD | NEW |