| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 1 library googleapis.gmail.v1; | 3 library googleapis.gmail.v1; |
| 2 | 4 |
| 3 import "dart:core" as core; | 5 import 'dart:core' as core; |
| 4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
| 5 import "dart:async" as async; | 7 import 'dart:async' as async; |
| 6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
| 7 | 9 |
| 8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
| 9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; | |
| 11 import '../common/common.dart' as common; | |
| 12 | 13 |
| 13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, |
| 16 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, |
| 17 ByteRange; |
| 18 |
| 19 const core.String USER_AGENT = 'dart-api-client gmail/v1'; |
| 15 | 20 |
| 16 /** The Gmail REST API. */ | 21 /** The Gmail REST API. */ |
| 17 class GmailApi { | 22 class GmailApi { |
| 18 /** View and manage your mail */ | 23 /** View and manage your mail */ |
| 19 static const MailGoogleComScope = "https://mail.google.com/"; | 24 static const MailGoogleComScope = "https://mail.google.com/"; |
| 20 | 25 |
| 21 /** Manage drafts and send emails */ | 26 /** Manage drafts and send emails */ |
| 22 static const GmailComposeScope = "https://www.googleapis.com/auth/gmail.compos
e"; | 27 static const GmailComposeScope = "https://www.googleapis.com/auth/gmail.compos
e"; |
| 23 | 28 |
| 29 /** Insert mail into your mailbox */ |
| 30 static const GmailInsertScope = "https://www.googleapis.com/auth/gmail.insert"
; |
| 31 |
| 32 /** Manage mailbox labels */ |
| 33 static const GmailLabelsScope = "https://www.googleapis.com/auth/gmail.labels"
; |
| 34 |
| 24 /** View and modify but not delete your email */ | 35 /** View and modify but not delete your email */ |
| 25 static const GmailModifyScope = "https://www.googleapis.com/auth/gmail.modify"
; | 36 static const GmailModifyScope = "https://www.googleapis.com/auth/gmail.modify"
; |
| 26 | 37 |
| 27 /** View your emails messages and settings */ | 38 /** View your emails messages and settings */ |
| 28 static const GmailReadonlyScope = "https://www.googleapis.com/auth/gmail.reado
nly"; | 39 static const GmailReadonlyScope = "https://www.googleapis.com/auth/gmail.reado
nly"; |
| 29 | 40 |
| 30 | 41 |
| 31 final common_internal.ApiRequester _requester; | 42 final commons.ApiRequester _requester; |
| 32 | 43 |
| 33 UsersResourceApi get users => new UsersResourceApi(_requester); | 44 UsersResourceApi get users => new UsersResourceApi(_requester); |
| 34 | 45 |
| 35 GmailApi(http.Client client, {core.String rootUrl: "https://www.googleapis.com
/", core.String servicePath: "gmail/v1/users/"}) : | 46 GmailApi(http.Client client, {core.String rootUrl: "https://www.googleapis.com
/", core.String servicePath: "gmail/v1/users/"}) : |
| 36 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 47 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 37 } | 48 } |
| 38 | 49 |
| 39 | 50 |
| 40 /** Not documented yet. */ | |
| 41 class UsersResourceApi { | 51 class UsersResourceApi { |
| 42 final common_internal.ApiRequester _requester; | 52 final commons.ApiRequester _requester; |
| 43 | 53 |
| 44 UsersDraftsResourceApi get drafts => new UsersDraftsResourceApi(_requester); | 54 UsersDraftsResourceApi get drafts => new UsersDraftsResourceApi(_requester); |
| 45 UsersHistoryResourceApi get history => new UsersHistoryResourceApi(_requester)
; | 55 UsersHistoryResourceApi get history => new UsersHistoryResourceApi(_requester)
; |
| 46 UsersLabelsResourceApi get labels => new UsersLabelsResourceApi(_requester); | 56 UsersLabelsResourceApi get labels => new UsersLabelsResourceApi(_requester); |
| 47 UsersMessagesResourceApi get messages => new UsersMessagesResourceApi(_request
er); | 57 UsersMessagesResourceApi get messages => new UsersMessagesResourceApi(_request
er); |
| 48 UsersThreadsResourceApi get threads => new UsersThreadsResourceApi(_requester)
; | 58 UsersThreadsResourceApi get threads => new UsersThreadsResourceApi(_requester)
; |
| 49 | 59 |
| 50 UsersResourceApi(common_internal.ApiRequester client) : | 60 UsersResourceApi(commons.ApiRequester client) : |
| 51 _requester = client; | 61 _requester = client; |
| 52 | 62 |
| 53 /** | 63 /** |
| 54 * Gets the current user's Gmail profile. | 64 * Gets the current user's Gmail profile. |
| 55 * | 65 * |
| 56 * Request parameters: | 66 * Request parameters: |
| 57 * | 67 * |
| 58 * [userId] - The user's email address. The special value me can be used to | 68 * [userId] - The user's email address. The special value me can be used to |
| 59 * indicate the authenticated user. | 69 * indicate the authenticated user. |
| 60 * | 70 * |
| 61 * Completes with a [Profile]. | 71 * Completes with a [Profile]. |
| 62 * | 72 * |
| 63 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 73 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 64 * error. | 74 * error. |
| 65 * | 75 * |
| 66 * If the used [http.Client] completes with an error when making a REST call, | 76 * If the used [http.Client] completes with an error when making a REST call, |
| 67 * this method will complete with the same error. | 77 * this method will complete with the same error. |
| 68 */ | 78 */ |
| 69 async.Future<Profile> getProfile(core.String userId) { | 79 async.Future<Profile> getProfile(core.String userId) { |
| 70 var _url = null; | 80 var _url = null; |
| 71 var _queryParams = new core.Map(); | 81 var _queryParams = new core.Map(); |
| 72 var _uploadMedia = null; | 82 var _uploadMedia = null; |
| 73 var _uploadOptions = null; | 83 var _uploadOptions = null; |
| 74 var _downloadOptions = common.DownloadOptions.Metadata; | 84 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 75 var _body = null; | 85 var _body = null; |
| 76 | 86 |
| 77 if (userId == null) { | 87 if (userId == null) { |
| 78 throw new core.ArgumentError("Parameter userId is required."); | 88 throw new core.ArgumentError("Parameter userId is required."); |
| 79 } | 89 } |
| 80 | 90 |
| 81 | 91 |
| 82 _url = common_internal.Escaper.ecapeVariable('$userId') + '/profile'; | 92 _url = commons.Escaper.ecapeVariable('$userId') + '/profile'; |
| 83 | 93 |
| 84 var _response = _requester.request(_url, | 94 var _response = _requester.request(_url, |
| 85 "GET", | 95 "GET", |
| 86 body: _body, | 96 body: _body, |
| 87 queryParams: _queryParams, | 97 queryParams: _queryParams, |
| 88 uploadOptions: _uploadOptions, | 98 uploadOptions: _uploadOptions, |
| 89 uploadMedia: _uploadMedia, | 99 uploadMedia: _uploadMedia, |
| 90 downloadOptions: _downloadOptions); | 100 downloadOptions: _downloadOptions); |
| 91 return _response.then((data) => new Profile.fromJson(data)); | 101 return _response.then((data) => new Profile.fromJson(data)); |
| 92 } | 102 } |
| 93 | 103 |
| 94 } | 104 } |
| 95 | 105 |
| 96 | 106 |
| 97 /** Not documented yet. */ | |
| 98 class UsersDraftsResourceApi { | 107 class UsersDraftsResourceApi { |
| 99 final common_internal.ApiRequester _requester; | 108 final commons.ApiRequester _requester; |
| 100 | 109 |
| 101 UsersDraftsResourceApi(common_internal.ApiRequester client) : | 110 UsersDraftsResourceApi(commons.ApiRequester client) : |
| 102 _requester = client; | 111 _requester = client; |
| 103 | 112 |
| 104 /** | 113 /** |
| 105 * Creates a new draft with the DRAFT label. | 114 * Creates a new draft with the DRAFT label. |
| 106 * | 115 * |
| 107 * [request] - The metadata request object. | 116 * [request] - The metadata request object. |
| 108 * | 117 * |
| 109 * Request parameters: | 118 * Request parameters: |
| 110 * | 119 * |
| 111 * [userId] - The user's email address. The special value me can be used to | 120 * [userId] - The user's email address. The special value me can be used to |
| 112 * indicate the authenticated user. | 121 * indicate the authenticated user. |
| 113 * | 122 * |
| 114 * [uploadMedia] - The media to upload. | 123 * [uploadMedia] - The media to upload. |
| 115 * | 124 * |
| 116 * [uploadOptions] - Options for the media upload. Streaming Media without the | 125 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 117 * length being known ahead of time is only supported via resumable uploads. | 126 * length being known ahead of time is only supported via resumable uploads. |
| 118 * | 127 * |
| 119 * Completes with a [Draft]. | 128 * Completes with a [Draft]. |
| 120 * | 129 * |
| 121 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 130 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 122 * error. | 131 * error. |
| 123 * | 132 * |
| 124 * If the used [http.Client] completes with an error when making a REST call, | 133 * If the used [http.Client] completes with an error when making a REST call, |
| 125 * this method will complete with the same error. | 134 * this method will complete with the same error. |
| 126 */ | 135 */ |
| 127 async.Future<Draft> create(Draft request, core.String userId, {common.UploadOp
tions uploadOptions : common.UploadOptions.Default, common.Media uploadMedia}) { | 136 async.Future<Draft> create(Draft request, core.String userId, {commons.UploadO
ptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}
) { |
| 128 var _url = null; | 137 var _url = null; |
| 129 var _queryParams = new core.Map(); | 138 var _queryParams = new core.Map(); |
| 130 var _uploadMedia = null; | 139 var _uploadMedia = null; |
| 131 var _uploadOptions = null; | 140 var _uploadOptions = null; |
| 132 var _downloadOptions = common.DownloadOptions.Metadata; | 141 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 133 var _body = null; | 142 var _body = null; |
| 134 | 143 |
| 135 if (request != null) { | 144 if (request != null) { |
| 136 _body = convert.JSON.encode((request).toJson()); | 145 _body = convert.JSON.encode((request).toJson()); |
| 137 } | 146 } |
| 138 if (userId == null) { | 147 if (userId == null) { |
| 139 throw new core.ArgumentError("Parameter userId is required."); | 148 throw new core.ArgumentError("Parameter userId is required."); |
| 140 } | 149 } |
| 141 | 150 |
| 142 _uploadMedia = uploadMedia; | 151 _uploadMedia = uploadMedia; |
| 143 _uploadOptions = uploadOptions; | 152 _uploadOptions = uploadOptions; |
| 144 | 153 |
| 145 if (_uploadMedia == null) { | 154 if (_uploadMedia == null) { |
| 146 _url = common_internal.Escaper.ecapeVariable('$userId') + '/drafts'; | 155 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; |
| 147 } else if (_uploadOptions is common.ResumableUploadOptions) { | 156 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
| 148 _url = '/resumable/upload/gmail/v1/users/' + common_internal.Escaper.ecape
Variable('$userId') + '/drafts'; | 157 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/drafts'; |
| 149 } else { | 158 } else { |
| 150 _url = '/upload/gmail/v1/users/' + common_internal.Escaper.ecapeVariable('
$userId') + '/drafts'; | 159 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/drafts'; |
| 151 } | 160 } |
| 152 | 161 |
| 153 | 162 |
| 154 var _response = _requester.request(_url, | 163 var _response = _requester.request(_url, |
| 155 "POST", | 164 "POST", |
| 156 body: _body, | 165 body: _body, |
| 157 queryParams: _queryParams, | 166 queryParams: _queryParams, |
| 158 uploadOptions: _uploadOptions, | 167 uploadOptions: _uploadOptions, |
| 159 uploadMedia: _uploadMedia, | 168 uploadMedia: _uploadMedia, |
| 160 downloadOptions: _downloadOptions); | 169 downloadOptions: _downloadOptions); |
| 161 return _response.then((data) => new Draft.fromJson(data)); | 170 return _response.then((data) => new Draft.fromJson(data)); |
| 162 } | 171 } |
| 163 | 172 |
| 164 /** | 173 /** |
| 165 * Immediately and permanently deletes the specified draft. Does not simply | 174 * Immediately and permanently deletes the specified draft. Does not simply |
| 166 * trash it. | 175 * trash it. |
| 167 * | 176 * |
| 168 * Request parameters: | 177 * Request parameters: |
| 169 * | 178 * |
| 170 * [userId] - The user's email address. The special value me can be used to | 179 * [userId] - The user's email address. The special value me can be used to |
| 171 * indicate the authenticated user. | 180 * indicate the authenticated user. |
| 172 * | 181 * |
| 173 * [id] - The ID of the draft to delete. | 182 * [id] - The ID of the draft to delete. |
| 174 * | 183 * |
| 175 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 184 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 176 * error. | 185 * error. |
| 177 * | 186 * |
| 178 * If the used [http.Client] completes with an error when making a REST call, | 187 * If the used [http.Client] completes with an error when making a REST call, |
| 179 * this method will complete with the same error. | 188 * this method will complete with the same error. |
| 180 */ | 189 */ |
| 181 async.Future delete(core.String userId, core.String id) { | 190 async.Future delete(core.String userId, core.String id) { |
| 182 var _url = null; | 191 var _url = null; |
| 183 var _queryParams = new core.Map(); | 192 var _queryParams = new core.Map(); |
| 184 var _uploadMedia = null; | 193 var _uploadMedia = null; |
| 185 var _uploadOptions = null; | 194 var _uploadOptions = null; |
| 186 var _downloadOptions = common.DownloadOptions.Metadata; | 195 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 187 var _body = null; | 196 var _body = null; |
| 188 | 197 |
| 189 if (userId == null) { | 198 if (userId == null) { |
| 190 throw new core.ArgumentError("Parameter userId is required."); | 199 throw new core.ArgumentError("Parameter userId is required."); |
| 191 } | 200 } |
| 192 if (id == null) { | 201 if (id == null) { |
| 193 throw new core.ArgumentError("Parameter id is required."); | 202 throw new core.ArgumentError("Parameter id is required."); |
| 194 } | 203 } |
| 195 | 204 |
| 196 _downloadOptions = null; | 205 _downloadOptions = null; |
| 197 | 206 |
| 198 _url = common_internal.Escaper.ecapeVariable('$userId') + '/drafts/' + commo
n_internal.Escaper.ecapeVariable('$id'); | 207 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/' + commons.Escap
er.ecapeVariable('$id'); |
| 199 | 208 |
| 200 var _response = _requester.request(_url, | 209 var _response = _requester.request(_url, |
| 201 "DELETE", | 210 "DELETE", |
| 202 body: _body, | 211 body: _body, |
| 203 queryParams: _queryParams, | 212 queryParams: _queryParams, |
| 204 uploadOptions: _uploadOptions, | 213 uploadOptions: _uploadOptions, |
| 205 uploadMedia: _uploadMedia, | 214 uploadMedia: _uploadMedia, |
| 206 downloadOptions: _downloadOptions); | 215 downloadOptions: _downloadOptions); |
| 207 return _response.then((data) => null); | 216 return _response.then((data) => null); |
| 208 } | 217 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 219 * | 228 * |
| 220 * [format] - The format to return the draft in. | 229 * [format] - The format to return the draft in. |
| 221 * Possible string values are: | 230 * Possible string values are: |
| 222 * - "full" | 231 * - "full" |
| 223 * - "metadata" | 232 * - "metadata" |
| 224 * - "minimal" | 233 * - "minimal" |
| 225 * - "raw" | 234 * - "raw" |
| 226 * | 235 * |
| 227 * Completes with a [Draft]. | 236 * Completes with a [Draft]. |
| 228 * | 237 * |
| 229 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 238 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 230 * error. | 239 * error. |
| 231 * | 240 * |
| 232 * If the used [http.Client] completes with an error when making a REST call, | 241 * If the used [http.Client] completes with an error when making a REST call, |
| 233 * this method will complete with the same error. | 242 * this method will complete with the same error. |
| 234 */ | 243 */ |
| 235 async.Future<Draft> get(core.String userId, core.String id, {core.String forma
t}) { | 244 async.Future<Draft> get(core.String userId, core.String id, {core.String forma
t}) { |
| 236 var _url = null; | 245 var _url = null; |
| 237 var _queryParams = new core.Map(); | 246 var _queryParams = new core.Map(); |
| 238 var _uploadMedia = null; | 247 var _uploadMedia = null; |
| 239 var _uploadOptions = null; | 248 var _uploadOptions = null; |
| 240 var _downloadOptions = common.DownloadOptions.Metadata; | 249 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 241 var _body = null; | 250 var _body = null; |
| 242 | 251 |
| 243 if (userId == null) { | 252 if (userId == null) { |
| 244 throw new core.ArgumentError("Parameter userId is required."); | 253 throw new core.ArgumentError("Parameter userId is required."); |
| 245 } | 254 } |
| 246 if (id == null) { | 255 if (id == null) { |
| 247 throw new core.ArgumentError("Parameter id is required."); | 256 throw new core.ArgumentError("Parameter id is required."); |
| 248 } | 257 } |
| 249 if (format != null) { | 258 if (format != null) { |
| 250 _queryParams["format"] = [format]; | 259 _queryParams["format"] = [format]; |
| 251 } | 260 } |
| 252 | 261 |
| 253 | 262 |
| 254 _url = common_internal.Escaper.ecapeVariable('$userId') + '/drafts/' + commo
n_internal.Escaper.ecapeVariable('$id'); | 263 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/' + commons.Escap
er.ecapeVariable('$id'); |
| 255 | 264 |
| 256 var _response = _requester.request(_url, | 265 var _response = _requester.request(_url, |
| 257 "GET", | 266 "GET", |
| 258 body: _body, | 267 body: _body, |
| 259 queryParams: _queryParams, | 268 queryParams: _queryParams, |
| 260 uploadOptions: _uploadOptions, | 269 uploadOptions: _uploadOptions, |
| 261 uploadMedia: _uploadMedia, | 270 uploadMedia: _uploadMedia, |
| 262 downloadOptions: _downloadOptions); | 271 downloadOptions: _downloadOptions); |
| 263 return _response.then((data) => new Draft.fromJson(data)); | 272 return _response.then((data) => new Draft.fromJson(data)); |
| 264 } | 273 } |
| 265 | 274 |
| 266 /** | 275 /** |
| 267 * Lists the drafts in the user's mailbox. | 276 * Lists the drafts in the user's mailbox. |
| 268 * | 277 * |
| 269 * Request parameters: | 278 * Request parameters: |
| 270 * | 279 * |
| 271 * [userId] - The user's email address. The special value me can be used to | 280 * [userId] - The user's email address. The special value me can be used to |
| 272 * indicate the authenticated user. | 281 * indicate the authenticated user. |
| 273 * | 282 * |
| 274 * [maxResults] - Maximum number of drafts to return. | 283 * [maxResults] - Maximum number of drafts to return. |
| 275 * | 284 * |
| 276 * [pageToken] - Page token to retrieve a specific page of results in the | 285 * [pageToken] - Page token to retrieve a specific page of results in the |
| 277 * list. | 286 * list. |
| 278 * | 287 * |
| 279 * Completes with a [ListDraftsResponse]. | 288 * Completes with a [ListDraftsResponse]. |
| 280 * | 289 * |
| 281 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 290 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 282 * error. | 291 * error. |
| 283 * | 292 * |
| 284 * If the used [http.Client] completes with an error when making a REST call, | 293 * If the used [http.Client] completes with an error when making a REST call, |
| 285 * this method will complete with the same error. | 294 * this method will complete with the same error. |
| 286 */ | 295 */ |
| 287 async.Future<ListDraftsResponse> list(core.String userId, {core.int maxResults
, core.String pageToken}) { | 296 async.Future<ListDraftsResponse> list(core.String userId, {core.int maxResults
, core.String pageToken}) { |
| 288 var _url = null; | 297 var _url = null; |
| 289 var _queryParams = new core.Map(); | 298 var _queryParams = new core.Map(); |
| 290 var _uploadMedia = null; | 299 var _uploadMedia = null; |
| 291 var _uploadOptions = null; | 300 var _uploadOptions = null; |
| 292 var _downloadOptions = common.DownloadOptions.Metadata; | 301 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 293 var _body = null; | 302 var _body = null; |
| 294 | 303 |
| 295 if (userId == null) { | 304 if (userId == null) { |
| 296 throw new core.ArgumentError("Parameter userId is required."); | 305 throw new core.ArgumentError("Parameter userId is required."); |
| 297 } | 306 } |
| 298 if (maxResults != null) { | 307 if (maxResults != null) { |
| 299 _queryParams["maxResults"] = ["${maxResults}"]; | 308 _queryParams["maxResults"] = ["${maxResults}"]; |
| 300 } | 309 } |
| 301 if (pageToken != null) { | 310 if (pageToken != null) { |
| 302 _queryParams["pageToken"] = [pageToken]; | 311 _queryParams["pageToken"] = [pageToken]; |
| 303 } | 312 } |
| 304 | 313 |
| 305 | 314 |
| 306 _url = common_internal.Escaper.ecapeVariable('$userId') + '/drafts'; | 315 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; |
| 307 | 316 |
| 308 var _response = _requester.request(_url, | 317 var _response = _requester.request(_url, |
| 309 "GET", | 318 "GET", |
| 310 body: _body, | 319 body: _body, |
| 311 queryParams: _queryParams, | 320 queryParams: _queryParams, |
| 312 uploadOptions: _uploadOptions, | 321 uploadOptions: _uploadOptions, |
| 313 uploadMedia: _uploadMedia, | 322 uploadMedia: _uploadMedia, |
| 314 downloadOptions: _downloadOptions); | 323 downloadOptions: _downloadOptions); |
| 315 return _response.then((data) => new ListDraftsResponse.fromJson(data)); | 324 return _response.then((data) => new ListDraftsResponse.fromJson(data)); |
| 316 } | 325 } |
| 317 | 326 |
| 318 /** | 327 /** |
| 319 * Sends the specified, existing draft to the recipients in the To, Cc, and | 328 * Sends the specified, existing draft to the recipients in the To, Cc, and |
| 320 * Bcc headers. | 329 * Bcc headers. |
| 321 * | 330 * |
| 322 * [request] - The metadata request object. | 331 * [request] - The metadata request object. |
| 323 * | 332 * |
| 324 * Request parameters: | 333 * Request parameters: |
| 325 * | 334 * |
| 326 * [userId] - The user's email address. The special value me can be used to | 335 * [userId] - The user's email address. The special value me can be used to |
| 327 * indicate the authenticated user. | 336 * indicate the authenticated user. |
| 328 * | 337 * |
| 329 * [uploadMedia] - The media to upload. | 338 * [uploadMedia] - The media to upload. |
| 330 * | 339 * |
| 331 * [uploadOptions] - Options for the media upload. Streaming Media without the | 340 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 332 * length being known ahead of time is only supported via resumable uploads. | 341 * length being known ahead of time is only supported via resumable uploads. |
| 333 * | 342 * |
| 334 * Completes with a [Message]. | 343 * Completes with a [Message]. |
| 335 * | 344 * |
| 336 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 345 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 337 * error. | 346 * error. |
| 338 * | 347 * |
| 339 * If the used [http.Client] completes with an error when making a REST call, | 348 * If the used [http.Client] completes with an error when making a REST call, |
| 340 * this method will complete with the same error. | 349 * this method will complete with the same error. |
| 341 */ | 350 */ |
| 342 async.Future<Message> send(Draft request, core.String userId, {common.UploadOp
tions uploadOptions : common.UploadOptions.Default, common.Media uploadMedia}) { | 351 async.Future<Message> send(Draft request, core.String userId, {commons.UploadO
ptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}
) { |
| 343 var _url = null; | 352 var _url = null; |
| 344 var _queryParams = new core.Map(); | 353 var _queryParams = new core.Map(); |
| 345 var _uploadMedia = null; | 354 var _uploadMedia = null; |
| 346 var _uploadOptions = null; | 355 var _uploadOptions = null; |
| 347 var _downloadOptions = common.DownloadOptions.Metadata; | 356 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 348 var _body = null; | 357 var _body = null; |
| 349 | 358 |
| 350 if (request != null) { | 359 if (request != null) { |
| 351 _body = convert.JSON.encode((request).toJson()); | 360 _body = convert.JSON.encode((request).toJson()); |
| 352 } | 361 } |
| 353 if (userId == null) { | 362 if (userId == null) { |
| 354 throw new core.ArgumentError("Parameter userId is required."); | 363 throw new core.ArgumentError("Parameter userId is required."); |
| 355 } | 364 } |
| 356 | 365 |
| 357 _uploadMedia = uploadMedia; | 366 _uploadMedia = uploadMedia; |
| 358 _uploadOptions = uploadOptions; | 367 _uploadOptions = uploadOptions; |
| 359 | 368 |
| 360 if (_uploadMedia == null) { | 369 if (_uploadMedia == null) { |
| 361 _url = common_internal.Escaper.ecapeVariable('$userId') + '/drafts/send'; | 370 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/send'; |
| 362 } else if (_uploadOptions is common.ResumableUploadOptions) { | 371 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
| 363 _url = '/resumable/upload/gmail/v1/users/' + common_internal.Escaper.ecape
Variable('$userId') + '/drafts/send'; | 372 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/drafts/send'; |
| 364 } else { | 373 } else { |
| 365 _url = '/upload/gmail/v1/users/' + common_internal.Escaper.ecapeVariable('
$userId') + '/drafts/send'; | 374 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/drafts/send'; |
| 366 } | 375 } |
| 367 | 376 |
| 368 | 377 |
| 369 var _response = _requester.request(_url, | 378 var _response = _requester.request(_url, |
| 370 "POST", | 379 "POST", |
| 371 body: _body, | 380 body: _body, |
| 372 queryParams: _queryParams, | 381 queryParams: _queryParams, |
| 373 uploadOptions: _uploadOptions, | 382 uploadOptions: _uploadOptions, |
| 374 uploadMedia: _uploadMedia, | 383 uploadMedia: _uploadMedia, |
| 375 downloadOptions: _downloadOptions); | 384 downloadOptions: _downloadOptions); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 388 * | 397 * |
| 389 * [id] - The ID of the draft to update. | 398 * [id] - The ID of the draft to update. |
| 390 * | 399 * |
| 391 * [uploadMedia] - The media to upload. | 400 * [uploadMedia] - The media to upload. |
| 392 * | 401 * |
| 393 * [uploadOptions] - Options for the media upload. Streaming Media without the | 402 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 394 * length being known ahead of time is only supported via resumable uploads. | 403 * length being known ahead of time is only supported via resumable uploads. |
| 395 * | 404 * |
| 396 * Completes with a [Draft]. | 405 * Completes with a [Draft]. |
| 397 * | 406 * |
| 398 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 407 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 399 * error. | 408 * error. |
| 400 * | 409 * |
| 401 * If the used [http.Client] completes with an error when making a REST call, | 410 * If the used [http.Client] completes with an error when making a REST call, |
| 402 * this method will complete with the same error. | 411 * this method will complete with the same error. |
| 403 */ | 412 */ |
| 404 async.Future<Draft> update(Draft request, core.String userId, core.String id,
{common.UploadOptions uploadOptions : common.UploadOptions.Default, common.Media
uploadMedia}) { | 413 async.Future<Draft> update(Draft request, core.String userId, core.String id,
{commons.UploadOptions uploadOptions : commons.UploadOptions.Default, commons.Me
dia uploadMedia}) { |
| 405 var _url = null; | 414 var _url = null; |
| 406 var _queryParams = new core.Map(); | 415 var _queryParams = new core.Map(); |
| 407 var _uploadMedia = null; | 416 var _uploadMedia = null; |
| 408 var _uploadOptions = null; | 417 var _uploadOptions = null; |
| 409 var _downloadOptions = common.DownloadOptions.Metadata; | 418 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 410 var _body = null; | 419 var _body = null; |
| 411 | 420 |
| 412 if (request != null) { | 421 if (request != null) { |
| 413 _body = convert.JSON.encode((request).toJson()); | 422 _body = convert.JSON.encode((request).toJson()); |
| 414 } | 423 } |
| 415 if (userId == null) { | 424 if (userId == null) { |
| 416 throw new core.ArgumentError("Parameter userId is required."); | 425 throw new core.ArgumentError("Parameter userId is required."); |
| 417 } | 426 } |
| 418 if (id == null) { | 427 if (id == null) { |
| 419 throw new core.ArgumentError("Parameter id is required."); | 428 throw new core.ArgumentError("Parameter id is required."); |
| 420 } | 429 } |
| 421 | 430 |
| 422 _uploadMedia = uploadMedia; | 431 _uploadMedia = uploadMedia; |
| 423 _uploadOptions = uploadOptions; | 432 _uploadOptions = uploadOptions; |
| 424 | 433 |
| 425 if (_uploadMedia == null) { | 434 if (_uploadMedia == null) { |
| 426 _url = common_internal.Escaper.ecapeVariable('$userId') + '/drafts/' + com
mon_internal.Escaper.ecapeVariable('$id'); | 435 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/' + commons.Esc
aper.ecapeVariable('$id'); |
| 427 } else if (_uploadOptions is common.ResumableUploadOptions) { | 436 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
| 428 _url = '/resumable/upload/gmail/v1/users/' + common_internal.Escaper.ecape
Variable('$userId') + '/drafts/' + common_internal.Escaper.ecapeVariable('$id'); | 437 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/drafts/' + commons.Escaper.ecapeVariable('$id'); |
| 429 } else { | 438 } else { |
| 430 _url = '/upload/gmail/v1/users/' + common_internal.Escaper.ecapeVariable('
$userId') + '/drafts/' + common_internal.Escaper.ecapeVariable('$id'); | 439 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/drafts/' + commons.Escaper.ecapeVariable('$id'); |
| 431 } | 440 } |
| 432 | 441 |
| 433 | 442 |
| 434 var _response = _requester.request(_url, | 443 var _response = _requester.request(_url, |
| 435 "PUT", | 444 "PUT", |
| 436 body: _body, | 445 body: _body, |
| 437 queryParams: _queryParams, | 446 queryParams: _queryParams, |
| 438 uploadOptions: _uploadOptions, | 447 uploadOptions: _uploadOptions, |
| 439 uploadMedia: _uploadMedia, | 448 uploadMedia: _uploadMedia, |
| 440 downloadOptions: _downloadOptions); | 449 downloadOptions: _downloadOptions); |
| 441 return _response.then((data) => new Draft.fromJson(data)); | 450 return _response.then((data) => new Draft.fromJson(data)); |
| 442 } | 451 } |
| 443 | 452 |
| 444 } | 453 } |
| 445 | 454 |
| 446 | 455 |
| 447 /** Not documented yet. */ | |
| 448 class UsersHistoryResourceApi { | 456 class UsersHistoryResourceApi { |
| 449 final common_internal.ApiRequester _requester; | 457 final commons.ApiRequester _requester; |
| 450 | 458 |
| 451 UsersHistoryResourceApi(common_internal.ApiRequester client) : | 459 UsersHistoryResourceApi(commons.ApiRequester client) : |
| 452 _requester = client; | 460 _requester = client; |
| 453 | 461 |
| 454 /** | 462 /** |
| 455 * Lists the history of all changes to the given mailbox. History results are | 463 * Lists the history of all changes to the given mailbox. History results are |
| 456 * returned in chronological order (increasing historyId). | 464 * returned in chronological order (increasing historyId). |
| 457 * | 465 * |
| 458 * Request parameters: | 466 * Request parameters: |
| 459 * | 467 * |
| 460 * [userId] - The user's email address. The special value me can be used to | 468 * [userId] - The user's email address. The special value me can be used to |
| 461 * indicate the authenticated user. | 469 * indicate the authenticated user. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 473 * increase chronologically but are not contiguous with random gaps in between | 481 * increase chronologically but are not contiguous with random gaps in between |
| 474 * valid IDs. Supplying an invalid or out of date startHistoryId typically | 482 * valid IDs. Supplying an invalid or out of date startHistoryId typically |
| 475 * returns an HTTP 404 error code. A historyId is typically valid for at least | 483 * returns an HTTP 404 error code. A historyId is typically valid for at least |
| 476 * a week, but in some circumstances may be valid for only a few hours. If you | 484 * a week, but in some circumstances may be valid for only a few hours. If you |
| 477 * receive an HTTP 404 error response, your application should perform a full | 485 * receive an HTTP 404 error response, your application should perform a full |
| 478 * sync. If you receive no nextPageToken in the response, there are no updates | 486 * sync. If you receive no nextPageToken in the response, there are no updates |
| 479 * to retrieve and you can store the returned historyId for a future request. | 487 * to retrieve and you can store the returned historyId for a future request. |
| 480 * | 488 * |
| 481 * Completes with a [ListHistoryResponse]. | 489 * Completes with a [ListHistoryResponse]. |
| 482 * | 490 * |
| 483 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 491 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 484 * error. | 492 * error. |
| 485 * | 493 * |
| 486 * If the used [http.Client] completes with an error when making a REST call, | 494 * If the used [http.Client] completes with an error when making a REST call, |
| 487 * this method will complete with the same error. | 495 * this method will complete with the same error. |
| 488 */ | 496 */ |
| 489 async.Future<ListHistoryResponse> list(core.String userId, {core.String labelI
d, core.int maxResults, core.String pageToken, core.String startHistoryId}) { | 497 async.Future<ListHistoryResponse> list(core.String userId, {core.String labelI
d, core.int maxResults, core.String pageToken, core.String startHistoryId}) { |
| 490 var _url = null; | 498 var _url = null; |
| 491 var _queryParams = new core.Map(); | 499 var _queryParams = new core.Map(); |
| 492 var _uploadMedia = null; | 500 var _uploadMedia = null; |
| 493 var _uploadOptions = null; | 501 var _uploadOptions = null; |
| 494 var _downloadOptions = common.DownloadOptions.Metadata; | 502 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 495 var _body = null; | 503 var _body = null; |
| 496 | 504 |
| 497 if (userId == null) { | 505 if (userId == null) { |
| 498 throw new core.ArgumentError("Parameter userId is required."); | 506 throw new core.ArgumentError("Parameter userId is required."); |
| 499 } | 507 } |
| 500 if (labelId != null) { | 508 if (labelId != null) { |
| 501 _queryParams["labelId"] = [labelId]; | 509 _queryParams["labelId"] = [labelId]; |
| 502 } | 510 } |
| 503 if (maxResults != null) { | 511 if (maxResults != null) { |
| 504 _queryParams["maxResults"] = ["${maxResults}"]; | 512 _queryParams["maxResults"] = ["${maxResults}"]; |
| 505 } | 513 } |
| 506 if (pageToken != null) { | 514 if (pageToken != null) { |
| 507 _queryParams["pageToken"] = [pageToken]; | 515 _queryParams["pageToken"] = [pageToken]; |
| 508 } | 516 } |
| 509 if (startHistoryId != null) { | 517 if (startHistoryId != null) { |
| 510 _queryParams["startHistoryId"] = [startHistoryId]; | 518 _queryParams["startHistoryId"] = [startHistoryId]; |
| 511 } | 519 } |
| 512 | 520 |
| 513 | 521 |
| 514 _url = common_internal.Escaper.ecapeVariable('$userId') + '/history'; | 522 _url = commons.Escaper.ecapeVariable('$userId') + '/history'; |
| 515 | 523 |
| 516 var _response = _requester.request(_url, | 524 var _response = _requester.request(_url, |
| 517 "GET", | 525 "GET", |
| 518 body: _body, | 526 body: _body, |
| 519 queryParams: _queryParams, | 527 queryParams: _queryParams, |
| 520 uploadOptions: _uploadOptions, | 528 uploadOptions: _uploadOptions, |
| 521 uploadMedia: _uploadMedia, | 529 uploadMedia: _uploadMedia, |
| 522 downloadOptions: _downloadOptions); | 530 downloadOptions: _downloadOptions); |
| 523 return _response.then((data) => new ListHistoryResponse.fromJson(data)); | 531 return _response.then((data) => new ListHistoryResponse.fromJson(data)); |
| 524 } | 532 } |
| 525 | 533 |
| 526 } | 534 } |
| 527 | 535 |
| 528 | 536 |
| 529 /** Not documented yet. */ | |
| 530 class UsersLabelsResourceApi { | 537 class UsersLabelsResourceApi { |
| 531 final common_internal.ApiRequester _requester; | 538 final commons.ApiRequester _requester; |
| 532 | 539 |
| 533 UsersLabelsResourceApi(common_internal.ApiRequester client) : | 540 UsersLabelsResourceApi(commons.ApiRequester client) : |
| 534 _requester = client; | 541 _requester = client; |
| 535 | 542 |
| 536 /** | 543 /** |
| 537 * Creates a new label. | 544 * Creates a new label. |
| 538 * | 545 * |
| 539 * [request] - The metadata request object. | 546 * [request] - The metadata request object. |
| 540 * | 547 * |
| 541 * Request parameters: | 548 * Request parameters: |
| 542 * | 549 * |
| 543 * [userId] - The user's email address. The special value me can be used to | 550 * [userId] - The user's email address. The special value me can be used to |
| 544 * indicate the authenticated user. | 551 * indicate the authenticated user. |
| 545 * | 552 * |
| 546 * Completes with a [Label]. | 553 * Completes with a [Label]. |
| 547 * | 554 * |
| 548 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 555 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 549 * error. | 556 * error. |
| 550 * | 557 * |
| 551 * If the used [http.Client] completes with an error when making a REST call, | 558 * If the used [http.Client] completes with an error when making a REST call, |
| 552 * this method will complete with the same error. | 559 * this method will complete with the same error. |
| 553 */ | 560 */ |
| 554 async.Future<Label> create(Label request, core.String userId) { | 561 async.Future<Label> create(Label request, core.String userId) { |
| 555 var _url = null; | 562 var _url = null; |
| 556 var _queryParams = new core.Map(); | 563 var _queryParams = new core.Map(); |
| 557 var _uploadMedia = null; | 564 var _uploadMedia = null; |
| 558 var _uploadOptions = null; | 565 var _uploadOptions = null; |
| 559 var _downloadOptions = common.DownloadOptions.Metadata; | 566 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 560 var _body = null; | 567 var _body = null; |
| 561 | 568 |
| 562 if (request != null) { | 569 if (request != null) { |
| 563 _body = convert.JSON.encode((request).toJson()); | 570 _body = convert.JSON.encode((request).toJson()); |
| 564 } | 571 } |
| 565 if (userId == null) { | 572 if (userId == null) { |
| 566 throw new core.ArgumentError("Parameter userId is required."); | 573 throw new core.ArgumentError("Parameter userId is required."); |
| 567 } | 574 } |
| 568 | 575 |
| 569 | 576 |
| 570 _url = common_internal.Escaper.ecapeVariable('$userId') + '/labels'; | 577 _url = commons.Escaper.ecapeVariable('$userId') + '/labels'; |
| 571 | 578 |
| 572 var _response = _requester.request(_url, | 579 var _response = _requester.request(_url, |
| 573 "POST", | 580 "POST", |
| 574 body: _body, | 581 body: _body, |
| 575 queryParams: _queryParams, | 582 queryParams: _queryParams, |
| 576 uploadOptions: _uploadOptions, | 583 uploadOptions: _uploadOptions, |
| 577 uploadMedia: _uploadMedia, | 584 uploadMedia: _uploadMedia, |
| 578 downloadOptions: _downloadOptions); | 585 downloadOptions: _downloadOptions); |
| 579 return _response.then((data) => new Label.fromJson(data)); | 586 return _response.then((data) => new Label.fromJson(data)); |
| 580 } | 587 } |
| 581 | 588 |
| 582 /** | 589 /** |
| 583 * Immediately and permanently deletes the specified label and removes it from | 590 * Immediately and permanently deletes the specified label and removes it from |
| 584 * any messages and threads that it is applied to. | 591 * any messages and threads that it is applied to. |
| 585 * | 592 * |
| 586 * Request parameters: | 593 * Request parameters: |
| 587 * | 594 * |
| 588 * [userId] - The user's email address. The special value me can be used to | 595 * [userId] - The user's email address. The special value me can be used to |
| 589 * indicate the authenticated user. | 596 * indicate the authenticated user. |
| 590 * | 597 * |
| 591 * [id] - The ID of the label to delete. | 598 * [id] - The ID of the label to delete. |
| 592 * | 599 * |
| 593 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 600 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 594 * error. | 601 * error. |
| 595 * | 602 * |
| 596 * If the used [http.Client] completes with an error when making a REST call, | 603 * If the used [http.Client] completes with an error when making a REST call, |
| 597 * this method will complete with the same error. | 604 * this method will complete with the same error. |
| 598 */ | 605 */ |
| 599 async.Future delete(core.String userId, core.String id) { | 606 async.Future delete(core.String userId, core.String id) { |
| 600 var _url = null; | 607 var _url = null; |
| 601 var _queryParams = new core.Map(); | 608 var _queryParams = new core.Map(); |
| 602 var _uploadMedia = null; | 609 var _uploadMedia = null; |
| 603 var _uploadOptions = null; | 610 var _uploadOptions = null; |
| 604 var _downloadOptions = common.DownloadOptions.Metadata; | 611 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 605 var _body = null; | 612 var _body = null; |
| 606 | 613 |
| 607 if (userId == null) { | 614 if (userId == null) { |
| 608 throw new core.ArgumentError("Parameter userId is required."); | 615 throw new core.ArgumentError("Parameter userId is required."); |
| 609 } | 616 } |
| 610 if (id == null) { | 617 if (id == null) { |
| 611 throw new core.ArgumentError("Parameter id is required."); | 618 throw new core.ArgumentError("Parameter id is required."); |
| 612 } | 619 } |
| 613 | 620 |
| 614 _downloadOptions = null; | 621 _downloadOptions = null; |
| 615 | 622 |
| 616 _url = common_internal.Escaper.ecapeVariable('$userId') + '/labels/' + commo
n_internal.Escaper.ecapeVariable('$id'); | 623 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); |
| 617 | 624 |
| 618 var _response = _requester.request(_url, | 625 var _response = _requester.request(_url, |
| 619 "DELETE", | 626 "DELETE", |
| 620 body: _body, | 627 body: _body, |
| 621 queryParams: _queryParams, | 628 queryParams: _queryParams, |
| 622 uploadOptions: _uploadOptions, | 629 uploadOptions: _uploadOptions, |
| 623 uploadMedia: _uploadMedia, | 630 uploadMedia: _uploadMedia, |
| 624 downloadOptions: _downloadOptions); | 631 downloadOptions: _downloadOptions); |
| 625 return _response.then((data) => null); | 632 return _response.then((data) => null); |
| 626 } | 633 } |
| 627 | 634 |
| 628 /** | 635 /** |
| 629 * Gets the specified label. | 636 * Gets the specified label. |
| 630 * | 637 * |
| 631 * Request parameters: | 638 * Request parameters: |
| 632 * | 639 * |
| 633 * [userId] - The user's email address. The special value me can be used to | 640 * [userId] - The user's email address. The special value me can be used to |
| 634 * indicate the authenticated user. | 641 * indicate the authenticated user. |
| 635 * | 642 * |
| 636 * [id] - The ID of the label to retrieve. | 643 * [id] - The ID of the label to retrieve. |
| 637 * | 644 * |
| 638 * Completes with a [Label]. | 645 * Completes with a [Label]. |
| 639 * | 646 * |
| 640 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 647 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 641 * error. | 648 * error. |
| 642 * | 649 * |
| 643 * If the used [http.Client] completes with an error when making a REST call, | 650 * If the used [http.Client] completes with an error when making a REST call, |
| 644 * this method will complete with the same error. | 651 * this method will complete with the same error. |
| 645 */ | 652 */ |
| 646 async.Future<Label> get(core.String userId, core.String id) { | 653 async.Future<Label> get(core.String userId, core.String id) { |
| 647 var _url = null; | 654 var _url = null; |
| 648 var _queryParams = new core.Map(); | 655 var _queryParams = new core.Map(); |
| 649 var _uploadMedia = null; | 656 var _uploadMedia = null; |
| 650 var _uploadOptions = null; | 657 var _uploadOptions = null; |
| 651 var _downloadOptions = common.DownloadOptions.Metadata; | 658 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 652 var _body = null; | 659 var _body = null; |
| 653 | 660 |
| 654 if (userId == null) { | 661 if (userId == null) { |
| 655 throw new core.ArgumentError("Parameter userId is required."); | 662 throw new core.ArgumentError("Parameter userId is required."); |
| 656 } | 663 } |
| 657 if (id == null) { | 664 if (id == null) { |
| 658 throw new core.ArgumentError("Parameter id is required."); | 665 throw new core.ArgumentError("Parameter id is required."); |
| 659 } | 666 } |
| 660 | 667 |
| 661 | 668 |
| 662 _url = common_internal.Escaper.ecapeVariable('$userId') + '/labels/' + commo
n_internal.Escaper.ecapeVariable('$id'); | 669 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); |
| 663 | 670 |
| 664 var _response = _requester.request(_url, | 671 var _response = _requester.request(_url, |
| 665 "GET", | 672 "GET", |
| 666 body: _body, | 673 body: _body, |
| 667 queryParams: _queryParams, | 674 queryParams: _queryParams, |
| 668 uploadOptions: _uploadOptions, | 675 uploadOptions: _uploadOptions, |
| 669 uploadMedia: _uploadMedia, | 676 uploadMedia: _uploadMedia, |
| 670 downloadOptions: _downloadOptions); | 677 downloadOptions: _downloadOptions); |
| 671 return _response.then((data) => new Label.fromJson(data)); | 678 return _response.then((data) => new Label.fromJson(data)); |
| 672 } | 679 } |
| 673 | 680 |
| 674 /** | 681 /** |
| 675 * Lists all labels in the user's mailbox. | 682 * Lists all labels in the user's mailbox. |
| 676 * | 683 * |
| 677 * Request parameters: | 684 * Request parameters: |
| 678 * | 685 * |
| 679 * [userId] - The user's email address. The special value me can be used to | 686 * [userId] - The user's email address. The special value me can be used to |
| 680 * indicate the authenticated user. | 687 * indicate the authenticated user. |
| 681 * | 688 * |
| 682 * Completes with a [ListLabelsResponse]. | 689 * Completes with a [ListLabelsResponse]. |
| 683 * | 690 * |
| 684 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 691 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 685 * error. | 692 * error. |
| 686 * | 693 * |
| 687 * If the used [http.Client] completes with an error when making a REST call, | 694 * If the used [http.Client] completes with an error when making a REST call, |
| 688 * this method will complete with the same error. | 695 * this method will complete with the same error. |
| 689 */ | 696 */ |
| 690 async.Future<ListLabelsResponse> list(core.String userId) { | 697 async.Future<ListLabelsResponse> list(core.String userId) { |
| 691 var _url = null; | 698 var _url = null; |
| 692 var _queryParams = new core.Map(); | 699 var _queryParams = new core.Map(); |
| 693 var _uploadMedia = null; | 700 var _uploadMedia = null; |
| 694 var _uploadOptions = null; | 701 var _uploadOptions = null; |
| 695 var _downloadOptions = common.DownloadOptions.Metadata; | 702 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 696 var _body = null; | 703 var _body = null; |
| 697 | 704 |
| 698 if (userId == null) { | 705 if (userId == null) { |
| 699 throw new core.ArgumentError("Parameter userId is required."); | 706 throw new core.ArgumentError("Parameter userId is required."); |
| 700 } | 707 } |
| 701 | 708 |
| 702 | 709 |
| 703 _url = common_internal.Escaper.ecapeVariable('$userId') + '/labels'; | 710 _url = commons.Escaper.ecapeVariable('$userId') + '/labels'; |
| 704 | 711 |
| 705 var _response = _requester.request(_url, | 712 var _response = _requester.request(_url, |
| 706 "GET", | 713 "GET", |
| 707 body: _body, | 714 body: _body, |
| 708 queryParams: _queryParams, | 715 queryParams: _queryParams, |
| 709 uploadOptions: _uploadOptions, | 716 uploadOptions: _uploadOptions, |
| 710 uploadMedia: _uploadMedia, | 717 uploadMedia: _uploadMedia, |
| 711 downloadOptions: _downloadOptions); | 718 downloadOptions: _downloadOptions); |
| 712 return _response.then((data) => new ListLabelsResponse.fromJson(data)); | 719 return _response.then((data) => new ListLabelsResponse.fromJson(data)); |
| 713 } | 720 } |
| 714 | 721 |
| 715 /** | 722 /** |
| 716 * Updates the specified label. This method supports patch semantics. | 723 * Updates the specified label. This method supports patch semantics. |
| 717 * | 724 * |
| 718 * [request] - The metadata request object. | 725 * [request] - The metadata request object. |
| 719 * | 726 * |
| 720 * Request parameters: | 727 * Request parameters: |
| 721 * | 728 * |
| 722 * [userId] - The user's email address. The special value me can be used to | 729 * [userId] - The user's email address. The special value me can be used to |
| 723 * indicate the authenticated user. | 730 * indicate the authenticated user. |
| 724 * | 731 * |
| 725 * [id] - The ID of the label to update. | 732 * [id] - The ID of the label to update. |
| 726 * | 733 * |
| 727 * Completes with a [Label]. | 734 * Completes with a [Label]. |
| 728 * | 735 * |
| 729 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 736 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 730 * error. | 737 * error. |
| 731 * | 738 * |
| 732 * If the used [http.Client] completes with an error when making a REST call, | 739 * If the used [http.Client] completes with an error when making a REST call, |
| 733 * this method will complete with the same error. | 740 * this method will complete with the same error. |
| 734 */ | 741 */ |
| 735 async.Future<Label> patch(Label request, core.String userId, core.String id) { | 742 async.Future<Label> patch(Label request, core.String userId, core.String id) { |
| 736 var _url = null; | 743 var _url = null; |
| 737 var _queryParams = new core.Map(); | 744 var _queryParams = new core.Map(); |
| 738 var _uploadMedia = null; | 745 var _uploadMedia = null; |
| 739 var _uploadOptions = null; | 746 var _uploadOptions = null; |
| 740 var _downloadOptions = common.DownloadOptions.Metadata; | 747 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 741 var _body = null; | 748 var _body = null; |
| 742 | 749 |
| 743 if (request != null) { | 750 if (request != null) { |
| 744 _body = convert.JSON.encode((request).toJson()); | 751 _body = convert.JSON.encode((request).toJson()); |
| 745 } | 752 } |
| 746 if (userId == null) { | 753 if (userId == null) { |
| 747 throw new core.ArgumentError("Parameter userId is required."); | 754 throw new core.ArgumentError("Parameter userId is required."); |
| 748 } | 755 } |
| 749 if (id == null) { | 756 if (id == null) { |
| 750 throw new core.ArgumentError("Parameter id is required."); | 757 throw new core.ArgumentError("Parameter id is required."); |
| 751 } | 758 } |
| 752 | 759 |
| 753 | 760 |
| 754 _url = common_internal.Escaper.ecapeVariable('$userId') + '/labels/' + commo
n_internal.Escaper.ecapeVariable('$id'); | 761 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); |
| 755 | 762 |
| 756 var _response = _requester.request(_url, | 763 var _response = _requester.request(_url, |
| 757 "PATCH", | 764 "PATCH", |
| 758 body: _body, | 765 body: _body, |
| 759 queryParams: _queryParams, | 766 queryParams: _queryParams, |
| 760 uploadOptions: _uploadOptions, | 767 uploadOptions: _uploadOptions, |
| 761 uploadMedia: _uploadMedia, | 768 uploadMedia: _uploadMedia, |
| 762 downloadOptions: _downloadOptions); | 769 downloadOptions: _downloadOptions); |
| 763 return _response.then((data) => new Label.fromJson(data)); | 770 return _response.then((data) => new Label.fromJson(data)); |
| 764 } | 771 } |
| 765 | 772 |
| 766 /** | 773 /** |
| 767 * Updates the specified label. | 774 * Updates the specified label. |
| 768 * | 775 * |
| 769 * [request] - The metadata request object. | 776 * [request] - The metadata request object. |
| 770 * | 777 * |
| 771 * Request parameters: | 778 * Request parameters: |
| 772 * | 779 * |
| 773 * [userId] - The user's email address. The special value me can be used to | 780 * [userId] - The user's email address. The special value me can be used to |
| 774 * indicate the authenticated user. | 781 * indicate the authenticated user. |
| 775 * | 782 * |
| 776 * [id] - The ID of the label to update. | 783 * [id] - The ID of the label to update. |
| 777 * | 784 * |
| 778 * Completes with a [Label]. | 785 * Completes with a [Label]. |
| 779 * | 786 * |
| 780 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 787 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 781 * error. | 788 * error. |
| 782 * | 789 * |
| 783 * If the used [http.Client] completes with an error when making a REST call, | 790 * If the used [http.Client] completes with an error when making a REST call, |
| 784 * this method will complete with the same error. | 791 * this method will complete with the same error. |
| 785 */ | 792 */ |
| 786 async.Future<Label> update(Label request, core.String userId, core.String id)
{ | 793 async.Future<Label> update(Label request, core.String userId, core.String id)
{ |
| 787 var _url = null; | 794 var _url = null; |
| 788 var _queryParams = new core.Map(); | 795 var _queryParams = new core.Map(); |
| 789 var _uploadMedia = null; | 796 var _uploadMedia = null; |
| 790 var _uploadOptions = null; | 797 var _uploadOptions = null; |
| 791 var _downloadOptions = common.DownloadOptions.Metadata; | 798 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 792 var _body = null; | 799 var _body = null; |
| 793 | 800 |
| 794 if (request != null) { | 801 if (request != null) { |
| 795 _body = convert.JSON.encode((request).toJson()); | 802 _body = convert.JSON.encode((request).toJson()); |
| 796 } | 803 } |
| 797 if (userId == null) { | 804 if (userId == null) { |
| 798 throw new core.ArgumentError("Parameter userId is required."); | 805 throw new core.ArgumentError("Parameter userId is required."); |
| 799 } | 806 } |
| 800 if (id == null) { | 807 if (id == null) { |
| 801 throw new core.ArgumentError("Parameter id is required."); | 808 throw new core.ArgumentError("Parameter id is required."); |
| 802 } | 809 } |
| 803 | 810 |
| 804 | 811 |
| 805 _url = common_internal.Escaper.ecapeVariable('$userId') + '/labels/' + commo
n_internal.Escaper.ecapeVariable('$id'); | 812 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); |
| 806 | 813 |
| 807 var _response = _requester.request(_url, | 814 var _response = _requester.request(_url, |
| 808 "PUT", | 815 "PUT", |
| 809 body: _body, | 816 body: _body, |
| 810 queryParams: _queryParams, | 817 queryParams: _queryParams, |
| 811 uploadOptions: _uploadOptions, | 818 uploadOptions: _uploadOptions, |
| 812 uploadMedia: _uploadMedia, | 819 uploadMedia: _uploadMedia, |
| 813 downloadOptions: _downloadOptions); | 820 downloadOptions: _downloadOptions); |
| 814 return _response.then((data) => new Label.fromJson(data)); | 821 return _response.then((data) => new Label.fromJson(data)); |
| 815 } | 822 } |
| 816 | 823 |
| 817 } | 824 } |
| 818 | 825 |
| 819 | 826 |
| 820 /** Not documented yet. */ | |
| 821 class UsersMessagesResourceApi { | 827 class UsersMessagesResourceApi { |
| 822 final common_internal.ApiRequester _requester; | 828 final commons.ApiRequester _requester; |
| 823 | 829 |
| 824 UsersMessagesAttachmentsResourceApi get attachments => new UsersMessagesAttach
mentsResourceApi(_requester); | 830 UsersMessagesAttachmentsResourceApi get attachments => new UsersMessagesAttach
mentsResourceApi(_requester); |
| 825 | 831 |
| 826 UsersMessagesResourceApi(common_internal.ApiRequester client) : | 832 UsersMessagesResourceApi(commons.ApiRequester client) : |
| 827 _requester = client; | 833 _requester = client; |
| 828 | 834 |
| 829 /** | 835 /** |
| 830 * Immediately and permanently deletes the specified message. This operation | 836 * Immediately and permanently deletes the specified message. This operation |
| 831 * cannot be undone. Prefer messages.trash instead. | 837 * cannot be undone. Prefer messages.trash instead. |
| 832 * | 838 * |
| 833 * Request parameters: | 839 * Request parameters: |
| 834 * | 840 * |
| 835 * [userId] - The user's email address. The special value me can be used to | 841 * [userId] - The user's email address. The special value me can be used to |
| 836 * indicate the authenticated user. | 842 * indicate the authenticated user. |
| 837 * | 843 * |
| 838 * [id] - The ID of the message to delete. | 844 * [id] - The ID of the message to delete. |
| 839 * | 845 * |
| 840 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 846 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 841 * error. | 847 * error. |
| 842 * | 848 * |
| 843 * If the used [http.Client] completes with an error when making a REST call, | 849 * If the used [http.Client] completes with an error when making a REST call, |
| 844 * this method will complete with the same error. | 850 * this method will complete with the same error. |
| 845 */ | 851 */ |
| 846 async.Future delete(core.String userId, core.String id) { | 852 async.Future delete(core.String userId, core.String id) { |
| 847 var _url = null; | 853 var _url = null; |
| 848 var _queryParams = new core.Map(); | 854 var _queryParams = new core.Map(); |
| 849 var _uploadMedia = null; | 855 var _uploadMedia = null; |
| 850 var _uploadOptions = null; | 856 var _uploadOptions = null; |
| 851 var _downloadOptions = common.DownloadOptions.Metadata; | 857 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 852 var _body = null; | 858 var _body = null; |
| 853 | 859 |
| 854 if (userId == null) { | 860 if (userId == null) { |
| 855 throw new core.ArgumentError("Parameter userId is required."); | 861 throw new core.ArgumentError("Parameter userId is required."); |
| 856 } | 862 } |
| 857 if (id == null) { | 863 if (id == null) { |
| 858 throw new core.ArgumentError("Parameter id is required."); | 864 throw new core.ArgumentError("Parameter id is required."); |
| 859 } | 865 } |
| 860 | 866 |
| 861 _downloadOptions = null; | 867 _downloadOptions = null; |
| 862 | 868 |
| 863 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/' + com
mon_internal.Escaper.ecapeVariable('$id'); | 869 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id'); |
| 864 | 870 |
| 865 var _response = _requester.request(_url, | 871 var _response = _requester.request(_url, |
| 866 "DELETE", | 872 "DELETE", |
| 867 body: _body, | 873 body: _body, |
| 868 queryParams: _queryParams, | 874 queryParams: _queryParams, |
| 869 uploadOptions: _uploadOptions, | 875 uploadOptions: _uploadOptions, |
| 870 uploadMedia: _uploadMedia, | 876 uploadMedia: _uploadMedia, |
| 871 downloadOptions: _downloadOptions); | 877 downloadOptions: _downloadOptions); |
| 872 return _response.then((data) => null); | 878 return _response.then((data) => null); |
| 873 } | 879 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 887 * - "full" | 893 * - "full" |
| 888 * - "metadata" | 894 * - "metadata" |
| 889 * - "minimal" | 895 * - "minimal" |
| 890 * - "raw" | 896 * - "raw" |
| 891 * | 897 * |
| 892 * [metadataHeaders] - When given and format is METADATA, only include headers | 898 * [metadataHeaders] - When given and format is METADATA, only include headers |
| 893 * specified. | 899 * specified. |
| 894 * | 900 * |
| 895 * Completes with a [Message]. | 901 * Completes with a [Message]. |
| 896 * | 902 * |
| 897 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 903 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 898 * error. | 904 * error. |
| 899 * | 905 * |
| 900 * If the used [http.Client] completes with an error when making a REST call, | 906 * If the used [http.Client] completes with an error when making a REST call, |
| 901 * this method will complete with the same error. | 907 * this method will complete with the same error. |
| 902 */ | 908 */ |
| 903 async.Future<Message> get(core.String userId, core.String id, {core.String for
mat, core.List<core.String> metadataHeaders}) { | 909 async.Future<Message> get(core.String userId, core.String id, {core.String for
mat, core.List<core.String> metadataHeaders}) { |
| 904 var _url = null; | 910 var _url = null; |
| 905 var _queryParams = new core.Map(); | 911 var _queryParams = new core.Map(); |
| 906 var _uploadMedia = null; | 912 var _uploadMedia = null; |
| 907 var _uploadOptions = null; | 913 var _uploadOptions = null; |
| 908 var _downloadOptions = common.DownloadOptions.Metadata; | 914 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 909 var _body = null; | 915 var _body = null; |
| 910 | 916 |
| 911 if (userId == null) { | 917 if (userId == null) { |
| 912 throw new core.ArgumentError("Parameter userId is required."); | 918 throw new core.ArgumentError("Parameter userId is required."); |
| 913 } | 919 } |
| 914 if (id == null) { | 920 if (id == null) { |
| 915 throw new core.ArgumentError("Parameter id is required."); | 921 throw new core.ArgumentError("Parameter id is required."); |
| 916 } | 922 } |
| 917 if (format != null) { | 923 if (format != null) { |
| 918 _queryParams["format"] = [format]; | 924 _queryParams["format"] = [format]; |
| 919 } | 925 } |
| 920 if (metadataHeaders != null) { | 926 if (metadataHeaders != null) { |
| 921 _queryParams["metadataHeaders"] = metadataHeaders; | 927 _queryParams["metadataHeaders"] = metadataHeaders; |
| 922 } | 928 } |
| 923 | 929 |
| 924 | 930 |
| 925 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/' + com
mon_internal.Escaper.ecapeVariable('$id'); | 931 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id'); |
| 926 | 932 |
| 927 var _response = _requester.request(_url, | 933 var _response = _requester.request(_url, |
| 928 "GET", | 934 "GET", |
| 929 body: _body, | 935 body: _body, |
| 930 queryParams: _queryParams, | 936 queryParams: _queryParams, |
| 931 uploadOptions: _uploadOptions, | 937 uploadOptions: _uploadOptions, |
| 932 uploadMedia: _uploadMedia, | 938 uploadMedia: _uploadMedia, |
| 933 downloadOptions: _downloadOptions); | 939 downloadOptions: _downloadOptions); |
| 934 return _response.then((data) => new Message.fromJson(data)); | 940 return _response.then((data) => new Message.fromJson(data)); |
| 935 } | 941 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 961 * [processForCalendar] - Process calendar invites in the email and add any | 967 * [processForCalendar] - Process calendar invites in the email and add any |
| 962 * extracted meetings to the Google Calendar for this user. | 968 * extracted meetings to the Google Calendar for this user. |
| 963 * | 969 * |
| 964 * [uploadMedia] - The media to upload. | 970 * [uploadMedia] - The media to upload. |
| 965 * | 971 * |
| 966 * [uploadOptions] - Options for the media upload. Streaming Media without the | 972 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 967 * length being known ahead of time is only supported via resumable uploads. | 973 * length being known ahead of time is only supported via resumable uploads. |
| 968 * | 974 * |
| 969 * Completes with a [Message]. | 975 * Completes with a [Message]. |
| 970 * | 976 * |
| 971 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 977 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 972 * error. | 978 * error. |
| 973 * | 979 * |
| 974 * If the used [http.Client] completes with an error when making a REST call, | 980 * If the used [http.Client] completes with an error when making a REST call, |
| 975 * this method will complete with the same error. | 981 * this method will complete with the same error. |
| 976 */ | 982 */ |
| 977 async.Future<Message> import(Message request, core.String userId, {core.bool d
eleted, core.String internalDateSource, core.bool neverMarkSpam, core.bool proce
ssForCalendar, common.UploadOptions uploadOptions : common.UploadOptions.Default
, common.Media uploadMedia}) { | 983 async.Future<Message> import(Message request, core.String userId, {core.bool d
eleted, core.String internalDateSource, core.bool neverMarkSpam, core.bool proce
ssForCalendar, commons.UploadOptions uploadOptions : commons.UploadOptions.Defau
lt, commons.Media uploadMedia}) { |
| 978 var _url = null; | 984 var _url = null; |
| 979 var _queryParams = new core.Map(); | 985 var _queryParams = new core.Map(); |
| 980 var _uploadMedia = null; | 986 var _uploadMedia = null; |
| 981 var _uploadOptions = null; | 987 var _uploadOptions = null; |
| 982 var _downloadOptions = common.DownloadOptions.Metadata; | 988 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 983 var _body = null; | 989 var _body = null; |
| 984 | 990 |
| 985 if (request != null) { | 991 if (request != null) { |
| 986 _body = convert.JSON.encode((request).toJson()); | 992 _body = convert.JSON.encode((request).toJson()); |
| 987 } | 993 } |
| 988 if (userId == null) { | 994 if (userId == null) { |
| 989 throw new core.ArgumentError("Parameter userId is required."); | 995 throw new core.ArgumentError("Parameter userId is required."); |
| 990 } | 996 } |
| 991 if (deleted != null) { | 997 if (deleted != null) { |
| 992 _queryParams["deleted"] = ["${deleted}"]; | 998 _queryParams["deleted"] = ["${deleted}"]; |
| 993 } | 999 } |
| 994 if (internalDateSource != null) { | 1000 if (internalDateSource != null) { |
| 995 _queryParams["internalDateSource"] = [internalDateSource]; | 1001 _queryParams["internalDateSource"] = [internalDateSource]; |
| 996 } | 1002 } |
| 997 if (neverMarkSpam != null) { | 1003 if (neverMarkSpam != null) { |
| 998 _queryParams["neverMarkSpam"] = ["${neverMarkSpam}"]; | 1004 _queryParams["neverMarkSpam"] = ["${neverMarkSpam}"]; |
| 999 } | 1005 } |
| 1000 if (processForCalendar != null) { | 1006 if (processForCalendar != null) { |
| 1001 _queryParams["processForCalendar"] = ["${processForCalendar}"]; | 1007 _queryParams["processForCalendar"] = ["${processForCalendar}"]; |
| 1002 } | 1008 } |
| 1003 | 1009 |
| 1004 _uploadMedia = uploadMedia; | 1010 _uploadMedia = uploadMedia; |
| 1005 _uploadOptions = uploadOptions; | 1011 _uploadOptions = uploadOptions; |
| 1006 | 1012 |
| 1007 if (_uploadMedia == null) { | 1013 if (_uploadMedia == null) { |
| 1008 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/impor
t'; | 1014 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/import'; |
| 1009 } else if (_uploadOptions is common.ResumableUploadOptions) { | 1015 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
| 1010 _url = '/resumable/upload/gmail/v1/users/' + common_internal.Escaper.ecape
Variable('$userId') + '/messages/import'; | 1016 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/messages/import'; |
| 1011 } else { | 1017 } else { |
| 1012 _url = '/upload/gmail/v1/users/' + common_internal.Escaper.ecapeVariable('
$userId') + '/messages/import'; | 1018 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/messages/import'; |
| 1013 } | 1019 } |
| 1014 | 1020 |
| 1015 | 1021 |
| 1016 var _response = _requester.request(_url, | 1022 var _response = _requester.request(_url, |
| 1017 "POST", | 1023 "POST", |
| 1018 body: _body, | 1024 body: _body, |
| 1019 queryParams: _queryParams, | 1025 queryParams: _queryParams, |
| 1020 uploadOptions: _uploadOptions, | 1026 uploadOptions: _uploadOptions, |
| 1021 uploadMedia: _uploadMedia, | 1027 uploadMedia: _uploadMedia, |
| 1022 downloadOptions: _downloadOptions); | 1028 downloadOptions: _downloadOptions); |
| 1023 return _response.then((data) => new Message.fromJson(data)); | 1029 return _response.then((data) => new Message.fromJson(data)); |
| 1024 } | 1030 } |
| 1025 | 1031 |
| 1026 /** | 1032 /** |
| 1027 * Directly inserts a message into only this user's mailbox similar to IMAP | 1033 * Directly inserts a message into only this user's mailbox similar to IMAP |
| 1028 * APPEND, bypassing most scanning and classification. Does not send a | 1034 * APPEND, bypassing most scanning and classification. Does not send a |
| 1029 * message. | 1035 * message. |
| 1030 * | 1036 * |
| 1031 * [request] - The metadata request object. | 1037 * [request] - The metadata request object. |
| 1032 * | 1038 * |
| 1033 * Request parameters: | 1039 * Request parameters: |
| 1034 * | 1040 * |
| 1035 * [userId] - The user's email address. The special value me can be used to | 1041 * [userId] - The user's email address. The special value me can be used to |
| 1036 * indicate the authenticated user. | 1042 * indicate the authenticated user. |
| 1037 * | 1043 * |
| 1044 * [deleted] - Mark the email as permanently deleted (not TRASH) and only |
| 1045 * visible in Google Apps Vault to a Vault administrator. Only used for Google |
| 1046 * Apps for Work accounts. |
| 1047 * |
| 1038 * [internalDateSource] - Source for Gmail's internal date of the message. | 1048 * [internalDateSource] - Source for Gmail's internal date of the message. |
| 1039 * Possible string values are: | 1049 * Possible string values are: |
| 1040 * - "dateHeader" | 1050 * - "dateHeader" |
| 1041 * - "receivedTime" | 1051 * - "receivedTime" |
| 1042 * | 1052 * |
| 1043 * [uploadMedia] - The media to upload. | 1053 * [uploadMedia] - The media to upload. |
| 1044 * | 1054 * |
| 1045 * [uploadOptions] - Options for the media upload. Streaming Media without the | 1055 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 1046 * length being known ahead of time is only supported via resumable uploads. | 1056 * length being known ahead of time is only supported via resumable uploads. |
| 1047 * | 1057 * |
| 1048 * Completes with a [Message]. | 1058 * Completes with a [Message]. |
| 1049 * | 1059 * |
| 1050 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1060 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1051 * error. | 1061 * error. |
| 1052 * | 1062 * |
| 1053 * If the used [http.Client] completes with an error when making a REST call, | 1063 * If the used [http.Client] completes with an error when making a REST call, |
| 1054 * this method will complete with the same error. | 1064 * this method will complete with the same error. |
| 1055 */ | 1065 */ |
| 1056 async.Future<Message> insert(Message request, core.String userId, {core.String
internalDateSource, common.UploadOptions uploadOptions : common.UploadOptions.D
efault, common.Media uploadMedia}) { | 1066 async.Future<Message> insert(Message request, core.String userId, {core.bool d
eleted, core.String internalDateSource, commons.UploadOptions uploadOptions : co
mmons.UploadOptions.Default, commons.Media uploadMedia}) { |
| 1057 var _url = null; | 1067 var _url = null; |
| 1058 var _queryParams = new core.Map(); | 1068 var _queryParams = new core.Map(); |
| 1059 var _uploadMedia = null; | 1069 var _uploadMedia = null; |
| 1060 var _uploadOptions = null; | 1070 var _uploadOptions = null; |
| 1061 var _downloadOptions = common.DownloadOptions.Metadata; | 1071 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1062 var _body = null; | 1072 var _body = null; |
| 1063 | 1073 |
| 1064 if (request != null) { | 1074 if (request != null) { |
| 1065 _body = convert.JSON.encode((request).toJson()); | 1075 _body = convert.JSON.encode((request).toJson()); |
| 1066 } | 1076 } |
| 1067 if (userId == null) { | 1077 if (userId == null) { |
| 1068 throw new core.ArgumentError("Parameter userId is required."); | 1078 throw new core.ArgumentError("Parameter userId is required."); |
| 1069 } | 1079 } |
| 1080 if (deleted != null) { |
| 1081 _queryParams["deleted"] = ["${deleted}"]; |
| 1082 } |
| 1070 if (internalDateSource != null) { | 1083 if (internalDateSource != null) { |
| 1071 _queryParams["internalDateSource"] = [internalDateSource]; | 1084 _queryParams["internalDateSource"] = [internalDateSource]; |
| 1072 } | 1085 } |
| 1073 | 1086 |
| 1074 _uploadMedia = uploadMedia; | 1087 _uploadMedia = uploadMedia; |
| 1075 _uploadOptions = uploadOptions; | 1088 _uploadOptions = uploadOptions; |
| 1076 | 1089 |
| 1077 if (_uploadMedia == null) { | 1090 if (_uploadMedia == null) { |
| 1078 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages'; | 1091 _url = commons.Escaper.ecapeVariable('$userId') + '/messages'; |
| 1079 } else if (_uploadOptions is common.ResumableUploadOptions) { | 1092 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
| 1080 _url = '/resumable/upload/gmail/v1/users/' + common_internal.Escaper.ecape
Variable('$userId') + '/messages'; | 1093 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/messages'; |
| 1081 } else { | 1094 } else { |
| 1082 _url = '/upload/gmail/v1/users/' + common_internal.Escaper.ecapeVariable('
$userId') + '/messages'; | 1095 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/messages'; |
| 1083 } | 1096 } |
| 1084 | 1097 |
| 1085 | 1098 |
| 1086 var _response = _requester.request(_url, | 1099 var _response = _requester.request(_url, |
| 1087 "POST", | 1100 "POST", |
| 1088 body: _body, | 1101 body: _body, |
| 1089 queryParams: _queryParams, | 1102 queryParams: _queryParams, |
| 1090 uploadOptions: _uploadOptions, | 1103 uploadOptions: _uploadOptions, |
| 1091 uploadMedia: _uploadMedia, | 1104 uploadMedia: _uploadMedia, |
| 1092 downloadOptions: _downloadOptions); | 1105 downloadOptions: _downloadOptions); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1110 * | 1123 * |
| 1111 * [pageToken] - Page token to retrieve a specific page of results in the | 1124 * [pageToken] - Page token to retrieve a specific page of results in the |
| 1112 * list. | 1125 * list. |
| 1113 * | 1126 * |
| 1114 * [q] - Only return messages matching the specified query. Supports the same | 1127 * [q] - Only return messages matching the specified query. Supports the same |
| 1115 * query format as the Gmail search box. For example, | 1128 * query format as the Gmail search box. For example, |
| 1116 * "from:someuser@example.com rfc822msgid: is:unread". | 1129 * "from:someuser@example.com rfc822msgid: is:unread". |
| 1117 * | 1130 * |
| 1118 * Completes with a [ListMessagesResponse]. | 1131 * Completes with a [ListMessagesResponse]. |
| 1119 * | 1132 * |
| 1120 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1133 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1121 * error. | 1134 * error. |
| 1122 * | 1135 * |
| 1123 * If the used [http.Client] completes with an error when making a REST call, | 1136 * If the used [http.Client] completes with an error when making a REST call, |
| 1124 * this method will complete with the same error. | 1137 * this method will complete with the same error. |
| 1125 */ | 1138 */ |
| 1126 async.Future<ListMessagesResponse> list(core.String userId, {core.bool include
SpamTrash, core.List<core.String> labelIds, core.int maxResults, core.String pag
eToken, core.String q}) { | 1139 async.Future<ListMessagesResponse> list(core.String userId, {core.bool include
SpamTrash, core.List<core.String> labelIds, core.int maxResults, core.String pag
eToken, core.String q}) { |
| 1127 var _url = null; | 1140 var _url = null; |
| 1128 var _queryParams = new core.Map(); | 1141 var _queryParams = new core.Map(); |
| 1129 var _uploadMedia = null; | 1142 var _uploadMedia = null; |
| 1130 var _uploadOptions = null; | 1143 var _uploadOptions = null; |
| 1131 var _downloadOptions = common.DownloadOptions.Metadata; | 1144 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1132 var _body = null; | 1145 var _body = null; |
| 1133 | 1146 |
| 1134 if (userId == null) { | 1147 if (userId == null) { |
| 1135 throw new core.ArgumentError("Parameter userId is required."); | 1148 throw new core.ArgumentError("Parameter userId is required."); |
| 1136 } | 1149 } |
| 1137 if (includeSpamTrash != null) { | 1150 if (includeSpamTrash != null) { |
| 1138 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; | 1151 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; |
| 1139 } | 1152 } |
| 1140 if (labelIds != null) { | 1153 if (labelIds != null) { |
| 1141 _queryParams["labelIds"] = labelIds; | 1154 _queryParams["labelIds"] = labelIds; |
| 1142 } | 1155 } |
| 1143 if (maxResults != null) { | 1156 if (maxResults != null) { |
| 1144 _queryParams["maxResults"] = ["${maxResults}"]; | 1157 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1145 } | 1158 } |
| 1146 if (pageToken != null) { | 1159 if (pageToken != null) { |
| 1147 _queryParams["pageToken"] = [pageToken]; | 1160 _queryParams["pageToken"] = [pageToken]; |
| 1148 } | 1161 } |
| 1149 if (q != null) { | 1162 if (q != null) { |
| 1150 _queryParams["q"] = [q]; | 1163 _queryParams["q"] = [q]; |
| 1151 } | 1164 } |
| 1152 | 1165 |
| 1153 | 1166 |
| 1154 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages'; | 1167 _url = commons.Escaper.ecapeVariable('$userId') + '/messages'; |
| 1155 | 1168 |
| 1156 var _response = _requester.request(_url, | 1169 var _response = _requester.request(_url, |
| 1157 "GET", | 1170 "GET", |
| 1158 body: _body, | 1171 body: _body, |
| 1159 queryParams: _queryParams, | 1172 queryParams: _queryParams, |
| 1160 uploadOptions: _uploadOptions, | 1173 uploadOptions: _uploadOptions, |
| 1161 uploadMedia: _uploadMedia, | 1174 uploadMedia: _uploadMedia, |
| 1162 downloadOptions: _downloadOptions); | 1175 downloadOptions: _downloadOptions); |
| 1163 return _response.then((data) => new ListMessagesResponse.fromJson(data)); | 1176 return _response.then((data) => new ListMessagesResponse.fromJson(data)); |
| 1164 } | 1177 } |
| 1165 | 1178 |
| 1166 /** | 1179 /** |
| 1167 * Modifies the labels on the specified message. | 1180 * Modifies the labels on the specified message. |
| 1168 * | 1181 * |
| 1169 * [request] - The metadata request object. | 1182 * [request] - The metadata request object. |
| 1170 * | 1183 * |
| 1171 * Request parameters: | 1184 * Request parameters: |
| 1172 * | 1185 * |
| 1173 * [userId] - The user's email address. The special value me can be used to | 1186 * [userId] - The user's email address. The special value me can be used to |
| 1174 * indicate the authenticated user. | 1187 * indicate the authenticated user. |
| 1175 * | 1188 * |
| 1176 * [id] - The ID of the message to modify. | 1189 * [id] - The ID of the message to modify. |
| 1177 * | 1190 * |
| 1178 * Completes with a [Message]. | 1191 * Completes with a [Message]. |
| 1179 * | 1192 * |
| 1180 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1193 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1181 * error. | 1194 * error. |
| 1182 * | 1195 * |
| 1183 * If the used [http.Client] completes with an error when making a REST call, | 1196 * If the used [http.Client] completes with an error when making a REST call, |
| 1184 * this method will complete with the same error. | 1197 * this method will complete with the same error. |
| 1185 */ | 1198 */ |
| 1186 async.Future<Message> modify(ModifyMessageRequest request, core.String userId,
core.String id) { | 1199 async.Future<Message> modify(ModifyMessageRequest request, core.String userId,
core.String id) { |
| 1187 var _url = null; | 1200 var _url = null; |
| 1188 var _queryParams = new core.Map(); | 1201 var _queryParams = new core.Map(); |
| 1189 var _uploadMedia = null; | 1202 var _uploadMedia = null; |
| 1190 var _uploadOptions = null; | 1203 var _uploadOptions = null; |
| 1191 var _downloadOptions = common.DownloadOptions.Metadata; | 1204 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1192 var _body = null; | 1205 var _body = null; |
| 1193 | 1206 |
| 1194 if (request != null) { | 1207 if (request != null) { |
| 1195 _body = convert.JSON.encode((request).toJson()); | 1208 _body = convert.JSON.encode((request).toJson()); |
| 1196 } | 1209 } |
| 1197 if (userId == null) { | 1210 if (userId == null) { |
| 1198 throw new core.ArgumentError("Parameter userId is required."); | 1211 throw new core.ArgumentError("Parameter userId is required."); |
| 1199 } | 1212 } |
| 1200 if (id == null) { | 1213 if (id == null) { |
| 1201 throw new core.ArgumentError("Parameter id is required."); | 1214 throw new core.ArgumentError("Parameter id is required."); |
| 1202 } | 1215 } |
| 1203 | 1216 |
| 1204 | 1217 |
| 1205 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/' + com
mon_internal.Escaper.ecapeVariable('$id') + '/modify'; | 1218 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id') + '/modify'; |
| 1206 | 1219 |
| 1207 var _response = _requester.request(_url, | 1220 var _response = _requester.request(_url, |
| 1208 "POST", | 1221 "POST", |
| 1209 body: _body, | 1222 body: _body, |
| 1210 queryParams: _queryParams, | 1223 queryParams: _queryParams, |
| 1211 uploadOptions: _uploadOptions, | 1224 uploadOptions: _uploadOptions, |
| 1212 uploadMedia: _uploadMedia, | 1225 uploadMedia: _uploadMedia, |
| 1213 downloadOptions: _downloadOptions); | 1226 downloadOptions: _downloadOptions); |
| 1214 return _response.then((data) => new Message.fromJson(data)); | 1227 return _response.then((data) => new Message.fromJson(data)); |
| 1215 } | 1228 } |
| 1216 | 1229 |
| 1217 /** | 1230 /** |
| 1218 * Sends the specified message to the recipients in the To, Cc, and Bcc | 1231 * Sends the specified message to the recipients in the To, Cc, and Bcc |
| 1219 * headers. | 1232 * headers. |
| 1220 * | 1233 * |
| 1221 * [request] - The metadata request object. | 1234 * [request] - The metadata request object. |
| 1222 * | 1235 * |
| 1223 * Request parameters: | 1236 * Request parameters: |
| 1224 * | 1237 * |
| 1225 * [userId] - The user's email address. The special value me can be used to | 1238 * [userId] - The user's email address. The special value me can be used to |
| 1226 * indicate the authenticated user. | 1239 * indicate the authenticated user. |
| 1227 * | 1240 * |
| 1228 * [uploadMedia] - The media to upload. | 1241 * [uploadMedia] - The media to upload. |
| 1229 * | 1242 * |
| 1230 * [uploadOptions] - Options for the media upload. Streaming Media without the | 1243 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 1231 * length being known ahead of time is only supported via resumable uploads. | 1244 * length being known ahead of time is only supported via resumable uploads. |
| 1232 * | 1245 * |
| 1233 * Completes with a [Message]. | 1246 * Completes with a [Message]. |
| 1234 * | 1247 * |
| 1235 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1248 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1236 * error. | 1249 * error. |
| 1237 * | 1250 * |
| 1238 * If the used [http.Client] completes with an error when making a REST call, | 1251 * If the used [http.Client] completes with an error when making a REST call, |
| 1239 * this method will complete with the same error. | 1252 * this method will complete with the same error. |
| 1240 */ | 1253 */ |
| 1241 async.Future<Message> send(Message request, core.String userId, {common.Upload
Options uploadOptions : common.UploadOptions.Default, common.Media uploadMedia})
{ | 1254 async.Future<Message> send(Message request, core.String userId, {commons.Uploa
dOptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedi
a}) { |
| 1242 var _url = null; | 1255 var _url = null; |
| 1243 var _queryParams = new core.Map(); | 1256 var _queryParams = new core.Map(); |
| 1244 var _uploadMedia = null; | 1257 var _uploadMedia = null; |
| 1245 var _uploadOptions = null; | 1258 var _uploadOptions = null; |
| 1246 var _downloadOptions = common.DownloadOptions.Metadata; | 1259 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1247 var _body = null; | 1260 var _body = null; |
| 1248 | 1261 |
| 1249 if (request != null) { | 1262 if (request != null) { |
| 1250 _body = convert.JSON.encode((request).toJson()); | 1263 _body = convert.JSON.encode((request).toJson()); |
| 1251 } | 1264 } |
| 1252 if (userId == null) { | 1265 if (userId == null) { |
| 1253 throw new core.ArgumentError("Parameter userId is required."); | 1266 throw new core.ArgumentError("Parameter userId is required."); |
| 1254 } | 1267 } |
| 1255 | 1268 |
| 1256 _uploadMedia = uploadMedia; | 1269 _uploadMedia = uploadMedia; |
| 1257 _uploadOptions = uploadOptions; | 1270 _uploadOptions = uploadOptions; |
| 1258 | 1271 |
| 1259 if (_uploadMedia == null) { | 1272 if (_uploadMedia == null) { |
| 1260 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/send'
; | 1273 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/send'; |
| 1261 } else if (_uploadOptions is common.ResumableUploadOptions) { | 1274 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
| 1262 _url = '/resumable/upload/gmail/v1/users/' + common_internal.Escaper.ecape
Variable('$userId') + '/messages/send'; | 1275 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/messages/send'; |
| 1263 } else { | 1276 } else { |
| 1264 _url = '/upload/gmail/v1/users/' + common_internal.Escaper.ecapeVariable('
$userId') + '/messages/send'; | 1277 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/messages/send'; |
| 1265 } | 1278 } |
| 1266 | 1279 |
| 1267 | 1280 |
| 1268 var _response = _requester.request(_url, | 1281 var _response = _requester.request(_url, |
| 1269 "POST", | 1282 "POST", |
| 1270 body: _body, | 1283 body: _body, |
| 1271 queryParams: _queryParams, | 1284 queryParams: _queryParams, |
| 1272 uploadOptions: _uploadOptions, | 1285 uploadOptions: _uploadOptions, |
| 1273 uploadMedia: _uploadMedia, | 1286 uploadMedia: _uploadMedia, |
| 1274 downloadOptions: _downloadOptions); | 1287 downloadOptions: _downloadOptions); |
| 1275 return _response.then((data) => new Message.fromJson(data)); | 1288 return _response.then((data) => new Message.fromJson(data)); |
| 1276 } | 1289 } |
| 1277 | 1290 |
| 1278 /** | 1291 /** |
| 1279 * Moves the specified message to the trash. | 1292 * Moves the specified message to the trash. |
| 1280 * | 1293 * |
| 1281 * Request parameters: | 1294 * Request parameters: |
| 1282 * | 1295 * |
| 1283 * [userId] - The user's email address. The special value me can be used to | 1296 * [userId] - The user's email address. The special value me can be used to |
| 1284 * indicate the authenticated user. | 1297 * indicate the authenticated user. |
| 1285 * | 1298 * |
| 1286 * [id] - The ID of the message to Trash. | 1299 * [id] - The ID of the message to Trash. |
| 1287 * | 1300 * |
| 1288 * Completes with a [Message]. | 1301 * Completes with a [Message]. |
| 1289 * | 1302 * |
| 1290 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1303 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1291 * error. | 1304 * error. |
| 1292 * | 1305 * |
| 1293 * If the used [http.Client] completes with an error when making a REST call, | 1306 * If the used [http.Client] completes with an error when making a REST call, |
| 1294 * this method will complete with the same error. | 1307 * this method will complete with the same error. |
| 1295 */ | 1308 */ |
| 1296 async.Future<Message> trash(core.String userId, core.String id) { | 1309 async.Future<Message> trash(core.String userId, core.String id) { |
| 1297 var _url = null; | 1310 var _url = null; |
| 1298 var _queryParams = new core.Map(); | 1311 var _queryParams = new core.Map(); |
| 1299 var _uploadMedia = null; | 1312 var _uploadMedia = null; |
| 1300 var _uploadOptions = null; | 1313 var _uploadOptions = null; |
| 1301 var _downloadOptions = common.DownloadOptions.Metadata; | 1314 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1302 var _body = null; | 1315 var _body = null; |
| 1303 | 1316 |
| 1304 if (userId == null) { | 1317 if (userId == null) { |
| 1305 throw new core.ArgumentError("Parameter userId is required."); | 1318 throw new core.ArgumentError("Parameter userId is required."); |
| 1306 } | 1319 } |
| 1307 if (id == null) { | 1320 if (id == null) { |
| 1308 throw new core.ArgumentError("Parameter id is required."); | 1321 throw new core.ArgumentError("Parameter id is required."); |
| 1309 } | 1322 } |
| 1310 | 1323 |
| 1311 | 1324 |
| 1312 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/' + com
mon_internal.Escaper.ecapeVariable('$id') + '/trash'; | 1325 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id') + '/trash'; |
| 1313 | 1326 |
| 1314 var _response = _requester.request(_url, | 1327 var _response = _requester.request(_url, |
| 1315 "POST", | 1328 "POST", |
| 1316 body: _body, | 1329 body: _body, |
| 1317 queryParams: _queryParams, | 1330 queryParams: _queryParams, |
| 1318 uploadOptions: _uploadOptions, | 1331 uploadOptions: _uploadOptions, |
| 1319 uploadMedia: _uploadMedia, | 1332 uploadMedia: _uploadMedia, |
| 1320 downloadOptions: _downloadOptions); | 1333 downloadOptions: _downloadOptions); |
| 1321 return _response.then((data) => new Message.fromJson(data)); | 1334 return _response.then((data) => new Message.fromJson(data)); |
| 1322 } | 1335 } |
| 1323 | 1336 |
| 1324 /** | 1337 /** |
| 1325 * Removes the specified message from the trash. | 1338 * Removes the specified message from the trash. |
| 1326 * | 1339 * |
| 1327 * Request parameters: | 1340 * Request parameters: |
| 1328 * | 1341 * |
| 1329 * [userId] - The user's email address. The special value me can be used to | 1342 * [userId] - The user's email address. The special value me can be used to |
| 1330 * indicate the authenticated user. | 1343 * indicate the authenticated user. |
| 1331 * | 1344 * |
| 1332 * [id] - The ID of the message to remove from Trash. | 1345 * [id] - The ID of the message to remove from Trash. |
| 1333 * | 1346 * |
| 1334 * Completes with a [Message]. | 1347 * Completes with a [Message]. |
| 1335 * | 1348 * |
| 1336 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1349 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1337 * error. | 1350 * error. |
| 1338 * | 1351 * |
| 1339 * If the used [http.Client] completes with an error when making a REST call, | 1352 * If the used [http.Client] completes with an error when making a REST call, |
| 1340 * this method will complete with the same error. | 1353 * this method will complete with the same error. |
| 1341 */ | 1354 */ |
| 1342 async.Future<Message> untrash(core.String userId, core.String id) { | 1355 async.Future<Message> untrash(core.String userId, core.String id) { |
| 1343 var _url = null; | 1356 var _url = null; |
| 1344 var _queryParams = new core.Map(); | 1357 var _queryParams = new core.Map(); |
| 1345 var _uploadMedia = null; | 1358 var _uploadMedia = null; |
| 1346 var _uploadOptions = null; | 1359 var _uploadOptions = null; |
| 1347 var _downloadOptions = common.DownloadOptions.Metadata; | 1360 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1348 var _body = null; | 1361 var _body = null; |
| 1349 | 1362 |
| 1350 if (userId == null) { | 1363 if (userId == null) { |
| 1351 throw new core.ArgumentError("Parameter userId is required."); | 1364 throw new core.ArgumentError("Parameter userId is required."); |
| 1352 } | 1365 } |
| 1353 if (id == null) { | 1366 if (id == null) { |
| 1354 throw new core.ArgumentError("Parameter id is required."); | 1367 throw new core.ArgumentError("Parameter id is required."); |
| 1355 } | 1368 } |
| 1356 | 1369 |
| 1357 | 1370 |
| 1358 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/' + com
mon_internal.Escaper.ecapeVariable('$id') + '/untrash'; | 1371 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id') + '/untrash'; |
| 1359 | 1372 |
| 1360 var _response = _requester.request(_url, | 1373 var _response = _requester.request(_url, |
| 1361 "POST", | 1374 "POST", |
| 1362 body: _body, | 1375 body: _body, |
| 1363 queryParams: _queryParams, | 1376 queryParams: _queryParams, |
| 1364 uploadOptions: _uploadOptions, | 1377 uploadOptions: _uploadOptions, |
| 1365 uploadMedia: _uploadMedia, | 1378 uploadMedia: _uploadMedia, |
| 1366 downloadOptions: _downloadOptions); | 1379 downloadOptions: _downloadOptions); |
| 1367 return _response.then((data) => new Message.fromJson(data)); | 1380 return _response.then((data) => new Message.fromJson(data)); |
| 1368 } | 1381 } |
| 1369 | 1382 |
| 1370 } | 1383 } |
| 1371 | 1384 |
| 1372 | 1385 |
| 1373 /** Not documented yet. */ | |
| 1374 class UsersMessagesAttachmentsResourceApi { | 1386 class UsersMessagesAttachmentsResourceApi { |
| 1375 final common_internal.ApiRequester _requester; | 1387 final commons.ApiRequester _requester; |
| 1376 | 1388 |
| 1377 UsersMessagesAttachmentsResourceApi(common_internal.ApiRequester client) : | 1389 UsersMessagesAttachmentsResourceApi(commons.ApiRequester client) : |
| 1378 _requester = client; | 1390 _requester = client; |
| 1379 | 1391 |
| 1380 /** | 1392 /** |
| 1381 * Gets the specified message attachment. | 1393 * Gets the specified message attachment. |
| 1382 * | 1394 * |
| 1383 * Request parameters: | 1395 * Request parameters: |
| 1384 * | 1396 * |
| 1385 * [userId] - The user's email address. The special value me can be used to | 1397 * [userId] - The user's email address. The special value me can be used to |
| 1386 * indicate the authenticated user. | 1398 * indicate the authenticated user. |
| 1387 * | 1399 * |
| 1388 * [messageId] - The ID of the message containing the attachment. | 1400 * [messageId] - The ID of the message containing the attachment. |
| 1389 * | 1401 * |
| 1390 * [id] - The ID of the attachment. | 1402 * [id] - The ID of the attachment. |
| 1391 * | 1403 * |
| 1392 * Completes with a [MessagePartBody]. | 1404 * Completes with a [MessagePartBody]. |
| 1393 * | 1405 * |
| 1394 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1406 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1395 * error. | 1407 * error. |
| 1396 * | 1408 * |
| 1397 * If the used [http.Client] completes with an error when making a REST call, | 1409 * If the used [http.Client] completes with an error when making a REST call, |
| 1398 * this method will complete with the same error. | 1410 * this method will complete with the same error. |
| 1399 */ | 1411 */ |
| 1400 async.Future<MessagePartBody> get(core.String userId, core.String messageId, c
ore.String id) { | 1412 async.Future<MessagePartBody> get(core.String userId, core.String messageId, c
ore.String id) { |
| 1401 var _url = null; | 1413 var _url = null; |
| 1402 var _queryParams = new core.Map(); | 1414 var _queryParams = new core.Map(); |
| 1403 var _uploadMedia = null; | 1415 var _uploadMedia = null; |
| 1404 var _uploadOptions = null; | 1416 var _uploadOptions = null; |
| 1405 var _downloadOptions = common.DownloadOptions.Metadata; | 1417 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1406 var _body = null; | 1418 var _body = null; |
| 1407 | 1419 |
| 1408 if (userId == null) { | 1420 if (userId == null) { |
| 1409 throw new core.ArgumentError("Parameter userId is required."); | 1421 throw new core.ArgumentError("Parameter userId is required."); |
| 1410 } | 1422 } |
| 1411 if (messageId == null) { | 1423 if (messageId == null) { |
| 1412 throw new core.ArgumentError("Parameter messageId is required."); | 1424 throw new core.ArgumentError("Parameter messageId is required."); |
| 1413 } | 1425 } |
| 1414 if (id == null) { | 1426 if (id == null) { |
| 1415 throw new core.ArgumentError("Parameter id is required."); | 1427 throw new core.ArgumentError("Parameter id is required."); |
| 1416 } | 1428 } |
| 1417 | 1429 |
| 1418 | 1430 |
| 1419 _url = common_internal.Escaper.ecapeVariable('$userId') + '/messages/' + com
mon_internal.Escaper.ecapeVariable('$messageId') + '/attachments/' + common_inte
rnal.Escaper.ecapeVariable('$id'); | 1431 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$messageId') + '/attachments/' + commons.Escaper.ecapeVariab
le('$id'); |
| 1420 | 1432 |
| 1421 var _response = _requester.request(_url, | 1433 var _response = _requester.request(_url, |
| 1422 "GET", | 1434 "GET", |
| 1423 body: _body, | 1435 body: _body, |
| 1424 queryParams: _queryParams, | 1436 queryParams: _queryParams, |
| 1425 uploadOptions: _uploadOptions, | 1437 uploadOptions: _uploadOptions, |
| 1426 uploadMedia: _uploadMedia, | 1438 uploadMedia: _uploadMedia, |
| 1427 downloadOptions: _downloadOptions); | 1439 downloadOptions: _downloadOptions); |
| 1428 return _response.then((data) => new MessagePartBody.fromJson(data)); | 1440 return _response.then((data) => new MessagePartBody.fromJson(data)); |
| 1429 } | 1441 } |
| 1430 | 1442 |
| 1431 } | 1443 } |
| 1432 | 1444 |
| 1433 | 1445 |
| 1434 /** Not documented yet. */ | |
| 1435 class UsersThreadsResourceApi { | 1446 class UsersThreadsResourceApi { |
| 1436 final common_internal.ApiRequester _requester; | 1447 final commons.ApiRequester _requester; |
| 1437 | 1448 |
| 1438 UsersThreadsResourceApi(common_internal.ApiRequester client) : | 1449 UsersThreadsResourceApi(commons.ApiRequester client) : |
| 1439 _requester = client; | 1450 _requester = client; |
| 1440 | 1451 |
| 1441 /** | 1452 /** |
| 1442 * Immediately and permanently deletes the specified thread. This operation | 1453 * Immediately and permanently deletes the specified thread. This operation |
| 1443 * cannot be undone. Prefer threads.trash instead. | 1454 * cannot be undone. Prefer threads.trash instead. |
| 1444 * | 1455 * |
| 1445 * Request parameters: | 1456 * Request parameters: |
| 1446 * | 1457 * |
| 1447 * [userId] - The user's email address. The special value me can be used to | 1458 * [userId] - The user's email address. The special value me can be used to |
| 1448 * indicate the authenticated user. | 1459 * indicate the authenticated user. |
| 1449 * | 1460 * |
| 1450 * [id] - ID of the Thread to delete. | 1461 * [id] - ID of the Thread to delete. |
| 1451 * | 1462 * |
| 1452 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1463 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1453 * error. | 1464 * error. |
| 1454 * | 1465 * |
| 1455 * If the used [http.Client] completes with an error when making a REST call, | 1466 * If the used [http.Client] completes with an error when making a REST call, |
| 1456 * this method will complete with the same error. | 1467 * this method will complete with the same error. |
| 1457 */ | 1468 */ |
| 1458 async.Future delete(core.String userId, core.String id) { | 1469 async.Future delete(core.String userId, core.String id) { |
| 1459 var _url = null; | 1470 var _url = null; |
| 1460 var _queryParams = new core.Map(); | 1471 var _queryParams = new core.Map(); |
| 1461 var _uploadMedia = null; | 1472 var _uploadMedia = null; |
| 1462 var _uploadOptions = null; | 1473 var _uploadOptions = null; |
| 1463 var _downloadOptions = common.DownloadOptions.Metadata; | 1474 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1464 var _body = null; | 1475 var _body = null; |
| 1465 | 1476 |
| 1466 if (userId == null) { | 1477 if (userId == null) { |
| 1467 throw new core.ArgumentError("Parameter userId is required."); | 1478 throw new core.ArgumentError("Parameter userId is required."); |
| 1468 } | 1479 } |
| 1469 if (id == null) { | 1480 if (id == null) { |
| 1470 throw new core.ArgumentError("Parameter id is required."); | 1481 throw new core.ArgumentError("Parameter id is required."); |
| 1471 } | 1482 } |
| 1472 | 1483 |
| 1473 _downloadOptions = null; | 1484 _downloadOptions = null; |
| 1474 | 1485 |
| 1475 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads/' + comm
on_internal.Escaper.ecapeVariable('$id'); | 1486 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id'); |
| 1476 | 1487 |
| 1477 var _response = _requester.request(_url, | 1488 var _response = _requester.request(_url, |
| 1478 "DELETE", | 1489 "DELETE", |
| 1479 body: _body, | 1490 body: _body, |
| 1480 queryParams: _queryParams, | 1491 queryParams: _queryParams, |
| 1481 uploadOptions: _uploadOptions, | 1492 uploadOptions: _uploadOptions, |
| 1482 uploadMedia: _uploadMedia, | 1493 uploadMedia: _uploadMedia, |
| 1483 downloadOptions: _downloadOptions); | 1494 downloadOptions: _downloadOptions); |
| 1484 return _response.then((data) => null); | 1495 return _response.then((data) => null); |
| 1485 } | 1496 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1498 * Possible string values are: | 1509 * Possible string values are: |
| 1499 * - "full" | 1510 * - "full" |
| 1500 * - "metadata" | 1511 * - "metadata" |
| 1501 * - "minimal" | 1512 * - "minimal" |
| 1502 * | 1513 * |
| 1503 * [metadataHeaders] - When given and format is METADATA, only include headers | 1514 * [metadataHeaders] - When given and format is METADATA, only include headers |
| 1504 * specified. | 1515 * specified. |
| 1505 * | 1516 * |
| 1506 * Completes with a [Thread]. | 1517 * Completes with a [Thread]. |
| 1507 * | 1518 * |
| 1508 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1519 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1509 * error. | 1520 * error. |
| 1510 * | 1521 * |
| 1511 * If the used [http.Client] completes with an error when making a REST call, | 1522 * If the used [http.Client] completes with an error when making a REST call, |
| 1512 * this method will complete with the same error. | 1523 * this method will complete with the same error. |
| 1513 */ | 1524 */ |
| 1514 async.Future<Thread> get(core.String userId, core.String id, {core.String form
at, core.List<core.String> metadataHeaders}) { | 1525 async.Future<Thread> get(core.String userId, core.String id, {core.String form
at, core.List<core.String> metadataHeaders}) { |
| 1515 var _url = null; | 1526 var _url = null; |
| 1516 var _queryParams = new core.Map(); | 1527 var _queryParams = new core.Map(); |
| 1517 var _uploadMedia = null; | 1528 var _uploadMedia = null; |
| 1518 var _uploadOptions = null; | 1529 var _uploadOptions = null; |
| 1519 var _downloadOptions = common.DownloadOptions.Metadata; | 1530 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1520 var _body = null; | 1531 var _body = null; |
| 1521 | 1532 |
| 1522 if (userId == null) { | 1533 if (userId == null) { |
| 1523 throw new core.ArgumentError("Parameter userId is required."); | 1534 throw new core.ArgumentError("Parameter userId is required."); |
| 1524 } | 1535 } |
| 1525 if (id == null) { | 1536 if (id == null) { |
| 1526 throw new core.ArgumentError("Parameter id is required."); | 1537 throw new core.ArgumentError("Parameter id is required."); |
| 1527 } | 1538 } |
| 1528 if (format != null) { | 1539 if (format != null) { |
| 1529 _queryParams["format"] = [format]; | 1540 _queryParams["format"] = [format]; |
| 1530 } | 1541 } |
| 1531 if (metadataHeaders != null) { | 1542 if (metadataHeaders != null) { |
| 1532 _queryParams["metadataHeaders"] = metadataHeaders; | 1543 _queryParams["metadataHeaders"] = metadataHeaders; |
| 1533 } | 1544 } |
| 1534 | 1545 |
| 1535 | 1546 |
| 1536 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads/' + comm
on_internal.Escaper.ecapeVariable('$id'); | 1547 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id'); |
| 1537 | 1548 |
| 1538 var _response = _requester.request(_url, | 1549 var _response = _requester.request(_url, |
| 1539 "GET", | 1550 "GET", |
| 1540 body: _body, | 1551 body: _body, |
| 1541 queryParams: _queryParams, | 1552 queryParams: _queryParams, |
| 1542 uploadOptions: _uploadOptions, | 1553 uploadOptions: _uploadOptions, |
| 1543 uploadMedia: _uploadMedia, | 1554 uploadMedia: _uploadMedia, |
| 1544 downloadOptions: _downloadOptions); | 1555 downloadOptions: _downloadOptions); |
| 1545 return _response.then((data) => new Thread.fromJson(data)); | 1556 return _response.then((data) => new Thread.fromJson(data)); |
| 1546 } | 1557 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1562 * | 1573 * |
| 1563 * [pageToken] - Page token to retrieve a specific page of results in the | 1574 * [pageToken] - Page token to retrieve a specific page of results in the |
| 1564 * list. | 1575 * list. |
| 1565 * | 1576 * |
| 1566 * [q] - Only return threads matching the specified query. Supports the same | 1577 * [q] - Only return threads matching the specified query. Supports the same |
| 1567 * query format as the Gmail search box. For example, | 1578 * query format as the Gmail search box. For example, |
| 1568 * "from:someuser@example.com rfc822msgid: is:unread". | 1579 * "from:someuser@example.com rfc822msgid: is:unread". |
| 1569 * | 1580 * |
| 1570 * Completes with a [ListThreadsResponse]. | 1581 * Completes with a [ListThreadsResponse]. |
| 1571 * | 1582 * |
| 1572 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1583 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1573 * error. | 1584 * error. |
| 1574 * | 1585 * |
| 1575 * If the used [http.Client] completes with an error when making a REST call, | 1586 * If the used [http.Client] completes with an error when making a REST call, |
| 1576 * this method will complete with the same error. | 1587 * this method will complete with the same error. |
| 1577 */ | 1588 */ |
| 1578 async.Future<ListThreadsResponse> list(core.String userId, {core.bool includeS
pamTrash, core.List<core.String> labelIds, core.int maxResults, core.String page
Token, core.String q}) { | 1589 async.Future<ListThreadsResponse> list(core.String userId, {core.bool includeS
pamTrash, core.List<core.String> labelIds, core.int maxResults, core.String page
Token, core.String q}) { |
| 1579 var _url = null; | 1590 var _url = null; |
| 1580 var _queryParams = new core.Map(); | 1591 var _queryParams = new core.Map(); |
| 1581 var _uploadMedia = null; | 1592 var _uploadMedia = null; |
| 1582 var _uploadOptions = null; | 1593 var _uploadOptions = null; |
| 1583 var _downloadOptions = common.DownloadOptions.Metadata; | 1594 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1584 var _body = null; | 1595 var _body = null; |
| 1585 | 1596 |
| 1586 if (userId == null) { | 1597 if (userId == null) { |
| 1587 throw new core.ArgumentError("Parameter userId is required."); | 1598 throw new core.ArgumentError("Parameter userId is required."); |
| 1588 } | 1599 } |
| 1589 if (includeSpamTrash != null) { | 1600 if (includeSpamTrash != null) { |
| 1590 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; | 1601 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; |
| 1591 } | 1602 } |
| 1592 if (labelIds != null) { | 1603 if (labelIds != null) { |
| 1593 _queryParams["labelIds"] = labelIds; | 1604 _queryParams["labelIds"] = labelIds; |
| 1594 } | 1605 } |
| 1595 if (maxResults != null) { | 1606 if (maxResults != null) { |
| 1596 _queryParams["maxResults"] = ["${maxResults}"]; | 1607 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1597 } | 1608 } |
| 1598 if (pageToken != null) { | 1609 if (pageToken != null) { |
| 1599 _queryParams["pageToken"] = [pageToken]; | 1610 _queryParams["pageToken"] = [pageToken]; |
| 1600 } | 1611 } |
| 1601 if (q != null) { | 1612 if (q != null) { |
| 1602 _queryParams["q"] = [q]; | 1613 _queryParams["q"] = [q]; |
| 1603 } | 1614 } |
| 1604 | 1615 |
| 1605 | 1616 |
| 1606 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads'; | 1617 _url = commons.Escaper.ecapeVariable('$userId') + '/threads'; |
| 1607 | 1618 |
| 1608 var _response = _requester.request(_url, | 1619 var _response = _requester.request(_url, |
| 1609 "GET", | 1620 "GET", |
| 1610 body: _body, | 1621 body: _body, |
| 1611 queryParams: _queryParams, | 1622 queryParams: _queryParams, |
| 1612 uploadOptions: _uploadOptions, | 1623 uploadOptions: _uploadOptions, |
| 1613 uploadMedia: _uploadMedia, | 1624 uploadMedia: _uploadMedia, |
| 1614 downloadOptions: _downloadOptions); | 1625 downloadOptions: _downloadOptions); |
| 1615 return _response.then((data) => new ListThreadsResponse.fromJson(data)); | 1626 return _response.then((data) => new ListThreadsResponse.fromJson(data)); |
| 1616 } | 1627 } |
| 1617 | 1628 |
| 1618 /** | 1629 /** |
| 1619 * Modifies the labels applied to the thread. This applies to all messages in | 1630 * Modifies the labels applied to the thread. This applies to all messages in |
| 1620 * the thread. | 1631 * the thread. |
| 1621 * | 1632 * |
| 1622 * [request] - The metadata request object. | 1633 * [request] - The metadata request object. |
| 1623 * | 1634 * |
| 1624 * Request parameters: | 1635 * Request parameters: |
| 1625 * | 1636 * |
| 1626 * [userId] - The user's email address. The special value me can be used to | 1637 * [userId] - The user's email address. The special value me can be used to |
| 1627 * indicate the authenticated user. | 1638 * indicate the authenticated user. |
| 1628 * | 1639 * |
| 1629 * [id] - The ID of the thread to modify. | 1640 * [id] - The ID of the thread to modify. |
| 1630 * | 1641 * |
| 1631 * Completes with a [Thread]. | 1642 * Completes with a [Thread]. |
| 1632 * | 1643 * |
| 1633 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1644 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1634 * error. | 1645 * error. |
| 1635 * | 1646 * |
| 1636 * If the used [http.Client] completes with an error when making a REST call, | 1647 * If the used [http.Client] completes with an error when making a REST call, |
| 1637 * this method will complete with the same error. | 1648 * this method will complete with the same error. |
| 1638 */ | 1649 */ |
| 1639 async.Future<Thread> modify(ModifyThreadRequest request, core.String userId, c
ore.String id) { | 1650 async.Future<Thread> modify(ModifyThreadRequest request, core.String userId, c
ore.String id) { |
| 1640 var _url = null; | 1651 var _url = null; |
| 1641 var _queryParams = new core.Map(); | 1652 var _queryParams = new core.Map(); |
| 1642 var _uploadMedia = null; | 1653 var _uploadMedia = null; |
| 1643 var _uploadOptions = null; | 1654 var _uploadOptions = null; |
| 1644 var _downloadOptions = common.DownloadOptions.Metadata; | 1655 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1645 var _body = null; | 1656 var _body = null; |
| 1646 | 1657 |
| 1647 if (request != null) { | 1658 if (request != null) { |
| 1648 _body = convert.JSON.encode((request).toJson()); | 1659 _body = convert.JSON.encode((request).toJson()); |
| 1649 } | 1660 } |
| 1650 if (userId == null) { | 1661 if (userId == null) { |
| 1651 throw new core.ArgumentError("Parameter userId is required."); | 1662 throw new core.ArgumentError("Parameter userId is required."); |
| 1652 } | 1663 } |
| 1653 if (id == null) { | 1664 if (id == null) { |
| 1654 throw new core.ArgumentError("Parameter id is required."); | 1665 throw new core.ArgumentError("Parameter id is required."); |
| 1655 } | 1666 } |
| 1656 | 1667 |
| 1657 | 1668 |
| 1658 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads/' + comm
on_internal.Escaper.ecapeVariable('$id') + '/modify'; | 1669 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id') + '/modify'; |
| 1659 | 1670 |
| 1660 var _response = _requester.request(_url, | 1671 var _response = _requester.request(_url, |
| 1661 "POST", | 1672 "POST", |
| 1662 body: _body, | 1673 body: _body, |
| 1663 queryParams: _queryParams, | 1674 queryParams: _queryParams, |
| 1664 uploadOptions: _uploadOptions, | 1675 uploadOptions: _uploadOptions, |
| 1665 uploadMedia: _uploadMedia, | 1676 uploadMedia: _uploadMedia, |
| 1666 downloadOptions: _downloadOptions); | 1677 downloadOptions: _downloadOptions); |
| 1667 return _response.then((data) => new Thread.fromJson(data)); | 1678 return _response.then((data) => new Thread.fromJson(data)); |
| 1668 } | 1679 } |
| 1669 | 1680 |
| 1670 /** | 1681 /** |
| 1671 * Moves the specified thread to the trash. | 1682 * Moves the specified thread to the trash. |
| 1672 * | 1683 * |
| 1673 * Request parameters: | 1684 * Request parameters: |
| 1674 * | 1685 * |
| 1675 * [userId] - The user's email address. The special value me can be used to | 1686 * [userId] - The user's email address. The special value me can be used to |
| 1676 * indicate the authenticated user. | 1687 * indicate the authenticated user. |
| 1677 * | 1688 * |
| 1678 * [id] - The ID of the thread to Trash. | 1689 * [id] - The ID of the thread to Trash. |
| 1679 * | 1690 * |
| 1680 * Completes with a [Thread]. | 1691 * Completes with a [Thread]. |
| 1681 * | 1692 * |
| 1682 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1693 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1683 * error. | 1694 * error. |
| 1684 * | 1695 * |
| 1685 * If the used [http.Client] completes with an error when making a REST call, | 1696 * If the used [http.Client] completes with an error when making a REST call, |
| 1686 * this method will complete with the same error. | 1697 * this method will complete with the same error. |
| 1687 */ | 1698 */ |
| 1688 async.Future<Thread> trash(core.String userId, core.String id) { | 1699 async.Future<Thread> trash(core.String userId, core.String id) { |
| 1689 var _url = null; | 1700 var _url = null; |
| 1690 var _queryParams = new core.Map(); | 1701 var _queryParams = new core.Map(); |
| 1691 var _uploadMedia = null; | 1702 var _uploadMedia = null; |
| 1692 var _uploadOptions = null; | 1703 var _uploadOptions = null; |
| 1693 var _downloadOptions = common.DownloadOptions.Metadata; | 1704 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1694 var _body = null; | 1705 var _body = null; |
| 1695 | 1706 |
| 1696 if (userId == null) { | 1707 if (userId == null) { |
| 1697 throw new core.ArgumentError("Parameter userId is required."); | 1708 throw new core.ArgumentError("Parameter userId is required."); |
| 1698 } | 1709 } |
| 1699 if (id == null) { | 1710 if (id == null) { |
| 1700 throw new core.ArgumentError("Parameter id is required."); | 1711 throw new core.ArgumentError("Parameter id is required."); |
| 1701 } | 1712 } |
| 1702 | 1713 |
| 1703 | 1714 |
| 1704 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads/' + comm
on_internal.Escaper.ecapeVariable('$id') + '/trash'; | 1715 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id') + '/trash'; |
| 1705 | 1716 |
| 1706 var _response = _requester.request(_url, | 1717 var _response = _requester.request(_url, |
| 1707 "POST", | 1718 "POST", |
| 1708 body: _body, | 1719 body: _body, |
| 1709 queryParams: _queryParams, | 1720 queryParams: _queryParams, |
| 1710 uploadOptions: _uploadOptions, | 1721 uploadOptions: _uploadOptions, |
| 1711 uploadMedia: _uploadMedia, | 1722 uploadMedia: _uploadMedia, |
| 1712 downloadOptions: _downloadOptions); | 1723 downloadOptions: _downloadOptions); |
| 1713 return _response.then((data) => new Thread.fromJson(data)); | 1724 return _response.then((data) => new Thread.fromJson(data)); |
| 1714 } | 1725 } |
| 1715 | 1726 |
| 1716 /** | 1727 /** |
| 1717 * Removes the specified thread from the trash. | 1728 * Removes the specified thread from the trash. |
| 1718 * | 1729 * |
| 1719 * Request parameters: | 1730 * Request parameters: |
| 1720 * | 1731 * |
| 1721 * [userId] - The user's email address. The special value me can be used to | 1732 * [userId] - The user's email address. The special value me can be used to |
| 1722 * indicate the authenticated user. | 1733 * indicate the authenticated user. |
| 1723 * | 1734 * |
| 1724 * [id] - The ID of the thread to remove from Trash. | 1735 * [id] - The ID of the thread to remove from Trash. |
| 1725 * | 1736 * |
| 1726 * Completes with a [Thread]. | 1737 * Completes with a [Thread]. |
| 1727 * | 1738 * |
| 1728 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1739 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1729 * error. | 1740 * error. |
| 1730 * | 1741 * |
| 1731 * If the used [http.Client] completes with an error when making a REST call, | 1742 * If the used [http.Client] completes with an error when making a REST call, |
| 1732 * this method will complete with the same error. | 1743 * this method will complete with the same error. |
| 1733 */ | 1744 */ |
| 1734 async.Future<Thread> untrash(core.String userId, core.String id) { | 1745 async.Future<Thread> untrash(core.String userId, core.String id) { |
| 1735 var _url = null; | 1746 var _url = null; |
| 1736 var _queryParams = new core.Map(); | 1747 var _queryParams = new core.Map(); |
| 1737 var _uploadMedia = null; | 1748 var _uploadMedia = null; |
| 1738 var _uploadOptions = null; | 1749 var _uploadOptions = null; |
| 1739 var _downloadOptions = common.DownloadOptions.Metadata; | 1750 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1740 var _body = null; | 1751 var _body = null; |
| 1741 | 1752 |
| 1742 if (userId == null) { | 1753 if (userId == null) { |
| 1743 throw new core.ArgumentError("Parameter userId is required."); | 1754 throw new core.ArgumentError("Parameter userId is required."); |
| 1744 } | 1755 } |
| 1745 if (id == null) { | 1756 if (id == null) { |
| 1746 throw new core.ArgumentError("Parameter id is required."); | 1757 throw new core.ArgumentError("Parameter id is required."); |
| 1747 } | 1758 } |
| 1748 | 1759 |
| 1749 | 1760 |
| 1750 _url = common_internal.Escaper.ecapeVariable('$userId') + '/threads/' + comm
on_internal.Escaper.ecapeVariable('$id') + '/untrash'; | 1761 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id') + '/untrash'; |
| 1751 | 1762 |
| 1752 var _response = _requester.request(_url, | 1763 var _response = _requester.request(_url, |
| 1753 "POST", | 1764 "POST", |
| 1754 body: _body, | 1765 body: _body, |
| 1755 queryParams: _queryParams, | 1766 queryParams: _queryParams, |
| 1756 uploadOptions: _uploadOptions, | 1767 uploadOptions: _uploadOptions, |
| 1757 uploadMedia: _uploadMedia, | 1768 uploadMedia: _uploadMedia, |
| 1758 downloadOptions: _downloadOptions); | 1769 downloadOptions: _downloadOptions); |
| 1759 return _response.then((data) => new Thread.fromJson(data)); | 1770 return _response.then((data) => new Thread.fromJson(data)); |
| 1760 } | 1771 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1867 _json["messagesAdded"] = messagesAdded.map((value) => (value).toJson()).to
List(); | 1878 _json["messagesAdded"] = messagesAdded.map((value) => (value).toJson()).to
List(); |
| 1868 } | 1879 } |
| 1869 if (messagesDeleted != null) { | 1880 if (messagesDeleted != null) { |
| 1870 _json["messagesDeleted"] = messagesDeleted.map((value) => (value).toJson()
).toList(); | 1881 _json["messagesDeleted"] = messagesDeleted.map((value) => (value).toJson()
).toList(); |
| 1871 } | 1882 } |
| 1872 return _json; | 1883 return _json; |
| 1873 } | 1884 } |
| 1874 } | 1885 } |
| 1875 | 1886 |
| 1876 | 1887 |
| 1877 /** Not documented yet. */ | |
| 1878 class HistoryLabelAdded { | 1888 class HistoryLabelAdded { |
| 1879 /** Label IDs added to the message. */ | 1889 /** Label IDs added to the message. */ |
| 1880 core.List<core.String> labelIds; | 1890 core.List<core.String> labelIds; |
| 1881 | 1891 |
| 1882 /** Not documented yet. */ | |
| 1883 Message message; | 1892 Message message; |
| 1884 | 1893 |
| 1885 | 1894 |
| 1886 HistoryLabelAdded(); | 1895 HistoryLabelAdded(); |
| 1887 | 1896 |
| 1888 HistoryLabelAdded.fromJson(core.Map _json) { | 1897 HistoryLabelAdded.fromJson(core.Map _json) { |
| 1889 if (_json.containsKey("labelIds")) { | 1898 if (_json.containsKey("labelIds")) { |
| 1890 labelIds = _json["labelIds"]; | 1899 labelIds = _json["labelIds"]; |
| 1891 } | 1900 } |
| 1892 if (_json.containsKey("message")) { | 1901 if (_json.containsKey("message")) { |
| 1893 message = new Message.fromJson(_json["message"]); | 1902 message = new Message.fromJson(_json["message"]); |
| 1894 } | 1903 } |
| 1895 } | 1904 } |
| 1896 | 1905 |
| 1897 core.Map toJson() { | 1906 core.Map toJson() { |
| 1898 var _json = new core.Map(); | 1907 var _json = new core.Map(); |
| 1899 if (labelIds != null) { | 1908 if (labelIds != null) { |
| 1900 _json["labelIds"] = labelIds; | 1909 _json["labelIds"] = labelIds; |
| 1901 } | 1910 } |
| 1902 if (message != null) { | 1911 if (message != null) { |
| 1903 _json["message"] = (message).toJson(); | 1912 _json["message"] = (message).toJson(); |
| 1904 } | 1913 } |
| 1905 return _json; | 1914 return _json; |
| 1906 } | 1915 } |
| 1907 } | 1916 } |
| 1908 | 1917 |
| 1909 | 1918 |
| 1910 /** Not documented yet. */ | |
| 1911 class HistoryLabelRemoved { | 1919 class HistoryLabelRemoved { |
| 1912 /** Label IDs removed from the message. */ | 1920 /** Label IDs removed from the message. */ |
| 1913 core.List<core.String> labelIds; | 1921 core.List<core.String> labelIds; |
| 1914 | 1922 |
| 1915 /** Not documented yet. */ | |
| 1916 Message message; | 1923 Message message; |
| 1917 | 1924 |
| 1918 | 1925 |
| 1919 HistoryLabelRemoved(); | 1926 HistoryLabelRemoved(); |
| 1920 | 1927 |
| 1921 HistoryLabelRemoved.fromJson(core.Map _json) { | 1928 HistoryLabelRemoved.fromJson(core.Map _json) { |
| 1922 if (_json.containsKey("labelIds")) { | 1929 if (_json.containsKey("labelIds")) { |
| 1923 labelIds = _json["labelIds"]; | 1930 labelIds = _json["labelIds"]; |
| 1924 } | 1931 } |
| 1925 if (_json.containsKey("message")) { | 1932 if (_json.containsKey("message")) { |
| 1926 message = new Message.fromJson(_json["message"]); | 1933 message = new Message.fromJson(_json["message"]); |
| 1927 } | 1934 } |
| 1928 } | 1935 } |
| 1929 | 1936 |
| 1930 core.Map toJson() { | 1937 core.Map toJson() { |
| 1931 var _json = new core.Map(); | 1938 var _json = new core.Map(); |
| 1932 if (labelIds != null) { | 1939 if (labelIds != null) { |
| 1933 _json["labelIds"] = labelIds; | 1940 _json["labelIds"] = labelIds; |
| 1934 } | 1941 } |
| 1935 if (message != null) { | 1942 if (message != null) { |
| 1936 _json["message"] = (message).toJson(); | 1943 _json["message"] = (message).toJson(); |
| 1937 } | 1944 } |
| 1938 return _json; | 1945 return _json; |
| 1939 } | 1946 } |
| 1940 } | 1947 } |
| 1941 | 1948 |
| 1942 | 1949 |
| 1943 /** Not documented yet. */ | |
| 1944 class HistoryMessageAdded { | 1950 class HistoryMessageAdded { |
| 1945 /** Not documented yet. */ | |
| 1946 Message message; | 1951 Message message; |
| 1947 | 1952 |
| 1948 | 1953 |
| 1949 HistoryMessageAdded(); | 1954 HistoryMessageAdded(); |
| 1950 | 1955 |
| 1951 HistoryMessageAdded.fromJson(core.Map _json) { | 1956 HistoryMessageAdded.fromJson(core.Map _json) { |
| 1952 if (_json.containsKey("message")) { | 1957 if (_json.containsKey("message")) { |
| 1953 message = new Message.fromJson(_json["message"]); | 1958 message = new Message.fromJson(_json["message"]); |
| 1954 } | 1959 } |
| 1955 } | 1960 } |
| 1956 | 1961 |
| 1957 core.Map toJson() { | 1962 core.Map toJson() { |
| 1958 var _json = new core.Map(); | 1963 var _json = new core.Map(); |
| 1959 if (message != null) { | 1964 if (message != null) { |
| 1960 _json["message"] = (message).toJson(); | 1965 _json["message"] = (message).toJson(); |
| 1961 } | 1966 } |
| 1962 return _json; | 1967 return _json; |
| 1963 } | 1968 } |
| 1964 } | 1969 } |
| 1965 | 1970 |
| 1966 | 1971 |
| 1967 /** Not documented yet. */ | |
| 1968 class HistoryMessageDeleted { | 1972 class HistoryMessageDeleted { |
| 1969 /** Not documented yet. */ | |
| 1970 Message message; | 1973 Message message; |
| 1971 | 1974 |
| 1972 | 1975 |
| 1973 HistoryMessageDeleted(); | 1976 HistoryMessageDeleted(); |
| 1974 | 1977 |
| 1975 HistoryMessageDeleted.fromJson(core.Map _json) { | 1978 HistoryMessageDeleted.fromJson(core.Map _json) { |
| 1976 if (_json.containsKey("message")) { | 1979 if (_json.containsKey("message")) { |
| 1977 message = new Message.fromJson(_json["message"]); | 1980 message = new Message.fromJson(_json["message"]); |
| 1978 } | 1981 } |
| 1979 } | 1982 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 _json["threadsUnread"] = threadsUnread; | 2105 _json["threadsUnread"] = threadsUnread; |
| 2103 } | 2106 } |
| 2104 if (type != null) { | 2107 if (type != null) { |
| 2105 _json["type"] = type; | 2108 _json["type"] = type; |
| 2106 } | 2109 } |
| 2107 return _json; | 2110 return _json; |
| 2108 } | 2111 } |
| 2109 } | 2112 } |
| 2110 | 2113 |
| 2111 | 2114 |
| 2112 /** Not documented yet. */ | |
| 2113 class ListDraftsResponse { | 2115 class ListDraftsResponse { |
| 2114 /** List of drafts. */ | 2116 /** List of drafts. */ |
| 2115 core.List<Draft> drafts; | 2117 core.List<Draft> drafts; |
| 2116 | 2118 |
| 2117 /** Token to retrieve the next page of results in the list. */ | 2119 /** Token to retrieve the next page of results in the list. */ |
| 2118 core.String nextPageToken; | 2120 core.String nextPageToken; |
| 2119 | 2121 |
| 2120 /** Estimated total number of results. */ | 2122 /** Estimated total number of results. */ |
| 2121 core.int resultSizeEstimate; | 2123 core.int resultSizeEstimate; |
| 2122 | 2124 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2144 _json["nextPageToken"] = nextPageToken; | 2146 _json["nextPageToken"] = nextPageToken; |
| 2145 } | 2147 } |
| 2146 if (resultSizeEstimate != null) { | 2148 if (resultSizeEstimate != null) { |
| 2147 _json["resultSizeEstimate"] = resultSizeEstimate; | 2149 _json["resultSizeEstimate"] = resultSizeEstimate; |
| 2148 } | 2150 } |
| 2149 return _json; | 2151 return _json; |
| 2150 } | 2152 } |
| 2151 } | 2153 } |
| 2152 | 2154 |
| 2153 | 2155 |
| 2154 /** Not documented yet. */ | |
| 2155 class ListHistoryResponse { | 2156 class ListHistoryResponse { |
| 2156 /** | 2157 /** |
| 2157 * List of history records. Any messages contained in the response will | 2158 * List of history records. Any messages contained in the response will |
| 2158 * typically only have id and threadId fields populated. | 2159 * typically only have id and threadId fields populated. |
| 2159 */ | 2160 */ |
| 2160 core.List<History> history; | 2161 core.List<History> history; |
| 2161 | 2162 |
| 2162 /** The ID of the mailbox's current history record. */ | 2163 /** The ID of the mailbox's current history record. */ |
| 2163 core.String historyId; | 2164 core.String historyId; |
| 2164 | 2165 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2189 _json["historyId"] = historyId; | 2190 _json["historyId"] = historyId; |
| 2190 } | 2191 } |
| 2191 if (nextPageToken != null) { | 2192 if (nextPageToken != null) { |
| 2192 _json["nextPageToken"] = nextPageToken; | 2193 _json["nextPageToken"] = nextPageToken; |
| 2193 } | 2194 } |
| 2194 return _json; | 2195 return _json; |
| 2195 } | 2196 } |
| 2196 } | 2197 } |
| 2197 | 2198 |
| 2198 | 2199 |
| 2199 /** Not documented yet. */ | |
| 2200 class ListLabelsResponse { | 2200 class ListLabelsResponse { |
| 2201 /** List of labels. */ | 2201 /** List of labels. */ |
| 2202 core.List<Label> labels; | 2202 core.List<Label> labels; |
| 2203 | 2203 |
| 2204 | 2204 |
| 2205 ListLabelsResponse(); | 2205 ListLabelsResponse(); |
| 2206 | 2206 |
| 2207 ListLabelsResponse.fromJson(core.Map _json) { | 2207 ListLabelsResponse.fromJson(core.Map _json) { |
| 2208 if (_json.containsKey("labels")) { | 2208 if (_json.containsKey("labels")) { |
| 2209 labels = _json["labels"].map((value) => new Label.fromJson(value)).toList(
); | 2209 labels = _json["labels"].map((value) => new Label.fromJson(value)).toList(
); |
| 2210 } | 2210 } |
| 2211 } | 2211 } |
| 2212 | 2212 |
| 2213 core.Map toJson() { | 2213 core.Map toJson() { |
| 2214 var _json = new core.Map(); | 2214 var _json = new core.Map(); |
| 2215 if (labels != null) { | 2215 if (labels != null) { |
| 2216 _json["labels"] = labels.map((value) => (value).toJson()).toList(); | 2216 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
| 2217 } | 2217 } |
| 2218 return _json; | 2218 return _json; |
| 2219 } | 2219 } |
| 2220 } | 2220 } |
| 2221 | 2221 |
| 2222 | 2222 |
| 2223 /** Not documented yet. */ | |
| 2224 class ListMessagesResponse { | 2223 class ListMessagesResponse { |
| 2225 /** List of messages. */ | 2224 /** List of messages. */ |
| 2226 core.List<Message> messages; | 2225 core.List<Message> messages; |
| 2227 | 2226 |
| 2228 /** Token to retrieve the next page of results in the list. */ | 2227 /** Token to retrieve the next page of results in the list. */ |
| 2229 core.String nextPageToken; | 2228 core.String nextPageToken; |
| 2230 | 2229 |
| 2231 /** Estimated total number of results. */ | 2230 /** Estimated total number of results. */ |
| 2232 core.int resultSizeEstimate; | 2231 core.int resultSizeEstimate; |
| 2233 | 2232 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2255 _json["nextPageToken"] = nextPageToken; | 2254 _json["nextPageToken"] = nextPageToken; |
| 2256 } | 2255 } |
| 2257 if (resultSizeEstimate != null) { | 2256 if (resultSizeEstimate != null) { |
| 2258 _json["resultSizeEstimate"] = resultSizeEstimate; | 2257 _json["resultSizeEstimate"] = resultSizeEstimate; |
| 2259 } | 2258 } |
| 2260 return _json; | 2259 return _json; |
| 2261 } | 2260 } |
| 2262 } | 2261 } |
| 2263 | 2262 |
| 2264 | 2263 |
| 2265 /** Not documented yet. */ | |
| 2266 class ListThreadsResponse { | 2264 class ListThreadsResponse { |
| 2267 /** Page token to retrieve the next page of results in the list. */ | 2265 /** Page token to retrieve the next page of results in the list. */ |
| 2268 core.String nextPageToken; | 2266 core.String nextPageToken; |
| 2269 | 2267 |
| 2270 /** Estimated total number of results. */ | 2268 /** Estimated total number of results. */ |
| 2271 core.int resultSizeEstimate; | 2269 core.int resultSizeEstimate; |
| 2272 | 2270 |
| 2273 /** List of threads. */ | 2271 /** List of threads. */ |
| 2274 core.List<Thread> threads; | 2272 core.List<Thread> threads; |
| 2275 | 2273 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 _json["data"] = data; | 2545 _json["data"] = data; |
| 2548 } | 2546 } |
| 2549 if (size != null) { | 2547 if (size != null) { |
| 2550 _json["size"] = size; | 2548 _json["size"] = size; |
| 2551 } | 2549 } |
| 2552 return _json; | 2550 return _json; |
| 2553 } | 2551 } |
| 2554 } | 2552 } |
| 2555 | 2553 |
| 2556 | 2554 |
| 2557 /** Not documented yet. */ | |
| 2558 class MessagePartHeader { | 2555 class MessagePartHeader { |
| 2559 /** The name of the header before the : separator. For example, To. */ | 2556 /** The name of the header before the : separator. For example, To. */ |
| 2560 core.String name; | 2557 core.String name; |
| 2561 | 2558 |
| 2562 /** | 2559 /** |
| 2563 * The value of the header after the : separator. For example, | 2560 * The value of the header after the : separator. For example, |
| 2564 * someuser@example.com. | 2561 * someuser@example.com. |
| 2565 */ | 2562 */ |
| 2566 core.String value; | 2563 core.String value; |
| 2567 | 2564 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2583 _json["name"] = name; | 2580 _json["name"] = name; |
| 2584 } | 2581 } |
| 2585 if (value != null) { | 2582 if (value != null) { |
| 2586 _json["value"] = value; | 2583 _json["value"] = value; |
| 2587 } | 2584 } |
| 2588 return _json; | 2585 return _json; |
| 2589 } | 2586 } |
| 2590 } | 2587 } |
| 2591 | 2588 |
| 2592 | 2589 |
| 2593 /** Not documented yet. */ | |
| 2594 class ModifyMessageRequest { | 2590 class ModifyMessageRequest { |
| 2595 /** A list of IDs of labels to add to this message. */ | 2591 /** A list of IDs of labels to add to this message. */ |
| 2596 core.List<core.String> addLabelIds; | 2592 core.List<core.String> addLabelIds; |
| 2597 | 2593 |
| 2598 /** A list IDs of labels to remove from this message. */ | 2594 /** A list IDs of labels to remove from this message. */ |
| 2599 core.List<core.String> removeLabelIds; | 2595 core.List<core.String> removeLabelIds; |
| 2600 | 2596 |
| 2601 | 2597 |
| 2602 ModifyMessageRequest(); | 2598 ModifyMessageRequest(); |
| 2603 | 2599 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2616 _json["addLabelIds"] = addLabelIds; | 2612 _json["addLabelIds"] = addLabelIds; |
| 2617 } | 2613 } |
| 2618 if (removeLabelIds != null) { | 2614 if (removeLabelIds != null) { |
| 2619 _json["removeLabelIds"] = removeLabelIds; | 2615 _json["removeLabelIds"] = removeLabelIds; |
| 2620 } | 2616 } |
| 2621 return _json; | 2617 return _json; |
| 2622 } | 2618 } |
| 2623 } | 2619 } |
| 2624 | 2620 |
| 2625 | 2621 |
| 2626 /** Not documented yet. */ | |
| 2627 class ModifyThreadRequest { | 2622 class ModifyThreadRequest { |
| 2628 /** A list of IDs of labels to add to this thread. */ | 2623 /** A list of IDs of labels to add to this thread. */ |
| 2629 core.List<core.String> addLabelIds; | 2624 core.List<core.String> addLabelIds; |
| 2630 | 2625 |
| 2631 /** A list of IDs of labels to remove from this thread. */ | 2626 /** A list of IDs of labels to remove from this thread. */ |
| 2632 core.List<core.String> removeLabelIds; | 2627 core.List<core.String> removeLabelIds; |
| 2633 | 2628 |
| 2634 | 2629 |
| 2635 ModifyThreadRequest(); | 2630 ModifyThreadRequest(); |
| 2636 | 2631 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 } | 2744 } |
| 2750 if (messages != null) { | 2745 if (messages != null) { |
| 2751 _json["messages"] = messages.map((value) => (value).toJson()).toList(); | 2746 _json["messages"] = messages.map((value) => (value).toJson()).toList(); |
| 2752 } | 2747 } |
| 2753 if (snippet != null) { | 2748 if (snippet != null) { |
| 2754 _json["snippet"] = snippet; | 2749 _json["snippet"] = snippet; |
| 2755 } | 2750 } |
| 2756 return _json; | 2751 return _json; |
| 2757 } | 2752 } |
| 2758 } | 2753 } |
| 2759 | |
| 2760 | |
| OLD | NEW |