| 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:crypto/crypto.dart' as crypto; | 10 import 'package:crypto/crypto.dart' as crypto; |
| 11 import 'package:http/http.dart' as http; | 11 import 'package:http/http.dart' as http; |
| 12 | 12 |
| 13 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 13 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 14 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, | 14 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, |
| 15 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, | 15 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, |
| 16 ByteRange; | 16 ByteRange; |
| 17 | 17 |
| 18 const core.String USER_AGENT = 'dart-api-client gmail/v1'; | 18 const core.String USER_AGENT = 'dart-api-client gmail/v1'; |
| 19 | 19 |
| 20 /** The Gmail REST API. */ | 20 /** Access Gmail mailboxes including sending user email. */ |
| 21 class GmailApi { | 21 class GmailApi { |
| 22 /** View and manage your mail */ | 22 /** View and manage your mail */ |
| 23 static const MailGoogleComScope = "https://mail.google.com/"; | 23 static const MailGoogleComScope = "https://mail.google.com/"; |
| 24 | 24 |
| 25 /** Manage drafts and send emails */ | 25 /** Manage drafts and send emails */ |
| 26 static const GmailComposeScope = "https://www.googleapis.com/auth/gmail.compos
e"; | 26 static const GmailComposeScope = "https://www.googleapis.com/auth/gmail.compos
e"; |
| 27 | 27 |
| 28 /** Insert mail into your mailbox */ | 28 /** Insert mail into your mailbox */ |
| 29 static const GmailInsertScope = "https://www.googleapis.com/auth/gmail.insert"
; | 29 static const GmailInsertScope = "https://www.googleapis.com/auth/gmail.insert"
; |
| 30 | 30 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 /** | 360 /** |
| 361 * Lists the drafts in the user's mailbox. | 361 * Lists the drafts in the user's mailbox. |
| 362 * | 362 * |
| 363 * Request parameters: | 363 * Request parameters: |
| 364 * | 364 * |
| 365 * [userId] - The user's email address. The special value me can be used to | 365 * [userId] - The user's email address. The special value me can be used to |
| 366 * indicate the authenticated user. | 366 * indicate the authenticated user. |
| 367 * | 367 * |
| 368 * [includeSpamTrash] - Include drafts from SPAM and TRASH in the results. |
| 369 * |
| 368 * [maxResults] - Maximum number of drafts to return. | 370 * [maxResults] - Maximum number of drafts to return. |
| 369 * | 371 * |
| 370 * [pageToken] - Page token to retrieve a specific page of results in the | 372 * [pageToken] - Page token to retrieve a specific page of results in the |
| 371 * list. | 373 * list. |
| 372 * | 374 * |
| 373 * Completes with a [ListDraftsResponse]. | 375 * Completes with a [ListDraftsResponse]. |
| 374 * | 376 * |
| 375 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 377 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 376 * error. | 378 * error. |
| 377 * | 379 * |
| 378 * If the used [http.Client] completes with an error when making a REST call, | 380 * If the used [http.Client] completes with an error when making a REST call, |
| 379 * this method will complete with the same error. | 381 * this method will complete with the same error. |
| 380 */ | 382 */ |
| 381 async.Future<ListDraftsResponse> list(core.String userId, {core.int maxResults
, core.String pageToken}) { | 383 async.Future<ListDraftsResponse> list(core.String userId, {core.bool includeSp
amTrash, core.int maxResults, core.String pageToken}) { |
| 382 var _url = null; | 384 var _url = null; |
| 383 var _queryParams = new core.Map(); | 385 var _queryParams = new core.Map(); |
| 384 var _uploadMedia = null; | 386 var _uploadMedia = null; |
| 385 var _uploadOptions = null; | 387 var _uploadOptions = null; |
| 386 var _downloadOptions = commons.DownloadOptions.Metadata; | 388 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 387 var _body = null; | 389 var _body = null; |
| 388 | 390 |
| 389 if (userId == null) { | 391 if (userId == null) { |
| 390 throw new core.ArgumentError("Parameter userId is required."); | 392 throw new core.ArgumentError("Parameter userId is required."); |
| 391 } | 393 } |
| 394 if (includeSpamTrash != null) { |
| 395 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; |
| 396 } |
| 392 if (maxResults != null) { | 397 if (maxResults != null) { |
| 393 _queryParams["maxResults"] = ["${maxResults}"]; | 398 _queryParams["maxResults"] = ["${maxResults}"]; |
| 394 } | 399 } |
| 395 if (pageToken != null) { | 400 if (pageToken != null) { |
| 396 _queryParams["pageToken"] = [pageToken]; | 401 _queryParams["pageToken"] = [pageToken]; |
| 397 } | 402 } |
| 398 | 403 |
| 399 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; | 404 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; |
| 400 | 405 |
| 401 var _response = _requester.request(_url, | 406 var _response = _requester.request(_url, |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 | 910 |
| 906 class UsersMessagesResourceApi { | 911 class UsersMessagesResourceApi { |
| 907 final commons.ApiRequester _requester; | 912 final commons.ApiRequester _requester; |
| 908 | 913 |
| 909 UsersMessagesAttachmentsResourceApi get attachments => new UsersMessagesAttach
mentsResourceApi(_requester); | 914 UsersMessagesAttachmentsResourceApi get attachments => new UsersMessagesAttach
mentsResourceApi(_requester); |
| 910 | 915 |
| 911 UsersMessagesResourceApi(commons.ApiRequester client) : | 916 UsersMessagesResourceApi(commons.ApiRequester client) : |
| 912 _requester = client; | 917 _requester = client; |
| 913 | 918 |
| 914 /** | 919 /** |
| 920 * Deletes many messages by message ID. Provides no guarantees that messages |
| 921 * were not already deleted or even existed at all. |
| 922 * |
| 923 * [request] - The metadata request object. |
| 924 * |
| 925 * Request parameters: |
| 926 * |
| 927 * [userId] - The user's email address. The special value me can be used to |
| 928 * indicate the authenticated user. |
| 929 * |
| 930 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 931 * error. |
| 932 * |
| 933 * If the used [http.Client] completes with an error when making a REST call, |
| 934 * this method will complete with the same error. |
| 935 */ |
| 936 async.Future batchDelete(BatchDeleteMessagesRequest request, core.String userI
d) { |
| 937 var _url = null; |
| 938 var _queryParams = new core.Map(); |
| 939 var _uploadMedia = null; |
| 940 var _uploadOptions = null; |
| 941 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 942 var _body = null; |
| 943 |
| 944 if (request != null) { |
| 945 _body = convert.JSON.encode((request).toJson()); |
| 946 } |
| 947 if (userId == null) { |
| 948 throw new core.ArgumentError("Parameter userId is required."); |
| 949 } |
| 950 |
| 951 _downloadOptions = null; |
| 952 |
| 953 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/batchDelete'; |
| 954 |
| 955 var _response = _requester.request(_url, |
| 956 "POST", |
| 957 body: _body, |
| 958 queryParams: _queryParams, |
| 959 uploadOptions: _uploadOptions, |
| 960 uploadMedia: _uploadMedia, |
| 961 downloadOptions: _downloadOptions); |
| 962 return _response.then((data) => null); |
| 963 } |
| 964 |
| 965 /** |
| 915 * Immediately and permanently deletes the specified message. This operation | 966 * Immediately and permanently deletes the specified message. This operation |
| 916 * cannot be undone. Prefer messages.trash instead. | 967 * cannot be undone. Prefer messages.trash instead. |
| 917 * | 968 * |
| 918 * Request parameters: | 969 * Request parameters: |
| 919 * | 970 * |
| 920 * [userId] - The user's email address. The special value me can be used to | 971 * [userId] - The user's email address. The special value me can be used to |
| 921 * indicate the authenticated user. | 972 * indicate the authenticated user. |
| 922 * | 973 * |
| 923 * [id] - The ID of the message to delete. | 974 * [id] - The ID of the message to delete. |
| 924 * | 975 * |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1835 uploadOptions: _uploadOptions, | 1886 uploadOptions: _uploadOptions, |
| 1836 uploadMedia: _uploadMedia, | 1887 uploadMedia: _uploadMedia, |
| 1837 downloadOptions: _downloadOptions); | 1888 downloadOptions: _downloadOptions); |
| 1838 return _response.then((data) => new Thread.fromJson(data)); | 1889 return _response.then((data) => new Thread.fromJson(data)); |
| 1839 } | 1890 } |
| 1840 | 1891 |
| 1841 } | 1892 } |
| 1842 | 1893 |
| 1843 | 1894 |
| 1844 | 1895 |
| 1896 class BatchDeleteMessagesRequest { |
| 1897 /** The IDs of the messages to delete. */ |
| 1898 core.List<core.String> ids; |
| 1899 |
| 1900 BatchDeleteMessagesRequest(); |
| 1901 |
| 1902 BatchDeleteMessagesRequest.fromJson(core.Map _json) { |
| 1903 if (_json.containsKey("ids")) { |
| 1904 ids = _json["ids"]; |
| 1905 } |
| 1906 } |
| 1907 |
| 1908 core.Map toJson() { |
| 1909 var _json = new core.Map(); |
| 1910 if (ids != null) { |
| 1911 _json["ids"] = ids; |
| 1912 } |
| 1913 return _json; |
| 1914 } |
| 1915 } |
| 1916 |
| 1845 /** A draft email in the user's mailbox. */ | 1917 /** A draft email in the user's mailbox. */ |
| 1846 class Draft { | 1918 class Draft { |
| 1847 /** The immutable ID of the draft. */ | 1919 /** The immutable ID of the draft. */ |
| 1848 core.String id; | 1920 core.String id; |
| 1849 /** The message content of the draft. */ | 1921 /** The message content of the draft. */ |
| 1850 Message message; | 1922 Message message; |
| 1851 | 1923 |
| 1852 Draft(); | 1924 Draft(); |
| 1853 | 1925 |
| 1854 Draft.fromJson(core.Map _json) { | 1926 Draft.fromJson(core.Map _json) { |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2827 var _json = new core.Map(); | 2899 var _json = new core.Map(); |
| 2828 if (expiration != null) { | 2900 if (expiration != null) { |
| 2829 _json["expiration"] = expiration; | 2901 _json["expiration"] = expiration; |
| 2830 } | 2902 } |
| 2831 if (historyId != null) { | 2903 if (historyId != null) { |
| 2832 _json["historyId"] = historyId; | 2904 _json["historyId"] = historyId; |
| 2833 } | 2905 } |
| 2834 return _json; | 2906 return _json; |
| 2835 } | 2907 } |
| 2836 } | 2908 } |
| OLD | NEW |