| Index: generated/googleapis/lib/gmail/v1.dart
|
| diff --git a/generated/googleapis/lib/gmail/v1.dart b/generated/googleapis/lib/gmail/v1.dart
|
| index 2ac750e191f3fbee50549c18800c8fe39a7b93c7..a4884f4b7666c42f1932e0d8694a7c327c2badde 100644
|
| --- a/generated/googleapis/lib/gmail/v1.dart
|
| +++ b/generated/googleapis/lib/gmail/v1.dart
|
| @@ -39,6 +39,14 @@ class GmailApi {
|
| /** Send email on your behalf */
|
| static const GmailSendScope = "https://www.googleapis.com/auth/gmail.send";
|
|
|
| + /** Manage your basic mail settings */
|
| + static const GmailSettingsBasicScope = "https://www.googleapis.com/auth/gmail.settings.basic";
|
| +
|
| + /**
|
| + * Manage your sensitive mail settings, including who can manage your mail
|
| + */
|
| + static const GmailSettingsSharingScope = "https://www.googleapis.com/auth/gmail.settings.sharing";
|
| +
|
|
|
| final commons.ApiRequester _requester;
|
|
|
| @@ -56,6 +64,7 @@ class UsersResourceApi {
|
| UsersHistoryResourceApi get history => new UsersHistoryResourceApi(_requester);
|
| UsersLabelsResourceApi get labels => new UsersLabelsResourceApi(_requester);
|
| UsersMessagesResourceApi get messages => new UsersMessagesResourceApi(_requester);
|
| + UsersSettingsResourceApi get settings => new UsersSettingsResourceApi(_requester);
|
| UsersThreadsResourceApi get threads => new UsersThreadsResourceApi(_requester);
|
|
|
| UsersResourceApi(commons.ApiRequester client) :
|
| @@ -1573,22 +1582,25 @@ class UsersMessagesAttachmentsResourceApi {
|
| }
|
|
|
|
|
| -class UsersThreadsResourceApi {
|
| +class UsersSettingsResourceApi {
|
| final commons.ApiRequester _requester;
|
|
|
| - UsersThreadsResourceApi(commons.ApiRequester client) :
|
| + UsersSettingsFiltersResourceApi get filters => new UsersSettingsFiltersResourceApi(_requester);
|
| + UsersSettingsForwardingAddressesResourceApi get forwardingAddresses => new UsersSettingsForwardingAddressesResourceApi(_requester);
|
| + UsersSettingsSendAsResourceApi get sendAs => new UsersSettingsSendAsResourceApi(_requester);
|
| +
|
| + UsersSettingsResourceApi(commons.ApiRequester client) :
|
| _requester = client;
|
|
|
| /**
|
| - * Immediately and permanently deletes the specified thread. This operation
|
| - * cannot be undone. Prefer threads.trash instead.
|
| + * Gets the auto-forwarding setting for the specified account.
|
| *
|
| * Request parameters:
|
| *
|
| - * [userId] - The user's email address. The special value me can be used to
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| * indicate the authenticated user.
|
| *
|
| - * [id] - ID of the Thread to delete.
|
| + * Completes with a [AutoForwarding].
|
| *
|
| * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| * error.
|
| @@ -1596,7 +1608,7 @@ class UsersThreadsResourceApi {
|
| * If the used [http.Client] completes with an error when making a REST call,
|
| * this method will complete with the same error.
|
| */
|
| - async.Future delete(core.String userId, core.String id) {
|
| + async.Future<AutoForwarding> getAutoForwarding(core.String userId) {
|
| var _url = null;
|
| var _queryParams = new core.Map();
|
| var _uploadMedia = null;
|
| @@ -1607,44 +1619,68 @@ class UsersThreadsResourceApi {
|
| if (userId == null) {
|
| throw new core.ArgumentError("Parameter userId is required.");
|
| }
|
| - if (id == null) {
|
| - throw new core.ArgumentError("Parameter id is required.");
|
| - }
|
| -
|
| - _downloadOptions = null;
|
|
|
| - _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id');
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/autoForwarding';
|
|
|
| var _response = _requester.request(_url,
|
| - "DELETE",
|
| + "GET",
|
| body: _body,
|
| queryParams: _queryParams,
|
| uploadOptions: _uploadOptions,
|
| uploadMedia: _uploadMedia,
|
| downloadOptions: _downloadOptions);
|
| - return _response.then((data) => null);
|
| + return _response.then((data) => new AutoForwarding.fromJson(data));
|
| }
|
|
|
| /**
|
| - * Gets the specified thread.
|
| + * Gets IMAP settings.
|
| *
|
| * Request parameters:
|
| *
|
| - * [userId] - The user's email address. The special value me can be used to
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| * indicate the authenticated user.
|
| *
|
| - * [id] - The ID of the thread to retrieve.
|
| + * Completes with a [ImapSettings].
|
| *
|
| - * [format] - The format to return the messages in.
|
| - * Possible string values are:
|
| - * - "full"
|
| - * - "metadata"
|
| - * - "minimal"
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| *
|
| - * [metadataHeaders] - When given and format is METADATA, only include headers
|
| - * specified.
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<ImapSettings> getImap(core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/imap';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new ImapSettings.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Gets POP settings.
|
| *
|
| - * Completes with a [Thread].
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [PopSettings].
|
| *
|
| * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| * error.
|
| @@ -1652,7 +1688,7 @@ class UsersThreadsResourceApi {
|
| * If the used [http.Client] completes with an error when making a REST call,
|
| * this method will complete with the same error.
|
| */
|
| - async.Future<Thread> get(core.String userId, core.String id, {core.String format, core.List<core.String> metadataHeaders}) {
|
| + async.Future<PopSettings> getPop(core.String userId) {
|
| var _url = null;
|
| var _queryParams = new core.Map();
|
| var _uploadMedia = null;
|
| @@ -1663,17 +1699,8 @@ class UsersThreadsResourceApi {
|
| if (userId == null) {
|
| throw new core.ArgumentError("Parameter userId is required.");
|
| }
|
| - if (id == null) {
|
| - throw new core.ArgumentError("Parameter id is required.");
|
| - }
|
| - if (format != null) {
|
| - _queryParams["format"] = [format];
|
| - }
|
| - if (metadataHeaders != null) {
|
| - _queryParams["metadataHeaders"] = metadataHeaders;
|
| - }
|
|
|
| - _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id');
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/pop';
|
|
|
| var _response = _requester.request(_url,
|
| "GET",
|
| @@ -1682,32 +1709,61 @@ class UsersThreadsResourceApi {
|
| uploadOptions: _uploadOptions,
|
| uploadMedia: _uploadMedia,
|
| downloadOptions: _downloadOptions);
|
| - return _response.then((data) => new Thread.fromJson(data));
|
| + return _response.then((data) => new PopSettings.fromJson(data));
|
| }
|
|
|
| /**
|
| - * Lists the threads in the user's mailbox.
|
| + * Gets vacation responder settings.
|
| *
|
| * Request parameters:
|
| *
|
| - * [userId] - The user's email address. The special value me can be used to
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| * indicate the authenticated user.
|
| *
|
| - * [includeSpamTrash] - Include threads from SPAM and TRASH in the results.
|
| + * Completes with a [VacationSettings].
|
| *
|
| - * [labelIds] - Only return threads with labels that match all of the
|
| - * specified label IDs.
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| *
|
| - * [maxResults] - Maximum number of threads to return.
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<VacationSettings> getVacation(core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/vacation';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new VacationSettings.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Updates the auto-forwarding setting for the specified account. A verified
|
| + * forwarding address must be specified when auto-forwarding is enabled.
|
| *
|
| - * [pageToken] - Page token to retrieve a specific page of results in the
|
| - * list.
|
| + * [request] - The metadata request object.
|
| *
|
| - * [q] - Only return threads matching the specified query. Supports the same
|
| - * query format as the Gmail search box. For example,
|
| - * "from:someuser@example.com rfc822msgid: is:unread".
|
| + * Request parameters:
|
| *
|
| - * Completes with a [ListThreadsResponse].
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [AutoForwarding].
|
| *
|
| * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| * error.
|
| @@ -1715,7 +1771,7 @@ class UsersThreadsResourceApi {
|
| * If the used [http.Client] completes with an error when making a REST call,
|
| * this method will complete with the same error.
|
| */
|
| - async.Future<ListThreadsResponse> list(core.String userId, {core.bool includeSpamTrash, core.List<core.String> labelIds, core.int maxResults, core.String pageToken, core.String q}) {
|
| + async.Future<AutoForwarding> updateAutoForwarding(AutoForwarding request, core.String userId) {
|
| var _url = null;
|
| var _queryParams = new core.Map();
|
| var _uploadMedia = null;
|
| @@ -1723,51 +1779,36 @@ class UsersThreadsResourceApi {
|
| var _downloadOptions = commons.DownloadOptions.Metadata;
|
| var _body = null;
|
|
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| if (userId == null) {
|
| throw new core.ArgumentError("Parameter userId is required.");
|
| }
|
| - if (includeSpamTrash != null) {
|
| - _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"];
|
| - }
|
| - if (labelIds != null) {
|
| - _queryParams["labelIds"] = labelIds;
|
| - }
|
| - if (maxResults != null) {
|
| - _queryParams["maxResults"] = ["${maxResults}"];
|
| - }
|
| - if (pageToken != null) {
|
| - _queryParams["pageToken"] = [pageToken];
|
| - }
|
| - if (q != null) {
|
| - _queryParams["q"] = [q];
|
| - }
|
|
|
| - _url = commons.Escaper.ecapeVariable('$userId') + '/threads';
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/autoForwarding';
|
|
|
| var _response = _requester.request(_url,
|
| - "GET",
|
| + "PUT",
|
| body: _body,
|
| queryParams: _queryParams,
|
| uploadOptions: _uploadOptions,
|
| uploadMedia: _uploadMedia,
|
| downloadOptions: _downloadOptions);
|
| - return _response.then((data) => new ListThreadsResponse.fromJson(data));
|
| + return _response.then((data) => new AutoForwarding.fromJson(data));
|
| }
|
|
|
| /**
|
| - * Modifies the labels applied to the thread. This applies to all messages in
|
| - * the thread.
|
| + * Updates IMAP settings.
|
| *
|
| * [request] - The metadata request object.
|
| *
|
| * Request parameters:
|
| *
|
| - * [userId] - The user's email address. The special value me can be used to
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| * indicate the authenticated user.
|
| *
|
| - * [id] - The ID of the thread to modify.
|
| - *
|
| - * Completes with a [Thread].
|
| + * Completes with a [ImapSettings].
|
| *
|
| * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| * error.
|
| @@ -1775,7 +1816,7 @@ class UsersThreadsResourceApi {
|
| * If the used [http.Client] completes with an error when making a REST call,
|
| * this method will complete with the same error.
|
| */
|
| - async.Future<Thread> modify(ModifyThreadRequest request, core.String userId, core.String id) {
|
| + async.Future<ImapSettings> updateImap(ImapSettings request, core.String userId) {
|
| var _url = null;
|
| var _queryParams = new core.Map();
|
| var _uploadMedia = null;
|
| @@ -1789,33 +1830,30 @@ class UsersThreadsResourceApi {
|
| if (userId == null) {
|
| throw new core.ArgumentError("Parameter userId is required.");
|
| }
|
| - if (id == null) {
|
| - throw new core.ArgumentError("Parameter id is required.");
|
| - }
|
|
|
| - _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id') + '/modify';
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/imap';
|
|
|
| var _response = _requester.request(_url,
|
| - "POST",
|
| + "PUT",
|
| body: _body,
|
| queryParams: _queryParams,
|
| uploadOptions: _uploadOptions,
|
| uploadMedia: _uploadMedia,
|
| downloadOptions: _downloadOptions);
|
| - return _response.then((data) => new Thread.fromJson(data));
|
| + return _response.then((data) => new ImapSettings.fromJson(data));
|
| }
|
|
|
| /**
|
| - * Moves the specified thread to the trash.
|
| + * Updates POP settings.
|
| + *
|
| + * [request] - The metadata request object.
|
| *
|
| * Request parameters:
|
| *
|
| - * [userId] - The user's email address. The special value me can be used to
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| * indicate the authenticated user.
|
| *
|
| - * [id] - The ID of the thread to Trash.
|
| - *
|
| - * Completes with a [Thread].
|
| + * Completes with a [PopSettings].
|
| *
|
| * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| * error.
|
| @@ -1823,7 +1861,7 @@ class UsersThreadsResourceApi {
|
| * If the used [http.Client] completes with an error when making a REST call,
|
| * this method will complete with the same error.
|
| */
|
| - async.Future<Thread> trash(core.String userId, core.String id) {
|
| + async.Future<PopSettings> updatePop(PopSettings request, core.String userId) {
|
| var _url = null;
|
| var _queryParams = new core.Map();
|
| var _uploadMedia = null;
|
| @@ -1831,36 +1869,36 @@ class UsersThreadsResourceApi {
|
| var _downloadOptions = commons.DownloadOptions.Metadata;
|
| var _body = null;
|
|
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| if (userId == null) {
|
| throw new core.ArgumentError("Parameter userId is required.");
|
| }
|
| - if (id == null) {
|
| - throw new core.ArgumentError("Parameter id is required.");
|
| - }
|
|
|
| - _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id') + '/trash';
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/pop';
|
|
|
| var _response = _requester.request(_url,
|
| - "POST",
|
| + "PUT",
|
| body: _body,
|
| queryParams: _queryParams,
|
| uploadOptions: _uploadOptions,
|
| uploadMedia: _uploadMedia,
|
| downloadOptions: _downloadOptions);
|
| - return _response.then((data) => new Thread.fromJson(data));
|
| + return _response.then((data) => new PopSettings.fromJson(data));
|
| }
|
|
|
| /**
|
| - * Removes the specified thread from the trash.
|
| + * Updates vacation responder settings.
|
| + *
|
| + * [request] - The metadata request object.
|
| *
|
| * Request parameters:
|
| *
|
| - * [userId] - The user's email address. The special value me can be used to
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| * indicate the authenticated user.
|
| *
|
| - * [id] - The ID of the thread to remove from Trash.
|
| - *
|
| - * Completes with a [Thread].
|
| + * Completes with a [VacationSettings].
|
| *
|
| * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| * error.
|
| @@ -1868,7 +1906,7 @@ class UsersThreadsResourceApi {
|
| * If the used [http.Client] completes with an error when making a REST call,
|
| * this method will complete with the same error.
|
| */
|
| - async.Future<Thread> untrash(core.String userId, core.String id) {
|
| + async.Future<VacationSettings> updateVacation(VacationSettings request, core.String userId) {
|
| var _url = null;
|
| var _queryParams = new core.Map();
|
| var _uploadMedia = null;
|
| @@ -1876,75 +1914,1393 @@ class UsersThreadsResourceApi {
|
| var _downloadOptions = commons.DownloadOptions.Metadata;
|
| var _body = null;
|
|
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| if (userId == null) {
|
| throw new core.ArgumentError("Parameter userId is required.");
|
| }
|
| - if (id == null) {
|
| - throw new core.ArgumentError("Parameter id is required.");
|
| - }
|
|
|
| - _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id') + '/untrash';
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/vacation';
|
|
|
| var _response = _requester.request(_url,
|
| - "POST",
|
| + "PUT",
|
| body: _body,
|
| queryParams: _queryParams,
|
| uploadOptions: _uploadOptions,
|
| uploadMedia: _uploadMedia,
|
| downloadOptions: _downloadOptions);
|
| - return _response.then((data) => new Thread.fromJson(data));
|
| + return _response.then((data) => new VacationSettings.fromJson(data));
|
| }
|
|
|
| }
|
|
|
|
|
| +class UsersSettingsFiltersResourceApi {
|
| + final commons.ApiRequester _requester;
|
|
|
| -class BatchDeleteMessagesRequest {
|
| - /** The IDs of the messages to delete. */
|
| - core.List<core.String> ids;
|
| + UsersSettingsFiltersResourceApi(commons.ApiRequester client) :
|
| + _requester = client;
|
|
|
| - BatchDeleteMessagesRequest();
|
| + /**
|
| + * Creates a filter.
|
| + *
|
| + * [request] - The metadata request object.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [Filter].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<Filter> create(Filter request, core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
|
|
| - BatchDeleteMessagesRequest.fromJson(core.Map _json) {
|
| - if (_json.containsKey("ids")) {
|
| - ids = _json["ids"];
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| }
|
| - }
|
| -
|
| - core.Map toJson() {
|
| - var _json = new core.Map();
|
| - if (ids != null) {
|
| - _json["ids"] = ids;
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| }
|
| - return _json;
|
| - }
|
| -}
|
| -
|
| -/** A draft email in the user's mailbox. */
|
| -class Draft {
|
| - /** The immutable ID of the draft. */
|
| - core.String id;
|
| - /** The message content of the draft. */
|
| - Message message;
|
|
|
| - Draft();
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters';
|
|
|
| - Draft.fromJson(core.Map _json) {
|
| - if (_json.containsKey("id")) {
|
| - id = _json["id"];
|
| - }
|
| - if (_json.containsKey("message")) {
|
| - message = new Message.fromJson(_json["message"]);
|
| - }
|
| + var _response = _requester.request(_url,
|
| + "POST",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new Filter.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Deletes a filter.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [id] - The ID of the filter to be deleted.
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future delete(core.String userId, core.String id) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (id == null) {
|
| + throw new core.ArgumentError("Parameter id is required.");
|
| + }
|
| +
|
| + _downloadOptions = null;
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters/' + commons.Escaper.ecapeVariable('$id');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "DELETE",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => null);
|
| + }
|
| +
|
| + /**
|
| + * Gets a filter.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [id] - The ID of the filter to be fetched.
|
| + *
|
| + * Completes with a [Filter].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<Filter> get(core.String userId, core.String id) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (id == null) {
|
| + throw new core.ArgumentError("Parameter id is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters/' + commons.Escaper.ecapeVariable('$id');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new Filter.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Lists the message filters of a Gmail user.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [ListFiltersResponse].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<ListFiltersResponse> list(core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new ListFiltersResponse.fromJson(data));
|
| + }
|
| +
|
| +}
|
| +
|
| +
|
| +class UsersSettingsForwardingAddressesResourceApi {
|
| + final commons.ApiRequester _requester;
|
| +
|
| + UsersSettingsForwardingAddressesResourceApi(commons.ApiRequester client) :
|
| + _requester = client;
|
| +
|
| + /**
|
| + * Creates a forwarding address. If ownership verification is required, a
|
| + * message will be sent to the recipient and the resource's verification
|
| + * status will be set to pending; otherwise, the resource will be created with
|
| + * verification status set to accepted.
|
| + *
|
| + * [request] - The metadata request object.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [ForwardingAddress].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<ForwardingAddress> create(ForwardingAddress request, core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddresses';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "POST",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new ForwardingAddress.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Deletes the specified forwarding address and revokes any verification that
|
| + * may have been required.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [forwardingEmail] - The forwarding address to be deleted.
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future delete(core.String userId, core.String forwardingEmail) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (forwardingEmail == null) {
|
| + throw new core.ArgumentError("Parameter forwardingEmail is required.");
|
| + }
|
| +
|
| + _downloadOptions = null;
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddresses/' + commons.Escaper.ecapeVariable('$forwardingEmail');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "DELETE",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => null);
|
| + }
|
| +
|
| + /**
|
| + * Gets the specified forwarding address.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [forwardingEmail] - The forwarding address to be retrieved.
|
| + *
|
| + * Completes with a [ForwardingAddress].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<ForwardingAddress> get(core.String userId, core.String forwardingEmail) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (forwardingEmail == null) {
|
| + throw new core.ArgumentError("Parameter forwardingEmail is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddresses/' + commons.Escaper.ecapeVariable('$forwardingEmail');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new ForwardingAddress.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Lists the forwarding addresses for the specified account.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [ListForwardingAddressesResponse].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<ListForwardingAddressesResponse> list(core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddresses';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new ListForwardingAddressesResponse.fromJson(data));
|
| + }
|
| +
|
| +}
|
| +
|
| +
|
| +class UsersSettingsSendAsResourceApi {
|
| + final commons.ApiRequester _requester;
|
| +
|
| + UsersSettingsSendAsResourceApi(commons.ApiRequester client) :
|
| + _requester = client;
|
| +
|
| + /**
|
| + * Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail
|
| + * will attempt to connect to the SMTP service to validate the configuration
|
| + * before creating the alias. If ownership verification is required for the
|
| + * alias, a message will be sent to the email address and the resource's
|
| + * verification status will be set to pending; otherwise, the resource will be
|
| + * created with verification status set to accepted. If a signature is
|
| + * provided, Gmail will sanitize the HTML before saving it with the alias.
|
| + *
|
| + * [request] - The metadata request object.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [SendAs].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<SendAs> create(SendAs request, core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "POST",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new SendAs.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Deletes the specified send-as alias. Revokes any verification that may have
|
| + * been required for using it.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [sendAsEmail] - The send-as alias to be deleted.
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future delete(core.String userId, core.String sendAsEmail) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (sendAsEmail == null) {
|
| + throw new core.ArgumentError("Parameter sendAsEmail is required.");
|
| + }
|
| +
|
| + _downloadOptions = null;
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + commons.Escaper.ecapeVariable('$sendAsEmail');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "DELETE",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => null);
|
| + }
|
| +
|
| + /**
|
| + * Gets the specified send-as alias. Fails with an HTTP 404 error if the
|
| + * specified address is not a member of the collection.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [sendAsEmail] - The send-as alias to be retrieved.
|
| + *
|
| + * Completes with a [SendAs].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<SendAs> get(core.String userId, core.String sendAsEmail) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (sendAsEmail == null) {
|
| + throw new core.ArgumentError("Parameter sendAsEmail is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + commons.Escaper.ecapeVariable('$sendAsEmail');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new SendAs.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Lists the send-as aliases for the specified account. The result includes
|
| + * the primary send-as address associated with the account as well as any
|
| + * custom "from" aliases.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * Completes with a [ListSendAsResponse].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<ListSendAsResponse> list(core.String userId) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new ListSendAsResponse.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Updates a send-as alias. If a signature is provided, Gmail will sanitize
|
| + * the HTML before saving it with the alias. This method supports patch
|
| + * semantics.
|
| + *
|
| + * [request] - The metadata request object.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [sendAsEmail] - The send-as alias to be updated.
|
| + *
|
| + * Completes with a [SendAs].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<SendAs> patch(SendAs request, core.String userId, core.String sendAsEmail) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (sendAsEmail == null) {
|
| + throw new core.ArgumentError("Parameter sendAsEmail is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + commons.Escaper.ecapeVariable('$sendAsEmail');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "PATCH",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new SendAs.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Updates a send-as alias. If a signature is provided, Gmail will sanitize
|
| + * the HTML before saving it with the alias.
|
| + *
|
| + * [request] - The metadata request object.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [sendAsEmail] - The send-as alias to be updated.
|
| + *
|
| + * Completes with a [SendAs].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<SendAs> update(SendAs request, core.String userId, core.String sendAsEmail) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (sendAsEmail == null) {
|
| + throw new core.ArgumentError("Parameter sendAsEmail is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + commons.Escaper.ecapeVariable('$sendAsEmail');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "PUT",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new SendAs.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Sends a verification email to the specified send-as alias address. The
|
| + * verification status must be pending.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - User's email address. The special value "me" can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [sendAsEmail] - The send-as alias to be verified.
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future verify(core.String userId, core.String sendAsEmail) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (sendAsEmail == null) {
|
| + throw new core.ArgumentError("Parameter sendAsEmail is required.");
|
| + }
|
| +
|
| + _downloadOptions = null;
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + commons.Escaper.ecapeVariable('$sendAsEmail') + '/verify';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "POST",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => null);
|
| + }
|
| +
|
| +}
|
| +
|
| +
|
| +class UsersThreadsResourceApi {
|
| + final commons.ApiRequester _requester;
|
| +
|
| + UsersThreadsResourceApi(commons.ApiRequester client) :
|
| + _requester = client;
|
| +
|
| + /**
|
| + * Immediately and permanently deletes the specified thread. This operation
|
| + * cannot be undone. Prefer threads.trash instead.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - The user's email address. The special value me can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [id] - ID of the Thread to delete.
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future delete(core.String userId, core.String id) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (id == null) {
|
| + throw new core.ArgumentError("Parameter id is required.");
|
| + }
|
| +
|
| + _downloadOptions = null;
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "DELETE",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => null);
|
| + }
|
| +
|
| + /**
|
| + * Gets the specified thread.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - The user's email address. The special value me can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [id] - The ID of the thread to retrieve.
|
| + *
|
| + * [format] - The format to return the messages in.
|
| + * Possible string values are:
|
| + * - "full"
|
| + * - "metadata"
|
| + * - "minimal"
|
| + *
|
| + * [metadataHeaders] - When given and format is METADATA, only include headers
|
| + * specified.
|
| + *
|
| + * Completes with a [Thread].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<Thread> get(core.String userId, core.String id, {core.String format, core.List<core.String> metadataHeaders}) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (id == null) {
|
| + throw new core.ArgumentError("Parameter id is required.");
|
| + }
|
| + if (format != null) {
|
| + _queryParams["format"] = [format];
|
| + }
|
| + if (metadataHeaders != null) {
|
| + _queryParams["metadataHeaders"] = metadataHeaders;
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id');
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new Thread.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Lists the threads in the user's mailbox.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - The user's email address. The special value me can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [includeSpamTrash] - Include threads from SPAM and TRASH in the results.
|
| + *
|
| + * [labelIds] - Only return threads with labels that match all of the
|
| + * specified label IDs.
|
| + *
|
| + * [maxResults] - Maximum number of threads to return.
|
| + *
|
| + * [pageToken] - Page token to retrieve a specific page of results in the
|
| + * list.
|
| + *
|
| + * [q] - Only return threads matching the specified query. Supports the same
|
| + * query format as the Gmail search box. For example,
|
| + * "from:someuser@example.com rfc822msgid: is:unread".
|
| + *
|
| + * Completes with a [ListThreadsResponse].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<ListThreadsResponse> list(core.String userId, {core.bool includeSpamTrash, core.List<core.String> labelIds, core.int maxResults, core.String pageToken, core.String q}) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (includeSpamTrash != null) {
|
| + _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"];
|
| + }
|
| + if (labelIds != null) {
|
| + _queryParams["labelIds"] = labelIds;
|
| + }
|
| + if (maxResults != null) {
|
| + _queryParams["maxResults"] = ["${maxResults}"];
|
| + }
|
| + if (pageToken != null) {
|
| + _queryParams["pageToken"] = [pageToken];
|
| + }
|
| + if (q != null) {
|
| + _queryParams["q"] = [q];
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/threads';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "GET",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new ListThreadsResponse.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Modifies the labels applied to the thread. This applies to all messages in
|
| + * the thread.
|
| + *
|
| + * [request] - The metadata request object.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - The user's email address. The special value me can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [id] - The ID of the thread to modify.
|
| + *
|
| + * Completes with a [Thread].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<Thread> modify(ModifyThreadRequest request, core.String userId, core.String id) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (request != null) {
|
| + _body = convert.JSON.encode((request).toJson());
|
| + }
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (id == null) {
|
| + throw new core.ArgumentError("Parameter id is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id') + '/modify';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "POST",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new Thread.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Moves the specified thread to the trash.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - The user's email address. The special value me can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [id] - The ID of the thread to Trash.
|
| + *
|
| + * Completes with a [Thread].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<Thread> trash(core.String userId, core.String id) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (id == null) {
|
| + throw new core.ArgumentError("Parameter id is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id') + '/trash';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "POST",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new Thread.fromJson(data));
|
| + }
|
| +
|
| + /**
|
| + * Removes the specified thread from the trash.
|
| + *
|
| + * Request parameters:
|
| + *
|
| + * [userId] - The user's email address. The special value me can be used to
|
| + * indicate the authenticated user.
|
| + *
|
| + * [id] - The ID of the thread to remove from Trash.
|
| + *
|
| + * Completes with a [Thread].
|
| + *
|
| + * Completes with a [commons.ApiRequestError] if the API endpoint returned an
|
| + * error.
|
| + *
|
| + * If the used [http.Client] completes with an error when making a REST call,
|
| + * this method will complete with the same error.
|
| + */
|
| + async.Future<Thread> untrash(core.String userId, core.String id) {
|
| + var _url = null;
|
| + var _queryParams = new core.Map();
|
| + var _uploadMedia = null;
|
| + var _uploadOptions = null;
|
| + var _downloadOptions = commons.DownloadOptions.Metadata;
|
| + var _body = null;
|
| +
|
| + if (userId == null) {
|
| + throw new core.ArgumentError("Parameter userId is required.");
|
| + }
|
| + if (id == null) {
|
| + throw new core.ArgumentError("Parameter id is required.");
|
| + }
|
| +
|
| + _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Escaper.ecapeVariable('$id') + '/untrash';
|
| +
|
| + var _response = _requester.request(_url,
|
| + "POST",
|
| + body: _body,
|
| + queryParams: _queryParams,
|
| + uploadOptions: _uploadOptions,
|
| + uploadMedia: _uploadMedia,
|
| + downloadOptions: _downloadOptions);
|
| + return _response.then((data) => new Thread.fromJson(data));
|
| + }
|
| +
|
| +}
|
| +
|
| +
|
| +
|
| +/** Auto-forwarding settings for an account. */
|
| +class AutoForwarding {
|
| + /**
|
| + * The state that a message should be left in after it has been forwarded.
|
| + * Possible string values are:
|
| + * - "archive"
|
| + * - "dispositionUnspecified"
|
| + * - "leaveInInbox"
|
| + * - "markRead"
|
| + * - "trash"
|
| + */
|
| + core.String disposition;
|
| + /**
|
| + * Email address to which all incoming messages are forwarded. This email
|
| + * address must be a verified member of the forwarding addresses.
|
| + */
|
| + core.String emailAddress;
|
| + /**
|
| + * Whether all incoming mail is automatically forwarded to another address.
|
| + */
|
| + core.bool enabled;
|
| +
|
| + AutoForwarding();
|
| +
|
| + AutoForwarding.fromJson(core.Map _json) {
|
| + if (_json.containsKey("disposition")) {
|
| + disposition = _json["disposition"];
|
| + }
|
| + if (_json.containsKey("emailAddress")) {
|
| + emailAddress = _json["emailAddress"];
|
| + }
|
| + if (_json.containsKey("enabled")) {
|
| + enabled = _json["enabled"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (disposition != null) {
|
| + _json["disposition"] = disposition;
|
| + }
|
| + if (emailAddress != null) {
|
| + _json["emailAddress"] = emailAddress;
|
| + }
|
| + if (enabled != null) {
|
| + _json["enabled"] = enabled;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +class BatchDeleteMessagesRequest {
|
| + /** The IDs of the messages to delete. */
|
| + core.List<core.String> ids;
|
| +
|
| + BatchDeleteMessagesRequest();
|
| +
|
| + BatchDeleteMessagesRequest.fromJson(core.Map _json) {
|
| + if (_json.containsKey("ids")) {
|
| + ids = _json["ids"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (ids != null) {
|
| + _json["ids"] = ids;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +/** A draft email in the user's mailbox. */
|
| +class Draft {
|
| + /** The immutable ID of the draft. */
|
| + core.String id;
|
| + /** The message content of the draft. */
|
| + Message message;
|
| +
|
| + Draft();
|
| +
|
| + Draft.fromJson(core.Map _json) {
|
| + if (_json.containsKey("id")) {
|
| + id = _json["id"];
|
| + }
|
| + if (_json.containsKey("message")) {
|
| + message = new Message.fromJson(_json["message"]);
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (id != null) {
|
| + _json["id"] = id;
|
| + }
|
| + if (message != null) {
|
| + _json["message"] = (message).toJson();
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * Resource definition for Gmail filters. Filters apply to specific messages
|
| + * instead of an entire email thread.
|
| + */
|
| +class Filter {
|
| + /** Action that the filter performs. */
|
| + FilterAction action;
|
| + /** Matching criteria for the filter. */
|
| + FilterCriteria criteria;
|
| + /** The server assigned ID of the filter. */
|
| + core.String id;
|
| +
|
| + Filter();
|
| +
|
| + Filter.fromJson(core.Map _json) {
|
| + if (_json.containsKey("action")) {
|
| + action = new FilterAction.fromJson(_json["action"]);
|
| + }
|
| + if (_json.containsKey("criteria")) {
|
| + criteria = new FilterCriteria.fromJson(_json["criteria"]);
|
| + }
|
| + if (_json.containsKey("id")) {
|
| + id = _json["id"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (action != null) {
|
| + _json["action"] = (action).toJson();
|
| + }
|
| + if (criteria != null) {
|
| + _json["criteria"] = (criteria).toJson();
|
| + }
|
| + if (id != null) {
|
| + _json["id"] = id;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +/** A set of actions to perform on a message. */
|
| +class FilterAction {
|
| + /** List of labels to add to the message. */
|
| + core.List<core.String> addLabelIds;
|
| + /** Email address that the message should be forwarded to. */
|
| + core.String forward;
|
| + /** List of labels to remove from the message. */
|
| + core.List<core.String> removeLabelIds;
|
| +
|
| + FilterAction();
|
| +
|
| + FilterAction.fromJson(core.Map _json) {
|
| + if (_json.containsKey("addLabelIds")) {
|
| + addLabelIds = _json["addLabelIds"];
|
| + }
|
| + if (_json.containsKey("forward")) {
|
| + forward = _json["forward"];
|
| + }
|
| + if (_json.containsKey("removeLabelIds")) {
|
| + removeLabelIds = _json["removeLabelIds"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (addLabelIds != null) {
|
| + _json["addLabelIds"] = addLabelIds;
|
| + }
|
| + if (forward != null) {
|
| + _json["forward"] = forward;
|
| + }
|
| + if (removeLabelIds != null) {
|
| + _json["removeLabelIds"] = removeLabelIds;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +/** Message matching criteria. */
|
| +class FilterCriteria {
|
| + /** Whether the response should exclude chats. */
|
| + core.bool excludeChats;
|
| + /** The sender's display name or email address. */
|
| + core.String from;
|
| + /** Whether the message has any attachment. */
|
| + core.bool hasAttachment;
|
| + /**
|
| + * Only return messages not matching the specified query. Supports the same
|
| + * query format as the Gmail search box. For example,
|
| + * "from:someuser@example.com rfc822msgid: is:unread".
|
| + */
|
| + core.String negatedQuery;
|
| + /**
|
| + * Only return messages matching the specified query. Supports the same query
|
| + * format as the Gmail search box. For example, "from:someuser@example.com
|
| + * rfc822msgid: is:unread".
|
| + */
|
| + core.String query;
|
| + /**
|
| + * The size of the entire RFC822 message in bytes, including all headers and
|
| + * attachments.
|
| + */
|
| + core.int size;
|
| + /**
|
| + * How the message size in bytes should be in relation to the size field.
|
| + * Possible string values are:
|
| + * - "larger"
|
| + * - "smaller"
|
| + * - "unspecified"
|
| + */
|
| + core.String sizeComparison;
|
| + /**
|
| + * Case-insensitive phrase found in the message's subject. Trailing and
|
| + * leading whitespace are be trimmed and adjacent spaces are collapsed.
|
| + */
|
| + core.String subject;
|
| + /**
|
| + * The recipient's display name or email address. Includes recipients in the
|
| + * "to", "cc", and "bcc" header fields. You can use simply the local part of
|
| + * the email address. For example, "example" and "example@" both match
|
| + * "example@gmail.com". This field is case-insensitive.
|
| + */
|
| + core.String to;
|
| +
|
| + FilterCriteria();
|
| +
|
| + FilterCriteria.fromJson(core.Map _json) {
|
| + if (_json.containsKey("excludeChats")) {
|
| + excludeChats = _json["excludeChats"];
|
| + }
|
| + if (_json.containsKey("from")) {
|
| + from = _json["from"];
|
| + }
|
| + if (_json.containsKey("hasAttachment")) {
|
| + hasAttachment = _json["hasAttachment"];
|
| + }
|
| + if (_json.containsKey("negatedQuery")) {
|
| + negatedQuery = _json["negatedQuery"];
|
| + }
|
| + if (_json.containsKey("query")) {
|
| + query = _json["query"];
|
| + }
|
| + if (_json.containsKey("size")) {
|
| + size = _json["size"];
|
| + }
|
| + if (_json.containsKey("sizeComparison")) {
|
| + sizeComparison = _json["sizeComparison"];
|
| + }
|
| + if (_json.containsKey("subject")) {
|
| + subject = _json["subject"];
|
| + }
|
| + if (_json.containsKey("to")) {
|
| + to = _json["to"];
|
| + }
|
| }
|
|
|
| core.Map toJson() {
|
| var _json = new core.Map();
|
| - if (id != null) {
|
| - _json["id"] = id;
|
| + if (excludeChats != null) {
|
| + _json["excludeChats"] = excludeChats;
|
| }
|
| - if (message != null) {
|
| - _json["message"] = (message).toJson();
|
| + if (from != null) {
|
| + _json["from"] = from;
|
| + }
|
| + if (hasAttachment != null) {
|
| + _json["hasAttachment"] = hasAttachment;
|
| + }
|
| + if (negatedQuery != null) {
|
| + _json["negatedQuery"] = negatedQuery;
|
| + }
|
| + if (query != null) {
|
| + _json["query"] = query;
|
| + }
|
| + if (size != null) {
|
| + _json["size"] = size;
|
| + }
|
| + if (sizeComparison != null) {
|
| + _json["sizeComparison"] = sizeComparison;
|
| + }
|
| + if (subject != null) {
|
| + _json["subject"] = subject;
|
| + }
|
| + if (to != null) {
|
| + _json["to"] = to;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +/** Settings for a forwarding address. */
|
| +class ForwardingAddress {
|
| + /** An email address to which messages can be forwarded. */
|
| + core.String forwardingEmail;
|
| + /**
|
| + * Indicates whether this address has been verified and is usable for
|
| + * forwarding. Read-only.
|
| + * Possible string values are:
|
| + * - "accepted"
|
| + * - "pending"
|
| + * - "verificationStatusUnspecified"
|
| + */
|
| + core.String verificationStatus;
|
| +
|
| + ForwardingAddress();
|
| +
|
| + ForwardingAddress.fromJson(core.Map _json) {
|
| + if (_json.containsKey("forwardingEmail")) {
|
| + forwardingEmail = _json["forwardingEmail"];
|
| + }
|
| + if (_json.containsKey("verificationStatus")) {
|
| + verificationStatus = _json["verificationStatus"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (forwardingEmail != null) {
|
| + _json["forwardingEmail"] = forwardingEmail;
|
| + }
|
| + if (verificationStatus != null) {
|
| + _json["verificationStatus"] = verificationStatus;
|
| }
|
| return _json;
|
| }
|
| @@ -2117,6 +3473,68 @@ class HistoryMessageDeleted {
|
| }
|
| }
|
|
|
| +/** IMAP settings for an account. */
|
| +class ImapSettings {
|
| + /**
|
| + * If this value is true, Gmail will immediately expunge a message when it is
|
| + * marked as deleted in IMAP. Otherwise, Gmail will wait for an update from
|
| + * the client before expunging messages marked as deleted.
|
| + */
|
| + core.bool autoExpunge;
|
| + /** Whether IMAP is enabled for the account. */
|
| + core.bool enabled;
|
| + /**
|
| + * The action that will be executed on a message when it is marked as deleted
|
| + * and expunged from the last visible IMAP folder.
|
| + * Possible string values are:
|
| + * - "archive"
|
| + * - "deleteForever"
|
| + * - "expungeBehaviorUnspecified"
|
| + * - "trash"
|
| + */
|
| + core.String expungeBehavior;
|
| + /**
|
| + * An optional limit on the number of messages that an IMAP folder may
|
| + * contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is
|
| + * interpreted to mean that there is no limit.
|
| + */
|
| + core.int maxFolderSize;
|
| +
|
| + ImapSettings();
|
| +
|
| + ImapSettings.fromJson(core.Map _json) {
|
| + if (_json.containsKey("autoExpunge")) {
|
| + autoExpunge = _json["autoExpunge"];
|
| + }
|
| + if (_json.containsKey("enabled")) {
|
| + enabled = _json["enabled"];
|
| + }
|
| + if (_json.containsKey("expungeBehavior")) {
|
| + expungeBehavior = _json["expungeBehavior"];
|
| + }
|
| + if (_json.containsKey("maxFolderSize")) {
|
| + maxFolderSize = _json["maxFolderSize"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (autoExpunge != null) {
|
| + _json["autoExpunge"] = autoExpunge;
|
| + }
|
| + if (enabled != null) {
|
| + _json["enabled"] = enabled;
|
| + }
|
| + if (expungeBehavior != null) {
|
| + _json["expungeBehavior"] = expungeBehavior;
|
| + }
|
| + if (maxFolderSize != null) {
|
| + _json["maxFolderSize"] = maxFolderSize;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| /**
|
| * Labels are used to categorize messages and threads within the user's mailbox.
|
| */
|
| @@ -2265,6 +3683,50 @@ class ListDraftsResponse {
|
| }
|
| }
|
|
|
| +/** Response for the ListFilters method. */
|
| +class ListFiltersResponse {
|
| + /** List of a user's filters. */
|
| + core.List<Filter> filter;
|
| +
|
| + ListFiltersResponse();
|
| +
|
| + ListFiltersResponse.fromJson(core.Map _json) {
|
| + if (_json.containsKey("filter")) {
|
| + filter = _json["filter"].map((value) => new Filter.fromJson(value)).toList();
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (filter != null) {
|
| + _json["filter"] = filter.map((value) => (value).toJson()).toList();
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +/** Response for the ListForwardingAddresses method. */
|
| +class ListForwardingAddressesResponse {
|
| + /** List of addresses that may be used for forwarding. */
|
| + core.List<ForwardingAddress> forwardingAddresses;
|
| +
|
| + ListForwardingAddressesResponse();
|
| +
|
| + ListForwardingAddressesResponse.fromJson(core.Map _json) {
|
| + if (_json.containsKey("forwardingAddresses")) {
|
| + forwardingAddresses = _json["forwardingAddresses"].map((value) => new ForwardingAddress.fromJson(value)).toList();
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (forwardingAddresses != null) {
|
| + _json["forwardingAddresses"] = forwardingAddresses.map((value) => (value).toJson()).toList();
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| class ListHistoryResponse {
|
| /**
|
| * List of history records. Any messages contained in the response will
|
| @@ -2363,6 +3825,28 @@ class ListMessagesResponse {
|
| }
|
| }
|
|
|
| +/** Response for the ListSendAs method. */
|
| +class ListSendAsResponse {
|
| + /** List of send-as aliases. */
|
| + core.List<SendAs> sendAs;
|
| +
|
| + ListSendAsResponse();
|
| +
|
| + ListSendAsResponse.fromJson(core.Map _json) {
|
| + if (_json.containsKey("sendAs")) {
|
| + sendAs = _json["sendAs"].map((value) => new SendAs.fromJson(value)).toList();
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (sendAs != null) {
|
| + _json["sendAs"] = sendAs.map((value) => (value).toJson()).toList();
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| class ListThreadsResponse {
|
| /** Page token to retrieve the next page of results in the list. */
|
| core.String nextPageToken;
|
| @@ -2732,6 +4216,52 @@ class ModifyThreadRequest {
|
| }
|
| }
|
|
|
| +/** POP settings for an account. */
|
| +class PopSettings {
|
| + /**
|
| + * The range of messages which are accessible via POP.
|
| + * Possible string values are:
|
| + * - "accessWindowUnspecified"
|
| + * - "allMail"
|
| + * - "disabled"
|
| + * - "fromNowOn"
|
| + */
|
| + core.String accessWindow;
|
| + /**
|
| + * The action that will be executed on a message after it has been fetched via
|
| + * POP.
|
| + * Possible string values are:
|
| + * - "archive"
|
| + * - "dispositionUnspecified"
|
| + * - "leaveInInbox"
|
| + * - "markRead"
|
| + * - "trash"
|
| + */
|
| + core.String disposition;
|
| +
|
| + PopSettings();
|
| +
|
| + PopSettings.fromJson(core.Map _json) {
|
| + if (_json.containsKey("accessWindow")) {
|
| + accessWindow = _json["accessWindow"];
|
| + }
|
| + if (_json.containsKey("disposition")) {
|
| + disposition = _json["disposition"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (accessWindow != null) {
|
| + _json["accessWindow"] = accessWindow;
|
| + }
|
| + if (disposition != null) {
|
| + _json["disposition"] = disposition;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| /** Profile for a Gmail user. */
|
| class Profile {
|
| /** The user's email address. */
|
| @@ -2778,6 +4308,209 @@ class Profile {
|
| }
|
| }
|
|
|
| +/**
|
| + * Settings associated with a send-as alias, which can be either the primary
|
| + * login address associated with the account or a custom "from" address. Send-as
|
| + * aliases correspond to the "Send Mail As" feature in the web interface. See
|
| + * for more details.
|
| + */
|
| +class SendAs {
|
| + /**
|
| + * A name that appears in the "From:" header for mail sent using this alias.
|
| + * For custom "from" addresses, when this is empty, Gmail will populate the
|
| + * "From:" header with the name that is used for the primary address
|
| + * associated with the account.
|
| + */
|
| + core.String displayName;
|
| + /**
|
| + * Whether this address is selected as the default "From:" address in
|
| + * situations such as composing a new message or sending a vacation
|
| + * auto-reply. Every Gmail account has exactly one default send-as address, so
|
| + * the only legal value that clients may write to this field is true. Changing
|
| + * this from false to true for an address will result in this field becoming
|
| + * false for the other previous default address.
|
| + */
|
| + core.bool isDefault;
|
| + /**
|
| + * Whether this address is the primary address used to login to the account.
|
| + * Every Gmail account has exactly one primary address, and it cannot be
|
| + * deleted from the collection of send-as aliases. This field is read-only.
|
| + */
|
| + core.bool isPrimary;
|
| + /**
|
| + * An optional email address that is included in a "Reply-To:" header for mail
|
| + * sent using this alias. If this is empty, Gmail will not generate a
|
| + * "Reply-To:" header.
|
| + */
|
| + core.String replyToAddress;
|
| + /**
|
| + * The email address that appears in the "From:" header for mail sent using
|
| + * this alias. This is read-only for all operations except create.
|
| + */
|
| + core.String sendAsEmail;
|
| + /**
|
| + * An optional HTML signature that is included in messages composed with this
|
| + * alias in the Gmail web UI.
|
| + */
|
| + core.String signature;
|
| + /**
|
| + * An optional SMTP service that will be used as an outbound relay for mail
|
| + * sent using this alias. If this is empty, outbound mail will be sent
|
| + * directly from Gmail's servers to the destination SMTP service. This setting
|
| + * only applies to custom "from" aliases.
|
| + */
|
| + SmtpMsa smtpMsa;
|
| + /**
|
| + * Whether Gmail should treat this address as an alias for the user's primary
|
| + * email address. See for more details. This setting only applies to custom
|
| + * "from" aliases.
|
| + */
|
| + core.bool treatAsAlias;
|
| + /**
|
| + * Indicates whether this address has been verified for use as a send-as
|
| + * alias. Read-only. This setting only applies to custom "from" aliases.
|
| + * Possible string values are:
|
| + * - "accepted"
|
| + * - "pending"
|
| + * - "verificationStatusUnspecified"
|
| + */
|
| + core.String verificationStatus;
|
| +
|
| + SendAs();
|
| +
|
| + SendAs.fromJson(core.Map _json) {
|
| + if (_json.containsKey("displayName")) {
|
| + displayName = _json["displayName"];
|
| + }
|
| + if (_json.containsKey("isDefault")) {
|
| + isDefault = _json["isDefault"];
|
| + }
|
| + if (_json.containsKey("isPrimary")) {
|
| + isPrimary = _json["isPrimary"];
|
| + }
|
| + if (_json.containsKey("replyToAddress")) {
|
| + replyToAddress = _json["replyToAddress"];
|
| + }
|
| + if (_json.containsKey("sendAsEmail")) {
|
| + sendAsEmail = _json["sendAsEmail"];
|
| + }
|
| + if (_json.containsKey("signature")) {
|
| + signature = _json["signature"];
|
| + }
|
| + if (_json.containsKey("smtpMsa")) {
|
| + smtpMsa = new SmtpMsa.fromJson(_json["smtpMsa"]);
|
| + }
|
| + if (_json.containsKey("treatAsAlias")) {
|
| + treatAsAlias = _json["treatAsAlias"];
|
| + }
|
| + if (_json.containsKey("verificationStatus")) {
|
| + verificationStatus = _json["verificationStatus"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (displayName != null) {
|
| + _json["displayName"] = displayName;
|
| + }
|
| + if (isDefault != null) {
|
| + _json["isDefault"] = isDefault;
|
| + }
|
| + if (isPrimary != null) {
|
| + _json["isPrimary"] = isPrimary;
|
| + }
|
| + if (replyToAddress != null) {
|
| + _json["replyToAddress"] = replyToAddress;
|
| + }
|
| + if (sendAsEmail != null) {
|
| + _json["sendAsEmail"] = sendAsEmail;
|
| + }
|
| + if (signature != null) {
|
| + _json["signature"] = signature;
|
| + }
|
| + if (smtpMsa != null) {
|
| + _json["smtpMsa"] = (smtpMsa).toJson();
|
| + }
|
| + if (treatAsAlias != null) {
|
| + _json["treatAsAlias"] = treatAsAlias;
|
| + }
|
| + if (verificationStatus != null) {
|
| + _json["verificationStatus"] = verificationStatus;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| +/** Configuration for communication with an SMTP service. */
|
| +class SmtpMsa {
|
| + /** The hostname of the SMTP service. Required. */
|
| + core.String host;
|
| + /**
|
| + * The password that will be used for authentication with the SMTP service.
|
| + * This is a write-only field that can be specified in requests to create or
|
| + * update SendAs settings; it is never populated in responses.
|
| + */
|
| + core.String password;
|
| + /** The port of the SMTP service. Required. */
|
| + core.int port;
|
| + /**
|
| + * The protocol that will be used to secure communication with the SMTP
|
| + * service. Required.
|
| + * Possible string values are:
|
| + * - "none"
|
| + * - "securityModeUnspecified"
|
| + * - "ssl"
|
| + * - "starttls"
|
| + */
|
| + core.String securityMode;
|
| + /**
|
| + * The username that will be used for authentication with the SMTP service.
|
| + * This is a write-only field that can be specified in requests to create or
|
| + * update SendAs settings; it is never populated in responses.
|
| + */
|
| + core.String username;
|
| +
|
| + SmtpMsa();
|
| +
|
| + SmtpMsa.fromJson(core.Map _json) {
|
| + if (_json.containsKey("host")) {
|
| + host = _json["host"];
|
| + }
|
| + if (_json.containsKey("password")) {
|
| + password = _json["password"];
|
| + }
|
| + if (_json.containsKey("port")) {
|
| + port = _json["port"];
|
| + }
|
| + if (_json.containsKey("securityMode")) {
|
| + securityMode = _json["securityMode"];
|
| + }
|
| + if (_json.containsKey("username")) {
|
| + username = _json["username"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (host != null) {
|
| + _json["host"] = host;
|
| + }
|
| + if (password != null) {
|
| + _json["password"] = password;
|
| + }
|
| + if (port != null) {
|
| + _json["port"] = port;
|
| + }
|
| + if (securityMode != null) {
|
| + _json["securityMode"] = securityMode;
|
| + }
|
| + if (username != null) {
|
| + _json["username"] = username;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| /** A collection of messages representing a conversation. */
|
| class Thread {
|
| /** The ID of the last history record that modified this thread. */
|
| @@ -2824,6 +4557,111 @@ class Thread {
|
| }
|
| }
|
|
|
| +/**
|
| + * Vacation auto-reply settings for an account. These settings correspond to the
|
| + * "Vacation responder" feature in the web interface. See for more details.
|
| + */
|
| +class VacationSettings {
|
| + /** Flag that controls whether Gmail automatically replies to messages. */
|
| + core.bool enableAutoReply;
|
| + /**
|
| + * An optional end time for sending auto-replies (epoch ms). When this is
|
| + * specified, Gmail will automatically reply only to messages that it receives
|
| + * before the end time. If both startTime and endTime are specified, startTime
|
| + * must precede endTime.
|
| + */
|
| + core.String endTime;
|
| + /**
|
| + * Response body in HTML format. Gmail will sanitize the HTML before storing
|
| + * it.
|
| + */
|
| + core.String responseBodyHtml;
|
| + /** Response body in plain text format. */
|
| + core.String responseBodyPlainText;
|
| + /**
|
| + * Optional text to prepend to the subject line in vacation responses. In
|
| + * order to enable auto-replies, either the response subject or the response
|
| + * body must be nonempty.
|
| + */
|
| + core.String responseSubject;
|
| + /**
|
| + * Flag that determines whether responses are sent to recipients who are not
|
| + * in the user's list of contacts.
|
| + */
|
| + core.bool restrictToContacts;
|
| + /**
|
| + * Flag that determines whether responses are sent to recipients who are
|
| + * outside of the user's domain. This feature is only available for Google
|
| + * Apps users.
|
| + */
|
| + core.bool restrictToDomain;
|
| + /**
|
| + * An optional start time for sending auto-replies (epoch ms). When this is
|
| + * specified, Gmail will automatically reply only to messages that it receives
|
| + * after the start time. If both startTime and endTime are specified,
|
| + * startTime must precede endTime.
|
| + */
|
| + core.String startTime;
|
| +
|
| + VacationSettings();
|
| +
|
| + VacationSettings.fromJson(core.Map _json) {
|
| + if (_json.containsKey("enableAutoReply")) {
|
| + enableAutoReply = _json["enableAutoReply"];
|
| + }
|
| + if (_json.containsKey("endTime")) {
|
| + endTime = _json["endTime"];
|
| + }
|
| + if (_json.containsKey("responseBodyHtml")) {
|
| + responseBodyHtml = _json["responseBodyHtml"];
|
| + }
|
| + if (_json.containsKey("responseBodyPlainText")) {
|
| + responseBodyPlainText = _json["responseBodyPlainText"];
|
| + }
|
| + if (_json.containsKey("responseSubject")) {
|
| + responseSubject = _json["responseSubject"];
|
| + }
|
| + if (_json.containsKey("restrictToContacts")) {
|
| + restrictToContacts = _json["restrictToContacts"];
|
| + }
|
| + if (_json.containsKey("restrictToDomain")) {
|
| + restrictToDomain = _json["restrictToDomain"];
|
| + }
|
| + if (_json.containsKey("startTime")) {
|
| + startTime = _json["startTime"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (enableAutoReply != null) {
|
| + _json["enableAutoReply"] = enableAutoReply;
|
| + }
|
| + if (endTime != null) {
|
| + _json["endTime"] = endTime;
|
| + }
|
| + if (responseBodyHtml != null) {
|
| + _json["responseBodyHtml"] = responseBodyHtml;
|
| + }
|
| + if (responseBodyPlainText != null) {
|
| + _json["responseBodyPlainText"] = responseBodyPlainText;
|
| + }
|
| + if (responseSubject != null) {
|
| + _json["responseSubject"] = responseSubject;
|
| + }
|
| + if (restrictToContacts != null) {
|
| + _json["restrictToContacts"] = restrictToContacts;
|
| + }
|
| + if (restrictToDomain != null) {
|
| + _json["restrictToDomain"] = restrictToDomain;
|
| + }
|
| + if (startTime != null) {
|
| + _json["startTime"] = startTime;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| /** Set up or update a new push notification watch on this user's mailbox. */
|
| class WatchRequest {
|
| /**
|
|
|