OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.gmail.v1; | 3 library googleapis.gmail.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, | 13 show |
14 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, | 14 ApiRequestError, |
15 ByteRange; | 15 DetailedApiRequestError, |
| 16 Media, |
| 17 UploadOptions, |
| 18 ResumableUploadOptions, |
| 19 DownloadOptions, |
| 20 PartialDownloadOptions, |
| 21 ByteRange; |
16 | 22 |
17 const core.String USER_AGENT = 'dart-api-client gmail/v1'; | 23 const core.String USER_AGENT = 'dart-api-client gmail/v1'; |
18 | 24 |
19 /** Access Gmail mailboxes including sending user email. */ | 25 /// Access Gmail mailboxes including sending user email. |
20 class GmailApi { | 26 class GmailApi { |
21 /** Read, send, delete, and manage your email */ | 27 /// Read, send, delete, and manage your email |
22 static const MailGoogleComScope = "https://mail.google.com/"; | 28 static const MailGoogleComScope = "https://mail.google.com/"; |
23 | 29 |
24 /** Manage drafts and send emails */ | 30 /// Manage drafts and send emails |
25 static const GmailComposeScope = "https://www.googleapis.com/auth/gmail.compos
e"; | 31 static const GmailComposeScope = |
| 32 "https://www.googleapis.com/auth/gmail.compose"; |
26 | 33 |
27 /** Insert mail into your mailbox */ | 34 /// Insert mail into your mailbox |
28 static const GmailInsertScope = "https://www.googleapis.com/auth/gmail.insert"
; | 35 static const GmailInsertScope = |
| 36 "https://www.googleapis.com/auth/gmail.insert"; |
29 | 37 |
30 /** Manage mailbox labels */ | 38 /// Manage mailbox labels |
31 static const GmailLabelsScope = "https://www.googleapis.com/auth/gmail.labels"
; | 39 static const GmailLabelsScope = |
| 40 "https://www.googleapis.com/auth/gmail.labels"; |
32 | 41 |
33 /** | 42 /// View your email message metadata such as labels and headers, but not the |
34 * View your email message metadata such as labels and headers, but not the | 43 /// email body |
35 * email body | 44 static const GmailMetadataScope = |
36 */ | 45 "https://www.googleapis.com/auth/gmail.metadata"; |
37 static const GmailMetadataScope = "https://www.googleapis.com/auth/gmail.metad
ata"; | |
38 | 46 |
39 /** View and modify but not delete your email */ | 47 /// View and modify but not delete your email |
40 static const GmailModifyScope = "https://www.googleapis.com/auth/gmail.modify"
; | 48 static const GmailModifyScope = |
| 49 "https://www.googleapis.com/auth/gmail.modify"; |
41 | 50 |
42 /** View your emails messages and settings */ | 51 /// View your emails messages and settings |
43 static const GmailReadonlyScope = "https://www.googleapis.com/auth/gmail.reado
nly"; | 52 static const GmailReadonlyScope = |
| 53 "https://www.googleapis.com/auth/gmail.readonly"; |
44 | 54 |
45 /** Send email on your behalf */ | 55 /// Send email on your behalf |
46 static const GmailSendScope = "https://www.googleapis.com/auth/gmail.send"; | 56 static const GmailSendScope = "https://www.googleapis.com/auth/gmail.send"; |
47 | 57 |
48 /** Manage your basic mail settings */ | 58 /// Manage your basic mail settings |
49 static const GmailSettingsBasicScope = "https://www.googleapis.com/auth/gmail.
settings.basic"; | 59 static const GmailSettingsBasicScope = |
| 60 "https://www.googleapis.com/auth/gmail.settings.basic"; |
50 | 61 |
51 /** | 62 /// Manage your sensitive mail settings, including who can manage your mail |
52 * Manage your sensitive mail settings, including who can manage your mail | 63 static const GmailSettingsSharingScope = |
53 */ | 64 "https://www.googleapis.com/auth/gmail.settings.sharing"; |
54 static const GmailSettingsSharingScope = "https://www.googleapis.com/auth/gmai
l.settings.sharing"; | |
55 | |
56 | 65 |
57 final commons.ApiRequester _requester; | 66 final commons.ApiRequester _requester; |
58 | 67 |
59 UsersResourceApi get users => new UsersResourceApi(_requester); | 68 UsersResourceApi get users => new UsersResourceApi(_requester); |
60 | 69 |
61 GmailApi(http.Client client, {core.String rootUrl: "https://www.googleapis.com
/", core.String servicePath: "gmail/v1/users/"}) : | 70 GmailApi(http.Client client, |
62 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 71 {core.String rootUrl: "https://www.googleapis.com/", |
| 72 core.String servicePath: "gmail/v1/users/"}) |
| 73 : _requester = |
| 74 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
63 } | 75 } |
64 | 76 |
65 | |
66 class UsersResourceApi { | 77 class UsersResourceApi { |
67 final commons.ApiRequester _requester; | 78 final commons.ApiRequester _requester; |
68 | 79 |
69 UsersDraftsResourceApi get drafts => new UsersDraftsResourceApi(_requester); | 80 UsersDraftsResourceApi get drafts => new UsersDraftsResourceApi(_requester); |
70 UsersHistoryResourceApi get history => new UsersHistoryResourceApi(_requester)
; | 81 UsersHistoryResourceApi get history => |
| 82 new UsersHistoryResourceApi(_requester); |
71 UsersLabelsResourceApi get labels => new UsersLabelsResourceApi(_requester); | 83 UsersLabelsResourceApi get labels => new UsersLabelsResourceApi(_requester); |
72 UsersMessagesResourceApi get messages => new UsersMessagesResourceApi(_request
er); | 84 UsersMessagesResourceApi get messages => |
73 UsersSettingsResourceApi get settings => new UsersSettingsResourceApi(_request
er); | 85 new UsersMessagesResourceApi(_requester); |
74 UsersThreadsResourceApi get threads => new UsersThreadsResourceApi(_requester)
; | 86 UsersSettingsResourceApi get settings => |
| 87 new UsersSettingsResourceApi(_requester); |
| 88 UsersThreadsResourceApi get threads => |
| 89 new UsersThreadsResourceApi(_requester); |
75 | 90 |
76 UsersResourceApi(commons.ApiRequester client) : | 91 UsersResourceApi(commons.ApiRequester client) : _requester = client; |
77 _requester = client; | |
78 | 92 |
79 /** | 93 /// Gets the current user's Gmail profile. |
80 * Gets the current user's Gmail profile. | 94 /// |
81 * | 95 /// Request parameters: |
82 * Request parameters: | 96 /// |
83 * | 97 /// [userId] - The user's email address. The special value me can be used to |
84 * [userId] - The user's email address. The special value me can be used to | 98 /// indicate the authenticated user. |
85 * indicate the authenticated user. | 99 /// |
86 * | 100 /// Completes with a [Profile]. |
87 * Completes with a [Profile]. | 101 /// |
88 * | 102 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
89 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 103 /// an error. |
90 * error. | 104 /// |
91 * | 105 /// If the used [http.Client] completes with an error when making a REST |
92 * If the used [http.Client] completes with an error when making a REST call, | 106 /// call, this method will complete with the same error. |
93 * this method will complete with the same error. | |
94 */ | |
95 async.Future<Profile> getProfile(core.String userId) { | 107 async.Future<Profile> getProfile(core.String userId) { |
96 var _url = null; | 108 var _url = null; |
97 var _queryParams = new core.Map(); | 109 var _queryParams = new core.Map(); |
98 var _uploadMedia = null; | 110 var _uploadMedia = null; |
99 var _uploadOptions = null; | 111 var _uploadOptions = null; |
100 var _downloadOptions = commons.DownloadOptions.Metadata; | 112 var _downloadOptions = commons.DownloadOptions.Metadata; |
101 var _body = null; | 113 var _body = null; |
102 | 114 |
103 if (userId == null) { | 115 if (userId == null) { |
104 throw new core.ArgumentError("Parameter userId is required."); | 116 throw new core.ArgumentError("Parameter userId is required."); |
105 } | 117 } |
106 | 118 |
107 _url = commons.Escaper.ecapeVariable('$userId') + '/profile'; | 119 _url = commons.Escaper.ecapeVariable('$userId') + '/profile'; |
108 | 120 |
109 var _response = _requester.request(_url, | 121 var _response = _requester.request(_url, "GET", |
110 "GET", | 122 body: _body, |
111 body: _body, | 123 queryParams: _queryParams, |
112 queryParams: _queryParams, | 124 uploadOptions: _uploadOptions, |
113 uploadOptions: _uploadOptions, | 125 uploadMedia: _uploadMedia, |
114 uploadMedia: _uploadMedia, | 126 downloadOptions: _downloadOptions); |
115 downloadOptions: _downloadOptions); | |
116 return _response.then((data) => new Profile.fromJson(data)); | 127 return _response.then((data) => new Profile.fromJson(data)); |
117 } | 128 } |
118 | 129 |
119 /** | 130 /// Stop receiving push notifications for the given user mailbox. |
120 * Stop receiving push notifications for the given user mailbox. | 131 /// |
121 * | 132 /// Request parameters: |
122 * Request parameters: | 133 /// |
123 * | 134 /// [userId] - The user's email address. The special value me can be used to |
124 * [userId] - The user's email address. The special value me can be used to | 135 /// indicate the authenticated user. |
125 * indicate the authenticated user. | 136 /// |
126 * | 137 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
127 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 138 /// an error. |
128 * error. | 139 /// |
129 * | 140 /// If the used [http.Client] completes with an error when making a REST |
130 * If the used [http.Client] completes with an error when making a REST call, | 141 /// call, this method will complete with the same error. |
131 * this method will complete with the same error. | |
132 */ | |
133 async.Future stop(core.String userId) { | 142 async.Future stop(core.String userId) { |
134 var _url = null; | 143 var _url = null; |
135 var _queryParams = new core.Map(); | 144 var _queryParams = new core.Map(); |
136 var _uploadMedia = null; | 145 var _uploadMedia = null; |
137 var _uploadOptions = null; | 146 var _uploadOptions = null; |
138 var _downloadOptions = commons.DownloadOptions.Metadata; | 147 var _downloadOptions = commons.DownloadOptions.Metadata; |
139 var _body = null; | 148 var _body = null; |
140 | 149 |
141 if (userId == null) { | 150 if (userId == null) { |
142 throw new core.ArgumentError("Parameter userId is required."); | 151 throw new core.ArgumentError("Parameter userId is required."); |
143 } | 152 } |
144 | 153 |
145 _downloadOptions = null; | 154 _downloadOptions = null; |
146 | 155 |
147 _url = commons.Escaper.ecapeVariable('$userId') + '/stop'; | 156 _url = commons.Escaper.ecapeVariable('$userId') + '/stop'; |
148 | 157 |
149 var _response = _requester.request(_url, | 158 var _response = _requester.request(_url, "POST", |
150 "POST", | 159 body: _body, |
151 body: _body, | 160 queryParams: _queryParams, |
152 queryParams: _queryParams, | 161 uploadOptions: _uploadOptions, |
153 uploadOptions: _uploadOptions, | 162 uploadMedia: _uploadMedia, |
154 uploadMedia: _uploadMedia, | 163 downloadOptions: _downloadOptions); |
155 downloadOptions: _downloadOptions); | |
156 return _response.then((data) => null); | 164 return _response.then((data) => null); |
157 } | 165 } |
158 | 166 |
159 /** | 167 /// Set up or update a push notification watch on the given user mailbox. |
160 * Set up or update a push notification watch on the given user mailbox. | 168 /// |
161 * | 169 /// [request] - The metadata request object. |
162 * [request] - The metadata request object. | 170 /// |
163 * | 171 /// Request parameters: |
164 * Request parameters: | 172 /// |
165 * | 173 /// [userId] - The user's email address. The special value me can be used to |
166 * [userId] - The user's email address. The special value me can be used to | 174 /// indicate the authenticated user. |
167 * indicate the authenticated user. | 175 /// |
168 * | 176 /// Completes with a [WatchResponse]. |
169 * Completes with a [WatchResponse]. | 177 /// |
170 * | 178 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
171 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 179 /// an error. |
172 * error. | 180 /// |
173 * | 181 /// If the used [http.Client] completes with an error when making a REST |
174 * If the used [http.Client] completes with an error when making a REST call, | 182 /// call, this method will complete with the same error. |
175 * this method will complete with the same error. | |
176 */ | |
177 async.Future<WatchResponse> watch(WatchRequest request, core.String userId) { | 183 async.Future<WatchResponse> watch(WatchRequest request, core.String userId) { |
178 var _url = null; | 184 var _url = null; |
179 var _queryParams = new core.Map(); | 185 var _queryParams = new core.Map(); |
180 var _uploadMedia = null; | 186 var _uploadMedia = null; |
181 var _uploadOptions = null; | 187 var _uploadOptions = null; |
182 var _downloadOptions = commons.DownloadOptions.Metadata; | 188 var _downloadOptions = commons.DownloadOptions.Metadata; |
183 var _body = null; | 189 var _body = null; |
184 | 190 |
185 if (request != null) { | 191 if (request != null) { |
186 _body = convert.JSON.encode((request).toJson()); | 192 _body = convert.JSON.encode((request).toJson()); |
187 } | 193 } |
188 if (userId == null) { | 194 if (userId == null) { |
189 throw new core.ArgumentError("Parameter userId is required."); | 195 throw new core.ArgumentError("Parameter userId is required."); |
190 } | 196 } |
191 | 197 |
192 _url = commons.Escaper.ecapeVariable('$userId') + '/watch'; | 198 _url = commons.Escaper.ecapeVariable('$userId') + '/watch'; |
193 | 199 |
194 var _response = _requester.request(_url, | 200 var _response = _requester.request(_url, "POST", |
195 "POST", | 201 body: _body, |
196 body: _body, | 202 queryParams: _queryParams, |
197 queryParams: _queryParams, | 203 uploadOptions: _uploadOptions, |
198 uploadOptions: _uploadOptions, | 204 uploadMedia: _uploadMedia, |
199 uploadMedia: _uploadMedia, | 205 downloadOptions: _downloadOptions); |
200 downloadOptions: _downloadOptions); | |
201 return _response.then((data) => new WatchResponse.fromJson(data)); | 206 return _response.then((data) => new WatchResponse.fromJson(data)); |
202 } | 207 } |
203 | |
204 } | 208 } |
205 | 209 |
206 | |
207 class UsersDraftsResourceApi { | 210 class UsersDraftsResourceApi { |
208 final commons.ApiRequester _requester; | 211 final commons.ApiRequester _requester; |
209 | 212 |
210 UsersDraftsResourceApi(commons.ApiRequester client) : | 213 UsersDraftsResourceApi(commons.ApiRequester client) : _requester = client; |
211 _requester = client; | |
212 | 214 |
213 /** | 215 /// Creates a new draft with the DRAFT label. |
214 * Creates a new draft with the DRAFT label. | 216 /// |
215 * | 217 /// [request] - The metadata request object. |
216 * [request] - The metadata request object. | 218 /// |
217 * | 219 /// Request parameters: |
218 * Request parameters: | 220 /// |
219 * | 221 /// [userId] - The user's email address. The special value me can be used to |
220 * [userId] - The user's email address. The special value me can be used to | 222 /// indicate the authenticated user. |
221 * indicate the authenticated user. | 223 /// |
222 * | 224 /// [uploadMedia] - The media to upload. |
223 * [uploadMedia] - The media to upload. | 225 /// |
224 * | 226 /// [uploadOptions] - Options for the media upload. Streaming Media without |
225 * [uploadOptions] - Options for the media upload. Streaming Media without the | 227 /// the length being known ahead of time is only supported via resumable |
226 * length being known ahead of time is only supported via resumable uploads. | 228 /// uploads. |
227 * | 229 /// |
228 * Completes with a [Draft]. | 230 /// Completes with a [Draft]. |
229 * | 231 /// |
230 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 232 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
231 * error. | 233 /// an error. |
232 * | 234 /// |
233 * If the used [http.Client] completes with an error when making a REST call, | 235 /// If the used [http.Client] completes with an error when making a REST |
234 * this method will complete with the same error. | 236 /// call, this method will complete with the same error. |
235 */ | 237 async.Future<Draft> create(Draft request, core.String userId, |
236 async.Future<Draft> create(Draft request, core.String userId, {commons.UploadO
ptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}
) { | 238 {commons.UploadOptions uploadOptions: commons.UploadOptions.Default, |
| 239 commons.Media uploadMedia}) { |
237 var _url = null; | 240 var _url = null; |
238 var _queryParams = new core.Map(); | 241 var _queryParams = new core.Map(); |
239 var _uploadMedia = null; | 242 var _uploadMedia = null; |
240 var _uploadOptions = null; | 243 var _uploadOptions = null; |
241 var _downloadOptions = commons.DownloadOptions.Metadata; | 244 var _downloadOptions = commons.DownloadOptions.Metadata; |
242 var _body = null; | 245 var _body = null; |
243 | 246 |
244 if (request != null) { | 247 if (request != null) { |
245 _body = convert.JSON.encode((request).toJson()); | 248 _body = convert.JSON.encode((request).toJson()); |
246 } | 249 } |
247 if (userId == null) { | 250 if (userId == null) { |
248 throw new core.ArgumentError("Parameter userId is required."); | 251 throw new core.ArgumentError("Parameter userId is required."); |
249 } | 252 } |
250 | 253 |
251 _uploadMedia = uploadMedia; | 254 _uploadMedia = uploadMedia; |
252 _uploadOptions = uploadOptions; | 255 _uploadOptions = uploadOptions; |
253 | 256 |
254 if (_uploadMedia == null) { | 257 if (_uploadMedia == null) { |
255 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; | 258 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; |
256 } else if (_uploadOptions is commons.ResumableUploadOptions) { | 259 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
257 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/drafts'; | 260 _url = '/resumable/upload/gmail/v1/users/' + |
| 261 commons.Escaper.ecapeVariable('$userId') + |
| 262 '/drafts'; |
258 } else { | 263 } else { |
259 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/drafts'; | 264 _url = '/upload/gmail/v1/users/' + |
| 265 commons.Escaper.ecapeVariable('$userId') + |
| 266 '/drafts'; |
260 } | 267 } |
261 | 268 |
262 | 269 var _response = _requester.request(_url, "POST", |
263 var _response = _requester.request(_url, | 270 body: _body, |
264 "POST", | 271 queryParams: _queryParams, |
265 body: _body, | 272 uploadOptions: _uploadOptions, |
266 queryParams: _queryParams, | 273 uploadMedia: _uploadMedia, |
267 uploadOptions: _uploadOptions, | 274 downloadOptions: _downloadOptions); |
268 uploadMedia: _uploadMedia, | |
269 downloadOptions: _downloadOptions); | |
270 return _response.then((data) => new Draft.fromJson(data)); | 275 return _response.then((data) => new Draft.fromJson(data)); |
271 } | 276 } |
272 | 277 |
273 /** | 278 /// Immediately and permanently deletes the specified draft. Does not simply |
274 * Immediately and permanently deletes the specified draft. Does not simply | 279 /// trash it. |
275 * trash it. | 280 /// |
276 * | 281 /// Request parameters: |
277 * Request parameters: | 282 /// |
278 * | 283 /// [userId] - The user's email address. The special value me can be used to |
279 * [userId] - The user's email address. The special value me can be used to | 284 /// indicate the authenticated user. |
280 * indicate the authenticated user. | 285 /// |
281 * | 286 /// [id] - The ID of the draft to delete. |
282 * [id] - The ID of the draft to delete. | 287 /// |
283 * | 288 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
284 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 289 /// an error. |
285 * error. | 290 /// |
286 * | 291 /// If the used [http.Client] completes with an error when making a REST |
287 * If the used [http.Client] completes with an error when making a REST call, | 292 /// call, this method will complete with the same error. |
288 * this method will complete with the same error. | |
289 */ | |
290 async.Future delete(core.String userId, core.String id) { | 293 async.Future delete(core.String userId, core.String id) { |
291 var _url = null; | 294 var _url = null; |
292 var _queryParams = new core.Map(); | 295 var _queryParams = new core.Map(); |
293 var _uploadMedia = null; | 296 var _uploadMedia = null; |
294 var _uploadOptions = null; | 297 var _uploadOptions = null; |
295 var _downloadOptions = commons.DownloadOptions.Metadata; | 298 var _downloadOptions = commons.DownloadOptions.Metadata; |
296 var _body = null; | 299 var _body = null; |
297 | 300 |
298 if (userId == null) { | 301 if (userId == null) { |
299 throw new core.ArgumentError("Parameter userId is required."); | 302 throw new core.ArgumentError("Parameter userId is required."); |
300 } | 303 } |
301 if (id == null) { | 304 if (id == null) { |
302 throw new core.ArgumentError("Parameter id is required."); | 305 throw new core.ArgumentError("Parameter id is required."); |
303 } | 306 } |
304 | 307 |
305 _downloadOptions = null; | 308 _downloadOptions = null; |
306 | 309 |
307 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/' + commons.Escap
er.ecapeVariable('$id'); | 310 _url = commons.Escaper.ecapeVariable('$userId') + |
| 311 '/drafts/' + |
| 312 commons.Escaper.ecapeVariable('$id'); |
308 | 313 |
309 var _response = _requester.request(_url, | 314 var _response = _requester.request(_url, "DELETE", |
310 "DELETE", | 315 body: _body, |
311 body: _body, | 316 queryParams: _queryParams, |
312 queryParams: _queryParams, | 317 uploadOptions: _uploadOptions, |
313 uploadOptions: _uploadOptions, | 318 uploadMedia: _uploadMedia, |
314 uploadMedia: _uploadMedia, | 319 downloadOptions: _downloadOptions); |
315 downloadOptions: _downloadOptions); | |
316 return _response.then((data) => null); | 320 return _response.then((data) => null); |
317 } | 321 } |
318 | 322 |
319 /** | 323 /// Gets the specified draft. |
320 * Gets the specified draft. | 324 /// |
321 * | 325 /// Request parameters: |
322 * Request parameters: | 326 /// |
323 * | 327 /// [userId] - The user's email address. The special value me can be used to |
324 * [userId] - The user's email address. The special value me can be used to | 328 /// indicate the authenticated user. |
325 * indicate the authenticated user. | 329 /// |
326 * | 330 /// [id] - The ID of the draft to retrieve. |
327 * [id] - The ID of the draft to retrieve. | 331 /// |
328 * | 332 /// [format] - The format to return the draft in. |
329 * [format] - The format to return the draft in. | 333 /// Possible string values are: |
330 * Possible string values are: | 334 /// - "full" |
331 * - "full" | 335 /// - "metadata" |
332 * - "metadata" | 336 /// - "minimal" |
333 * - "minimal" | 337 /// - "raw" |
334 * - "raw" | 338 /// |
335 * | 339 /// Completes with a [Draft]. |
336 * Completes with a [Draft]. | 340 /// |
337 * | 341 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
338 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 342 /// an error. |
339 * error. | 343 /// |
340 * | 344 /// If the used [http.Client] completes with an error when making a REST |
341 * If the used [http.Client] completes with an error when making a REST call, | 345 /// call, this method will complete with the same error. |
342 * this method will complete with the same error. | 346 async.Future<Draft> get(core.String userId, core.String id, |
343 */ | 347 {core.String format}) { |
344 async.Future<Draft> get(core.String userId, core.String id, {core.String forma
t}) { | |
345 var _url = null; | 348 var _url = null; |
346 var _queryParams = new core.Map(); | 349 var _queryParams = new core.Map(); |
347 var _uploadMedia = null; | 350 var _uploadMedia = null; |
348 var _uploadOptions = null; | 351 var _uploadOptions = null; |
349 var _downloadOptions = commons.DownloadOptions.Metadata; | 352 var _downloadOptions = commons.DownloadOptions.Metadata; |
350 var _body = null; | 353 var _body = null; |
351 | 354 |
352 if (userId == null) { | 355 if (userId == null) { |
353 throw new core.ArgumentError("Parameter userId is required."); | 356 throw new core.ArgumentError("Parameter userId is required."); |
354 } | 357 } |
355 if (id == null) { | 358 if (id == null) { |
356 throw new core.ArgumentError("Parameter id is required."); | 359 throw new core.ArgumentError("Parameter id is required."); |
357 } | 360 } |
358 if (format != null) { | 361 if (format != null) { |
359 _queryParams["format"] = [format]; | 362 _queryParams["format"] = [format]; |
360 } | 363 } |
361 | 364 |
362 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/' + commons.Escap
er.ecapeVariable('$id'); | 365 _url = commons.Escaper.ecapeVariable('$userId') + |
| 366 '/drafts/' + |
| 367 commons.Escaper.ecapeVariable('$id'); |
363 | 368 |
364 var _response = _requester.request(_url, | 369 var _response = _requester.request(_url, "GET", |
365 "GET", | 370 body: _body, |
366 body: _body, | 371 queryParams: _queryParams, |
367 queryParams: _queryParams, | 372 uploadOptions: _uploadOptions, |
368 uploadOptions: _uploadOptions, | 373 uploadMedia: _uploadMedia, |
369 uploadMedia: _uploadMedia, | 374 downloadOptions: _downloadOptions); |
370 downloadOptions: _downloadOptions); | |
371 return _response.then((data) => new Draft.fromJson(data)); | 375 return _response.then((data) => new Draft.fromJson(data)); |
372 } | 376 } |
373 | 377 |
374 /** | 378 /// Lists the drafts in the user's mailbox. |
375 * Lists the drafts in the user's mailbox. | 379 /// |
376 * | 380 /// Request parameters: |
377 * Request parameters: | 381 /// |
378 * | 382 /// [userId] - The user's email address. The special value me can be used to |
379 * [userId] - The user's email address. The special value me can be used to | 383 /// indicate the authenticated user. |
380 * indicate the authenticated user. | 384 /// |
381 * | 385 /// [includeSpamTrash] - Include drafts from SPAM and TRASH in the results. |
382 * [includeSpamTrash] - Include drafts from SPAM and TRASH in the results. | 386 /// |
383 * | 387 /// [maxResults] - Maximum number of drafts to return. |
384 * [maxResults] - Maximum number of drafts to return. | 388 /// |
385 * | 389 /// [pageToken] - Page token to retrieve a specific page of results in the |
386 * [pageToken] - Page token to retrieve a specific page of results in the | 390 /// list. |
387 * list. | 391 /// |
388 * | 392 /// [q] - Only return draft messages matching the specified query. Supports |
389 * [q] - Only return draft messages matching the specified query. Supports the | 393 /// the same query format as the Gmail search box. For example, |
390 * same query format as the Gmail search box. For example, | 394 /// "from:someuser@example.com rfc822msgid: is:unread". |
391 * "from:someuser@example.com rfc822msgid: is:unread". | 395 /// |
392 * | 396 /// Completes with a [ListDraftsResponse]. |
393 * Completes with a [ListDraftsResponse]. | 397 /// |
394 * | 398 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
395 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 399 /// an error. |
396 * error. | 400 /// |
397 * | 401 /// If the used [http.Client] completes with an error when making a REST |
398 * If the used [http.Client] completes with an error when making a REST call, | 402 /// call, this method will complete with the same error. |
399 * this method will complete with the same error. | 403 async.Future<ListDraftsResponse> list(core.String userId, |
400 */ | 404 {core.bool includeSpamTrash, |
401 async.Future<ListDraftsResponse> list(core.String userId, {core.bool includeSp
amTrash, core.int maxResults, core.String pageToken, core.String q}) { | 405 core.int maxResults, |
| 406 core.String pageToken, |
| 407 core.String q}) { |
402 var _url = null; | 408 var _url = null; |
403 var _queryParams = new core.Map(); | 409 var _queryParams = new core.Map(); |
404 var _uploadMedia = null; | 410 var _uploadMedia = null; |
405 var _uploadOptions = null; | 411 var _uploadOptions = null; |
406 var _downloadOptions = commons.DownloadOptions.Metadata; | 412 var _downloadOptions = commons.DownloadOptions.Metadata; |
407 var _body = null; | 413 var _body = null; |
408 | 414 |
409 if (userId == null) { | 415 if (userId == null) { |
410 throw new core.ArgumentError("Parameter userId is required."); | 416 throw new core.ArgumentError("Parameter userId is required."); |
411 } | 417 } |
412 if (includeSpamTrash != null) { | 418 if (includeSpamTrash != null) { |
413 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; | 419 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; |
414 } | 420 } |
415 if (maxResults != null) { | 421 if (maxResults != null) { |
416 _queryParams["maxResults"] = ["${maxResults}"]; | 422 _queryParams["maxResults"] = ["${maxResults}"]; |
417 } | 423 } |
418 if (pageToken != null) { | 424 if (pageToken != null) { |
419 _queryParams["pageToken"] = [pageToken]; | 425 _queryParams["pageToken"] = [pageToken]; |
420 } | 426 } |
421 if (q != null) { | 427 if (q != null) { |
422 _queryParams["q"] = [q]; | 428 _queryParams["q"] = [q]; |
423 } | 429 } |
424 | 430 |
425 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; | 431 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts'; |
426 | 432 |
427 var _response = _requester.request(_url, | 433 var _response = _requester.request(_url, "GET", |
428 "GET", | 434 body: _body, |
429 body: _body, | 435 queryParams: _queryParams, |
430 queryParams: _queryParams, | 436 uploadOptions: _uploadOptions, |
431 uploadOptions: _uploadOptions, | 437 uploadMedia: _uploadMedia, |
432 uploadMedia: _uploadMedia, | 438 downloadOptions: _downloadOptions); |
433 downloadOptions: _downloadOptions); | |
434 return _response.then((data) => new ListDraftsResponse.fromJson(data)); | 439 return _response.then((data) => new ListDraftsResponse.fromJson(data)); |
435 } | 440 } |
436 | 441 |
437 /** | 442 /// Sends the specified, existing draft to the recipients in the To, Cc, and |
438 * Sends the specified, existing draft to the recipients in the To, Cc, and | 443 /// Bcc headers. |
439 * Bcc headers. | 444 /// |
440 * | 445 /// [request] - The metadata request object. |
441 * [request] - The metadata request object. | 446 /// |
442 * | 447 /// Request parameters: |
443 * Request parameters: | 448 /// |
444 * | 449 /// [userId] - The user's email address. The special value me can be used to |
445 * [userId] - The user's email address. The special value me can be used to | 450 /// indicate the authenticated user. |
446 * indicate the authenticated user. | 451 /// |
447 * | 452 /// [uploadMedia] - The media to upload. |
448 * [uploadMedia] - The media to upload. | 453 /// |
449 * | 454 /// [uploadOptions] - Options for the media upload. Streaming Media without |
450 * [uploadOptions] - Options for the media upload. Streaming Media without the | 455 /// the length being known ahead of time is only supported via resumable |
451 * length being known ahead of time is only supported via resumable uploads. | 456 /// uploads. |
452 * | 457 /// |
453 * Completes with a [Message]. | 458 /// Completes with a [Message]. |
454 * | 459 /// |
455 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 460 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
456 * error. | 461 /// an error. |
457 * | 462 /// |
458 * If the used [http.Client] completes with an error when making a REST call, | 463 /// If the used [http.Client] completes with an error when making a REST |
459 * this method will complete with the same error. | 464 /// call, this method will complete with the same error. |
460 */ | 465 async.Future<Message> send(Draft request, core.String userId, |
461 async.Future<Message> send(Draft request, core.String userId, {commons.UploadO
ptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}
) { | 466 {commons.UploadOptions uploadOptions: commons.UploadOptions.Default, |
| 467 commons.Media uploadMedia}) { |
462 var _url = null; | 468 var _url = null; |
463 var _queryParams = new core.Map(); | 469 var _queryParams = new core.Map(); |
464 var _uploadMedia = null; | 470 var _uploadMedia = null; |
465 var _uploadOptions = null; | 471 var _uploadOptions = null; |
466 var _downloadOptions = commons.DownloadOptions.Metadata; | 472 var _downloadOptions = commons.DownloadOptions.Metadata; |
467 var _body = null; | 473 var _body = null; |
468 | 474 |
469 if (request != null) { | 475 if (request != null) { |
470 _body = convert.JSON.encode((request).toJson()); | 476 _body = convert.JSON.encode((request).toJson()); |
471 } | 477 } |
472 if (userId == null) { | 478 if (userId == null) { |
473 throw new core.ArgumentError("Parameter userId is required."); | 479 throw new core.ArgumentError("Parameter userId is required."); |
474 } | 480 } |
475 | 481 |
476 _uploadMedia = uploadMedia; | 482 _uploadMedia = uploadMedia; |
477 _uploadOptions = uploadOptions; | 483 _uploadOptions = uploadOptions; |
478 | 484 |
479 if (_uploadMedia == null) { | 485 if (_uploadMedia == null) { |
480 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/send'; | 486 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/send'; |
481 } else if (_uploadOptions is commons.ResumableUploadOptions) { | 487 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
482 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/drafts/send'; | 488 _url = '/resumable/upload/gmail/v1/users/' + |
| 489 commons.Escaper.ecapeVariable('$userId') + |
| 490 '/drafts/send'; |
483 } else { | 491 } else { |
484 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/drafts/send'; | 492 _url = '/upload/gmail/v1/users/' + |
| 493 commons.Escaper.ecapeVariable('$userId') + |
| 494 '/drafts/send'; |
485 } | 495 } |
486 | 496 |
487 | 497 var _response = _requester.request(_url, "POST", |
488 var _response = _requester.request(_url, | 498 body: _body, |
489 "POST", | 499 queryParams: _queryParams, |
490 body: _body, | 500 uploadOptions: _uploadOptions, |
491 queryParams: _queryParams, | 501 uploadMedia: _uploadMedia, |
492 uploadOptions: _uploadOptions, | 502 downloadOptions: _downloadOptions); |
493 uploadMedia: _uploadMedia, | |
494 downloadOptions: _downloadOptions); | |
495 return _response.then((data) => new Message.fromJson(data)); | 503 return _response.then((data) => new Message.fromJson(data)); |
496 } | 504 } |
497 | 505 |
498 /** | 506 /// Replaces a draft's content. |
499 * Replaces a draft's content. | 507 /// |
500 * | 508 /// [request] - The metadata request object. |
501 * [request] - The metadata request object. | 509 /// |
502 * | 510 /// Request parameters: |
503 * Request parameters: | 511 /// |
504 * | 512 /// [userId] - The user's email address. The special value me can be used to |
505 * [userId] - The user's email address. The special value me can be used to | 513 /// indicate the authenticated user. |
506 * indicate the authenticated user. | 514 /// |
507 * | 515 /// [id] - The ID of the draft to update. |
508 * [id] - The ID of the draft to update. | 516 /// |
509 * | 517 /// [uploadMedia] - The media to upload. |
510 * [uploadMedia] - The media to upload. | 518 /// |
511 * | 519 /// [uploadOptions] - Options for the media upload. Streaming Media without |
512 * [uploadOptions] - Options for the media upload. Streaming Media without the | 520 /// the length being known ahead of time is only supported via resumable |
513 * length being known ahead of time is only supported via resumable uploads. | 521 /// uploads. |
514 * | 522 /// |
515 * Completes with a [Draft]. | 523 /// Completes with a [Draft]. |
516 * | 524 /// |
517 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 525 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
518 * error. | 526 /// an error. |
519 * | 527 /// |
520 * If the used [http.Client] completes with an error when making a REST call, | 528 /// If the used [http.Client] completes with an error when making a REST |
521 * this method will complete with the same error. | 529 /// call, this method will complete with the same error. |
522 */ | 530 async.Future<Draft> update(Draft request, core.String userId, core.String id, |
523 async.Future<Draft> update(Draft request, core.String userId, core.String id,
{commons.UploadOptions uploadOptions : commons.UploadOptions.Default, commons.Me
dia uploadMedia}) { | 531 {commons.UploadOptions uploadOptions: commons.UploadOptions.Default, |
| 532 commons.Media uploadMedia}) { |
524 var _url = null; | 533 var _url = null; |
525 var _queryParams = new core.Map(); | 534 var _queryParams = new core.Map(); |
526 var _uploadMedia = null; | 535 var _uploadMedia = null; |
527 var _uploadOptions = null; | 536 var _uploadOptions = null; |
528 var _downloadOptions = commons.DownloadOptions.Metadata; | 537 var _downloadOptions = commons.DownloadOptions.Metadata; |
529 var _body = null; | 538 var _body = null; |
530 | 539 |
531 if (request != null) { | 540 if (request != null) { |
532 _body = convert.JSON.encode((request).toJson()); | 541 _body = convert.JSON.encode((request).toJson()); |
533 } | 542 } |
534 if (userId == null) { | 543 if (userId == null) { |
535 throw new core.ArgumentError("Parameter userId is required."); | 544 throw new core.ArgumentError("Parameter userId is required."); |
536 } | 545 } |
537 if (id == null) { | 546 if (id == null) { |
538 throw new core.ArgumentError("Parameter id is required."); | 547 throw new core.ArgumentError("Parameter id is required."); |
539 } | 548 } |
540 | 549 |
541 _uploadMedia = uploadMedia; | 550 _uploadMedia = uploadMedia; |
542 _uploadOptions = uploadOptions; | 551 _uploadOptions = uploadOptions; |
543 | 552 |
544 if (_uploadMedia == null) { | 553 if (_uploadMedia == null) { |
545 _url = commons.Escaper.ecapeVariable('$userId') + '/drafts/' + commons.Esc
aper.ecapeVariable('$id'); | 554 _url = commons.Escaper.ecapeVariable('$userId') + |
| 555 '/drafts/' + |
| 556 commons.Escaper.ecapeVariable('$id'); |
546 } else if (_uploadOptions is commons.ResumableUploadOptions) { | 557 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
547 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/drafts/' + commons.Escaper.ecapeVariable('$id'); | 558 _url = '/resumable/upload/gmail/v1/users/' + |
| 559 commons.Escaper.ecapeVariable('$userId') + |
| 560 '/drafts/' + |
| 561 commons.Escaper.ecapeVariable('$id'); |
548 } else { | 562 } else { |
549 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/drafts/' + commons.Escaper.ecapeVariable('$id'); | 563 _url = '/upload/gmail/v1/users/' + |
| 564 commons.Escaper.ecapeVariable('$userId') + |
| 565 '/drafts/' + |
| 566 commons.Escaper.ecapeVariable('$id'); |
550 } | 567 } |
551 | 568 |
552 | 569 var _response = _requester.request(_url, "PUT", |
553 var _response = _requester.request(_url, | 570 body: _body, |
554 "PUT", | 571 queryParams: _queryParams, |
555 body: _body, | 572 uploadOptions: _uploadOptions, |
556 queryParams: _queryParams, | 573 uploadMedia: _uploadMedia, |
557 uploadOptions: _uploadOptions, | 574 downloadOptions: _downloadOptions); |
558 uploadMedia: _uploadMedia, | |
559 downloadOptions: _downloadOptions); | |
560 return _response.then((data) => new Draft.fromJson(data)); | 575 return _response.then((data) => new Draft.fromJson(data)); |
561 } | 576 } |
562 | |
563 } | 577 } |
564 | 578 |
565 | |
566 class UsersHistoryResourceApi { | 579 class UsersHistoryResourceApi { |
567 final commons.ApiRequester _requester; | 580 final commons.ApiRequester _requester; |
568 | 581 |
569 UsersHistoryResourceApi(commons.ApiRequester client) : | 582 UsersHistoryResourceApi(commons.ApiRequester client) : _requester = client; |
570 _requester = client; | |
571 | 583 |
572 /** | 584 /// Lists the history of all changes to the given mailbox. History results |
573 * Lists the history of all changes to the given mailbox. History results are | 585 /// are returned in chronological order (increasing historyId). |
574 * returned in chronological order (increasing historyId). | 586 /// |
575 * | 587 /// Request parameters: |
576 * Request parameters: | 588 /// |
577 * | 589 /// [userId] - The user's email address. The special value me can be used to |
578 * [userId] - The user's email address. The special value me can be used to | 590 /// indicate the authenticated user. |
579 * indicate the authenticated user. | 591 /// |
580 * | 592 /// [historyTypes] - History types to be returned by the function |
581 * [historyTypes] - History types to be returned by the function | 593 /// |
582 * | 594 /// [labelId] - Only return messages with a label matching the ID. |
583 * [labelId] - Only return messages with a label matching the ID. | 595 /// |
584 * | 596 /// [maxResults] - The maximum number of history records to return. |
585 * [maxResults] - The maximum number of history records to return. | 597 /// |
586 * | 598 /// [pageToken] - Page token to retrieve a specific page of results in the |
587 * [pageToken] - Page token to retrieve a specific page of results in the | 599 /// list. |
588 * list. | 600 /// |
589 * | 601 /// [startHistoryId] - Required. Returns history records after the specified |
590 * [startHistoryId] - Required. Returns history records after the specified | 602 /// startHistoryId. The supplied startHistoryId should be obtained from the |
591 * startHistoryId. The supplied startHistoryId should be obtained from the | 603 /// historyId of a message, thread, or previous list response. History IDs |
592 * historyId of a message, thread, or previous list response. History IDs | 604 /// increase chronologically but are not contiguous with random gaps in |
593 * increase chronologically but are not contiguous with random gaps in between | 605 /// between valid IDs. Supplying an invalid or out of date startHistoryId |
594 * valid IDs. Supplying an invalid or out of date startHistoryId typically | 606 /// typically returns an HTTP 404 error code. A historyId is typically valid |
595 * returns an HTTP 404 error code. A historyId is typically valid for at least | 607 /// for at least a week, but in some rare circumstances may be valid for only |
596 * a week, but in some rare circumstances may be valid for only a few hours. | 608 /// a few hours. If you receive an HTTP 404 error response, your application |
597 * If you receive an HTTP 404 error response, your application should perform | 609 /// should perform a full sync. If you receive no nextPageToken in the |
598 * a full sync. If you receive no nextPageToken in the response, there are no | 610 /// response, there are no updates to retrieve and you can store the returned |
599 * updates to retrieve and you can store the returned historyId for a future | 611 /// historyId for a future request. |
600 * request. | 612 /// |
601 * | 613 /// Completes with a [ListHistoryResponse]. |
602 * Completes with a [ListHistoryResponse]. | 614 /// |
603 * | 615 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
604 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 616 /// an error. |
605 * error. | 617 /// |
606 * | 618 /// If the used [http.Client] completes with an error when making a REST |
607 * If the used [http.Client] completes with an error when making a REST call, | 619 /// call, this method will complete with the same error. |
608 * this method will complete with the same error. | 620 async.Future<ListHistoryResponse> list(core.String userId, |
609 */ | 621 {core.List<core.String> historyTypes, |
610 async.Future<ListHistoryResponse> list(core.String userId, {core.List<core.Str
ing> historyTypes, core.String labelId, core.int maxResults, core.String pageTok
en, core.String startHistoryId}) { | 622 core.String labelId, |
| 623 core.int maxResults, |
| 624 core.String pageToken, |
| 625 core.String startHistoryId}) { |
611 var _url = null; | 626 var _url = null; |
612 var _queryParams = new core.Map(); | 627 var _queryParams = new core.Map(); |
613 var _uploadMedia = null; | 628 var _uploadMedia = null; |
614 var _uploadOptions = null; | 629 var _uploadOptions = null; |
615 var _downloadOptions = commons.DownloadOptions.Metadata; | 630 var _downloadOptions = commons.DownloadOptions.Metadata; |
616 var _body = null; | 631 var _body = null; |
617 | 632 |
618 if (userId == null) { | 633 if (userId == null) { |
619 throw new core.ArgumentError("Parameter userId is required."); | 634 throw new core.ArgumentError("Parameter userId is required."); |
620 } | 635 } |
621 if (historyTypes != null) { | 636 if (historyTypes != null) { |
622 _queryParams["historyTypes"] = historyTypes; | 637 _queryParams["historyTypes"] = historyTypes; |
623 } | 638 } |
624 if (labelId != null) { | 639 if (labelId != null) { |
625 _queryParams["labelId"] = [labelId]; | 640 _queryParams["labelId"] = [labelId]; |
626 } | 641 } |
627 if (maxResults != null) { | 642 if (maxResults != null) { |
628 _queryParams["maxResults"] = ["${maxResults}"]; | 643 _queryParams["maxResults"] = ["${maxResults}"]; |
629 } | 644 } |
630 if (pageToken != null) { | 645 if (pageToken != null) { |
631 _queryParams["pageToken"] = [pageToken]; | 646 _queryParams["pageToken"] = [pageToken]; |
632 } | 647 } |
633 if (startHistoryId != null) { | 648 if (startHistoryId != null) { |
634 _queryParams["startHistoryId"] = [startHistoryId]; | 649 _queryParams["startHistoryId"] = [startHistoryId]; |
635 } | 650 } |
636 | 651 |
637 _url = commons.Escaper.ecapeVariable('$userId') + '/history'; | 652 _url = commons.Escaper.ecapeVariable('$userId') + '/history'; |
638 | 653 |
639 var _response = _requester.request(_url, | 654 var _response = _requester.request(_url, "GET", |
640 "GET", | 655 body: _body, |
641 body: _body, | 656 queryParams: _queryParams, |
642 queryParams: _queryParams, | 657 uploadOptions: _uploadOptions, |
643 uploadOptions: _uploadOptions, | 658 uploadMedia: _uploadMedia, |
644 uploadMedia: _uploadMedia, | 659 downloadOptions: _downloadOptions); |
645 downloadOptions: _downloadOptions); | |
646 return _response.then((data) => new ListHistoryResponse.fromJson(data)); | 660 return _response.then((data) => new ListHistoryResponse.fromJson(data)); |
647 } | 661 } |
648 | |
649 } | 662 } |
650 | 663 |
651 | |
652 class UsersLabelsResourceApi { | 664 class UsersLabelsResourceApi { |
653 final commons.ApiRequester _requester; | 665 final commons.ApiRequester _requester; |
654 | 666 |
655 UsersLabelsResourceApi(commons.ApiRequester client) : | 667 UsersLabelsResourceApi(commons.ApiRequester client) : _requester = client; |
656 _requester = client; | |
657 | 668 |
658 /** | 669 /// Creates a new label. |
659 * Creates a new label. | 670 /// |
660 * | 671 /// [request] - The metadata request object. |
661 * [request] - The metadata request object. | 672 /// |
662 * | 673 /// Request parameters: |
663 * Request parameters: | 674 /// |
664 * | 675 /// [userId] - The user's email address. The special value me can be used to |
665 * [userId] - The user's email address. The special value me can be used to | 676 /// indicate the authenticated user. |
666 * indicate the authenticated user. | 677 /// |
667 * | 678 /// Completes with a [Label]. |
668 * Completes with a [Label]. | 679 /// |
669 * | 680 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
670 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 681 /// an error. |
671 * error. | 682 /// |
672 * | 683 /// If the used [http.Client] completes with an error when making a REST |
673 * If the used [http.Client] completes with an error when making a REST call, | 684 /// call, this method will complete with the same error. |
674 * this method will complete with the same error. | |
675 */ | |
676 async.Future<Label> create(Label request, core.String userId) { | 685 async.Future<Label> create(Label request, core.String userId) { |
677 var _url = null; | 686 var _url = null; |
678 var _queryParams = new core.Map(); | 687 var _queryParams = new core.Map(); |
679 var _uploadMedia = null; | 688 var _uploadMedia = null; |
680 var _uploadOptions = null; | 689 var _uploadOptions = null; |
681 var _downloadOptions = commons.DownloadOptions.Metadata; | 690 var _downloadOptions = commons.DownloadOptions.Metadata; |
682 var _body = null; | 691 var _body = null; |
683 | 692 |
684 if (request != null) { | 693 if (request != null) { |
685 _body = convert.JSON.encode((request).toJson()); | 694 _body = convert.JSON.encode((request).toJson()); |
686 } | 695 } |
687 if (userId == null) { | 696 if (userId == null) { |
688 throw new core.ArgumentError("Parameter userId is required."); | 697 throw new core.ArgumentError("Parameter userId is required."); |
689 } | 698 } |
690 | 699 |
691 _url = commons.Escaper.ecapeVariable('$userId') + '/labels'; | 700 _url = commons.Escaper.ecapeVariable('$userId') + '/labels'; |
692 | 701 |
693 var _response = _requester.request(_url, | 702 var _response = _requester.request(_url, "POST", |
694 "POST", | 703 body: _body, |
695 body: _body, | 704 queryParams: _queryParams, |
696 queryParams: _queryParams, | 705 uploadOptions: _uploadOptions, |
697 uploadOptions: _uploadOptions, | 706 uploadMedia: _uploadMedia, |
698 uploadMedia: _uploadMedia, | 707 downloadOptions: _downloadOptions); |
699 downloadOptions: _downloadOptions); | |
700 return _response.then((data) => new Label.fromJson(data)); | 708 return _response.then((data) => new Label.fromJson(data)); |
701 } | 709 } |
702 | 710 |
703 /** | 711 /// Immediately and permanently deletes the specified label and removes it |
704 * Immediately and permanently deletes the specified label and removes it from | 712 /// from any messages and threads that it is applied to. |
705 * any messages and threads that it is applied to. | 713 /// |
706 * | 714 /// Request parameters: |
707 * Request parameters: | 715 /// |
708 * | 716 /// [userId] - The user's email address. The special value me can be used to |
709 * [userId] - The user's email address. The special value me can be used to | 717 /// indicate the authenticated user. |
710 * indicate the authenticated user. | 718 /// |
711 * | 719 /// [id] - The ID of the label to delete. |
712 * [id] - The ID of the label to delete. | 720 /// |
713 * | 721 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
714 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 722 /// an error. |
715 * error. | 723 /// |
716 * | 724 /// If the used [http.Client] completes with an error when making a REST |
717 * If the used [http.Client] completes with an error when making a REST call, | 725 /// call, this method will complete with the same error. |
718 * this method will complete with the same error. | |
719 */ | |
720 async.Future delete(core.String userId, core.String id) { | 726 async.Future delete(core.String userId, core.String id) { |
721 var _url = null; | 727 var _url = null; |
722 var _queryParams = new core.Map(); | 728 var _queryParams = new core.Map(); |
723 var _uploadMedia = null; | 729 var _uploadMedia = null; |
724 var _uploadOptions = null; | 730 var _uploadOptions = null; |
725 var _downloadOptions = commons.DownloadOptions.Metadata; | 731 var _downloadOptions = commons.DownloadOptions.Metadata; |
726 var _body = null; | 732 var _body = null; |
727 | 733 |
728 if (userId == null) { | 734 if (userId == null) { |
729 throw new core.ArgumentError("Parameter userId is required."); | 735 throw new core.ArgumentError("Parameter userId is required."); |
730 } | 736 } |
731 if (id == null) { | 737 if (id == null) { |
732 throw new core.ArgumentError("Parameter id is required."); | 738 throw new core.ArgumentError("Parameter id is required."); |
733 } | 739 } |
734 | 740 |
735 _downloadOptions = null; | 741 _downloadOptions = null; |
736 | 742 |
737 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); | 743 _url = commons.Escaper.ecapeVariable('$userId') + |
| 744 '/labels/' + |
| 745 commons.Escaper.ecapeVariable('$id'); |
738 | 746 |
739 var _response = _requester.request(_url, | 747 var _response = _requester.request(_url, "DELETE", |
740 "DELETE", | 748 body: _body, |
741 body: _body, | 749 queryParams: _queryParams, |
742 queryParams: _queryParams, | 750 uploadOptions: _uploadOptions, |
743 uploadOptions: _uploadOptions, | 751 uploadMedia: _uploadMedia, |
744 uploadMedia: _uploadMedia, | 752 downloadOptions: _downloadOptions); |
745 downloadOptions: _downloadOptions); | |
746 return _response.then((data) => null); | 753 return _response.then((data) => null); |
747 } | 754 } |
748 | 755 |
749 /** | 756 /// Gets the specified label. |
750 * Gets the specified label. | 757 /// |
751 * | 758 /// Request parameters: |
752 * Request parameters: | 759 /// |
753 * | 760 /// [userId] - The user's email address. The special value me can be used to |
754 * [userId] - The user's email address. The special value me can be used to | 761 /// indicate the authenticated user. |
755 * indicate the authenticated user. | 762 /// |
756 * | 763 /// [id] - The ID of the label to retrieve. |
757 * [id] - The ID of the label to retrieve. | 764 /// |
758 * | 765 /// Completes with a [Label]. |
759 * Completes with a [Label]. | 766 /// |
760 * | 767 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
761 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 768 /// an error. |
762 * error. | 769 /// |
763 * | 770 /// If the used [http.Client] completes with an error when making a REST |
764 * If the used [http.Client] completes with an error when making a REST call, | 771 /// call, this method will complete with the same error. |
765 * this method will complete with the same error. | |
766 */ | |
767 async.Future<Label> get(core.String userId, core.String id) { | 772 async.Future<Label> get(core.String userId, core.String id) { |
768 var _url = null; | 773 var _url = null; |
769 var _queryParams = new core.Map(); | 774 var _queryParams = new core.Map(); |
770 var _uploadMedia = null; | 775 var _uploadMedia = null; |
771 var _uploadOptions = null; | 776 var _uploadOptions = null; |
772 var _downloadOptions = commons.DownloadOptions.Metadata; | 777 var _downloadOptions = commons.DownloadOptions.Metadata; |
773 var _body = null; | 778 var _body = null; |
774 | 779 |
775 if (userId == null) { | 780 if (userId == null) { |
776 throw new core.ArgumentError("Parameter userId is required."); | 781 throw new core.ArgumentError("Parameter userId is required."); |
777 } | 782 } |
778 if (id == null) { | 783 if (id == null) { |
779 throw new core.ArgumentError("Parameter id is required."); | 784 throw new core.ArgumentError("Parameter id is required."); |
780 } | 785 } |
781 | 786 |
782 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); | 787 _url = commons.Escaper.ecapeVariable('$userId') + |
| 788 '/labels/' + |
| 789 commons.Escaper.ecapeVariable('$id'); |
783 | 790 |
784 var _response = _requester.request(_url, | 791 var _response = _requester.request(_url, "GET", |
785 "GET", | 792 body: _body, |
786 body: _body, | 793 queryParams: _queryParams, |
787 queryParams: _queryParams, | 794 uploadOptions: _uploadOptions, |
788 uploadOptions: _uploadOptions, | 795 uploadMedia: _uploadMedia, |
789 uploadMedia: _uploadMedia, | 796 downloadOptions: _downloadOptions); |
790 downloadOptions: _downloadOptions); | |
791 return _response.then((data) => new Label.fromJson(data)); | 797 return _response.then((data) => new Label.fromJson(data)); |
792 } | 798 } |
793 | 799 |
794 /** | 800 /// Lists all labels in the user's mailbox. |
795 * Lists all labels in the user's mailbox. | 801 /// |
796 * | 802 /// Request parameters: |
797 * Request parameters: | 803 /// |
798 * | 804 /// [userId] - The user's email address. The special value me can be used to |
799 * [userId] - The user's email address. The special value me can be used to | 805 /// indicate the authenticated user. |
800 * indicate the authenticated user. | 806 /// |
801 * | 807 /// Completes with a [ListLabelsResponse]. |
802 * Completes with a [ListLabelsResponse]. | 808 /// |
803 * | 809 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
804 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 810 /// an error. |
805 * error. | 811 /// |
806 * | 812 /// If the used [http.Client] completes with an error when making a REST |
807 * If the used [http.Client] completes with an error when making a REST call, | 813 /// call, this method will complete with the same error. |
808 * this method will complete with the same error. | |
809 */ | |
810 async.Future<ListLabelsResponse> list(core.String userId) { | 814 async.Future<ListLabelsResponse> list(core.String userId) { |
811 var _url = null; | 815 var _url = null; |
812 var _queryParams = new core.Map(); | 816 var _queryParams = new core.Map(); |
813 var _uploadMedia = null; | 817 var _uploadMedia = null; |
814 var _uploadOptions = null; | 818 var _uploadOptions = null; |
815 var _downloadOptions = commons.DownloadOptions.Metadata; | 819 var _downloadOptions = commons.DownloadOptions.Metadata; |
816 var _body = null; | 820 var _body = null; |
817 | 821 |
818 if (userId == null) { | 822 if (userId == null) { |
819 throw new core.ArgumentError("Parameter userId is required."); | 823 throw new core.ArgumentError("Parameter userId is required."); |
820 } | 824 } |
821 | 825 |
822 _url = commons.Escaper.ecapeVariable('$userId') + '/labels'; | 826 _url = commons.Escaper.ecapeVariable('$userId') + '/labels'; |
823 | 827 |
824 var _response = _requester.request(_url, | 828 var _response = _requester.request(_url, "GET", |
825 "GET", | 829 body: _body, |
826 body: _body, | 830 queryParams: _queryParams, |
827 queryParams: _queryParams, | 831 uploadOptions: _uploadOptions, |
828 uploadOptions: _uploadOptions, | 832 uploadMedia: _uploadMedia, |
829 uploadMedia: _uploadMedia, | 833 downloadOptions: _downloadOptions); |
830 downloadOptions: _downloadOptions); | |
831 return _response.then((data) => new ListLabelsResponse.fromJson(data)); | 834 return _response.then((data) => new ListLabelsResponse.fromJson(data)); |
832 } | 835 } |
833 | 836 |
834 /** | 837 /// Updates the specified label. This method supports patch semantics. |
835 * Updates the specified label. This method supports patch semantics. | 838 /// |
836 * | 839 /// [request] - The metadata request object. |
837 * [request] - The metadata request object. | 840 /// |
838 * | 841 /// Request parameters: |
839 * Request parameters: | 842 /// |
840 * | 843 /// [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 | 844 /// indicate the authenticated user. |
842 * indicate the authenticated user. | 845 /// |
843 * | 846 /// [id] - The ID of the label to update. |
844 * [id] - The ID of the label to update. | 847 /// |
845 * | 848 /// Completes with a [Label]. |
846 * Completes with a [Label]. | 849 /// |
847 * | 850 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
848 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 851 /// an error. |
849 * error. | 852 /// |
850 * | 853 /// If the used [http.Client] completes with an error when making a REST |
851 * If the used [http.Client] completes with an error when making a REST call, | 854 /// call, this method will complete with the same error. |
852 * this method will complete with the same error. | |
853 */ | |
854 async.Future<Label> patch(Label request, core.String userId, core.String id) { | 855 async.Future<Label> patch(Label request, core.String userId, core.String id) { |
855 var _url = null; | 856 var _url = null; |
856 var _queryParams = new core.Map(); | 857 var _queryParams = new core.Map(); |
857 var _uploadMedia = null; | 858 var _uploadMedia = null; |
858 var _uploadOptions = null; | 859 var _uploadOptions = null; |
859 var _downloadOptions = commons.DownloadOptions.Metadata; | 860 var _downloadOptions = commons.DownloadOptions.Metadata; |
860 var _body = null; | 861 var _body = null; |
861 | 862 |
862 if (request != null) { | 863 if (request != null) { |
863 _body = convert.JSON.encode((request).toJson()); | 864 _body = convert.JSON.encode((request).toJson()); |
864 } | 865 } |
865 if (userId == null) { | 866 if (userId == null) { |
866 throw new core.ArgumentError("Parameter userId is required."); | 867 throw new core.ArgumentError("Parameter userId is required."); |
867 } | 868 } |
868 if (id == null) { | 869 if (id == null) { |
869 throw new core.ArgumentError("Parameter id is required."); | 870 throw new core.ArgumentError("Parameter id is required."); |
870 } | 871 } |
871 | 872 |
872 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); | 873 _url = commons.Escaper.ecapeVariable('$userId') + |
| 874 '/labels/' + |
| 875 commons.Escaper.ecapeVariable('$id'); |
873 | 876 |
874 var _response = _requester.request(_url, | 877 var _response = _requester.request(_url, "PATCH", |
875 "PATCH", | 878 body: _body, |
876 body: _body, | 879 queryParams: _queryParams, |
877 queryParams: _queryParams, | 880 uploadOptions: _uploadOptions, |
878 uploadOptions: _uploadOptions, | 881 uploadMedia: _uploadMedia, |
879 uploadMedia: _uploadMedia, | 882 downloadOptions: _downloadOptions); |
880 downloadOptions: _downloadOptions); | |
881 return _response.then((data) => new Label.fromJson(data)); | 883 return _response.then((data) => new Label.fromJson(data)); |
882 } | 884 } |
883 | 885 |
884 /** | 886 /// Updates the specified label. |
885 * Updates the specified label. | 887 /// |
886 * | 888 /// [request] - The metadata request object. |
887 * [request] - The metadata request object. | 889 /// |
888 * | 890 /// Request parameters: |
889 * Request parameters: | 891 /// |
890 * | 892 /// [userId] - The user's email address. The special value me can be used to |
891 * [userId] - The user's email address. The special value me can be used to | 893 /// indicate the authenticated user. |
892 * indicate the authenticated user. | 894 /// |
893 * | 895 /// [id] - The ID of the label to update. |
894 * [id] - The ID of the label to update. | 896 /// |
895 * | 897 /// Completes with a [Label]. |
896 * Completes with a [Label]. | 898 /// |
897 * | 899 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
898 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 900 /// an error. |
899 * error. | 901 /// |
900 * | 902 /// If the used [http.Client] completes with an error when making a REST |
901 * If the used [http.Client] completes with an error when making a REST call, | 903 /// call, this method will complete with the same error. |
902 * this method will complete with the same error. | 904 async.Future<Label> update( |
903 */ | 905 Label request, core.String userId, core.String id) { |
904 async.Future<Label> update(Label request, core.String userId, core.String id)
{ | |
905 var _url = null; | 906 var _url = null; |
906 var _queryParams = new core.Map(); | 907 var _queryParams = new core.Map(); |
907 var _uploadMedia = null; | 908 var _uploadMedia = null; |
908 var _uploadOptions = null; | 909 var _uploadOptions = null; |
909 var _downloadOptions = commons.DownloadOptions.Metadata; | 910 var _downloadOptions = commons.DownloadOptions.Metadata; |
910 var _body = null; | 911 var _body = null; |
911 | 912 |
912 if (request != null) { | 913 if (request != null) { |
913 _body = convert.JSON.encode((request).toJson()); | 914 _body = convert.JSON.encode((request).toJson()); |
914 } | 915 } |
915 if (userId == null) { | 916 if (userId == null) { |
916 throw new core.ArgumentError("Parameter userId is required."); | 917 throw new core.ArgumentError("Parameter userId is required."); |
917 } | 918 } |
918 if (id == null) { | 919 if (id == null) { |
919 throw new core.ArgumentError("Parameter id is required."); | 920 throw new core.ArgumentError("Parameter id is required."); |
920 } | 921 } |
921 | 922 |
922 _url = commons.Escaper.ecapeVariable('$userId') + '/labels/' + commons.Escap
er.ecapeVariable('$id'); | 923 _url = commons.Escaper.ecapeVariable('$userId') + |
| 924 '/labels/' + |
| 925 commons.Escaper.ecapeVariable('$id'); |
923 | 926 |
924 var _response = _requester.request(_url, | 927 var _response = _requester.request(_url, "PUT", |
925 "PUT", | 928 body: _body, |
926 body: _body, | 929 queryParams: _queryParams, |
927 queryParams: _queryParams, | 930 uploadOptions: _uploadOptions, |
928 uploadOptions: _uploadOptions, | 931 uploadMedia: _uploadMedia, |
929 uploadMedia: _uploadMedia, | 932 downloadOptions: _downloadOptions); |
930 downloadOptions: _downloadOptions); | |
931 return _response.then((data) => new Label.fromJson(data)); | 933 return _response.then((data) => new Label.fromJson(data)); |
932 } | 934 } |
933 | |
934 } | 935 } |
935 | 936 |
936 | |
937 class UsersMessagesResourceApi { | 937 class UsersMessagesResourceApi { |
938 final commons.ApiRequester _requester; | 938 final commons.ApiRequester _requester; |
939 | 939 |
940 UsersMessagesAttachmentsResourceApi get attachments => new UsersMessagesAttach
mentsResourceApi(_requester); | 940 UsersMessagesAttachmentsResourceApi get attachments => |
| 941 new UsersMessagesAttachmentsResourceApi(_requester); |
941 | 942 |
942 UsersMessagesResourceApi(commons.ApiRequester client) : | 943 UsersMessagesResourceApi(commons.ApiRequester client) : _requester = client; |
943 _requester = client; | |
944 | 944 |
945 /** | 945 /// Deletes many messages by message ID. Provides no guarantees that messages |
946 * Deletes many messages by message ID. Provides no guarantees that messages | 946 /// were not already deleted or even existed at all. |
947 * were not already deleted or even existed at all. | 947 /// |
948 * | 948 /// [request] - The metadata request object. |
949 * [request] - The metadata request object. | 949 /// |
950 * | 950 /// Request parameters: |
951 * Request parameters: | 951 /// |
952 * | 952 /// [userId] - The user's email address. The special value me can be used to |
953 * [userId] - The user's email address. The special value me can be used to | 953 /// indicate the authenticated user. |
954 * indicate the authenticated user. | 954 /// |
955 * | 955 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
956 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 956 /// an error. |
957 * error. | 957 /// |
958 * | 958 /// If the used [http.Client] completes with an error when making a REST |
959 * If the used [http.Client] completes with an error when making a REST call, | 959 /// call, this method will complete with the same error. |
960 * this method will complete with the same error. | 960 async.Future batchDelete( |
961 */ | 961 BatchDeleteMessagesRequest request, core.String userId) { |
962 async.Future batchDelete(BatchDeleteMessagesRequest request, core.String userI
d) { | |
963 var _url = null; | 962 var _url = null; |
964 var _queryParams = new core.Map(); | 963 var _queryParams = new core.Map(); |
965 var _uploadMedia = null; | 964 var _uploadMedia = null; |
966 var _uploadOptions = null; | 965 var _uploadOptions = null; |
967 var _downloadOptions = commons.DownloadOptions.Metadata; | 966 var _downloadOptions = commons.DownloadOptions.Metadata; |
968 var _body = null; | 967 var _body = null; |
969 | 968 |
970 if (request != null) { | 969 if (request != null) { |
971 _body = convert.JSON.encode((request).toJson()); | 970 _body = convert.JSON.encode((request).toJson()); |
972 } | 971 } |
973 if (userId == null) { | 972 if (userId == null) { |
974 throw new core.ArgumentError("Parameter userId is required."); | 973 throw new core.ArgumentError("Parameter userId is required."); |
975 } | 974 } |
976 | 975 |
977 _downloadOptions = null; | 976 _downloadOptions = null; |
978 | 977 |
979 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/batchDelete'; | 978 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/batchDelete'; |
980 | 979 |
981 var _response = _requester.request(_url, | 980 var _response = _requester.request(_url, "POST", |
982 "POST", | 981 body: _body, |
983 body: _body, | 982 queryParams: _queryParams, |
984 queryParams: _queryParams, | 983 uploadOptions: _uploadOptions, |
985 uploadOptions: _uploadOptions, | 984 uploadMedia: _uploadMedia, |
986 uploadMedia: _uploadMedia, | 985 downloadOptions: _downloadOptions); |
987 downloadOptions: _downloadOptions); | |
988 return _response.then((data) => null); | 986 return _response.then((data) => null); |
989 } | 987 } |
990 | 988 |
991 /** | 989 /// Modifies the labels on the specified messages. |
992 * Modifies the labels on the specified messages. | 990 /// |
993 * | 991 /// [request] - The metadata request object. |
994 * [request] - The metadata request object. | 992 /// |
995 * | 993 /// Request parameters: |
996 * Request parameters: | 994 /// |
997 * | 995 /// [userId] - The user's email address. The special value me can be used to |
998 * [userId] - The user's email address. The special value me can be used to | 996 /// indicate the authenticated user. |
999 * indicate the authenticated user. | 997 /// |
1000 * | 998 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1001 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 999 /// an error. |
1002 * error. | 1000 /// |
1003 * | 1001 /// If the used [http.Client] completes with an error when making a REST |
1004 * If the used [http.Client] completes with an error when making a REST call, | 1002 /// call, this method will complete with the same error. |
1005 * this method will complete with the same error. | 1003 async.Future batchModify( |
1006 */ | 1004 BatchModifyMessagesRequest request, core.String userId) { |
1007 async.Future batchModify(BatchModifyMessagesRequest request, core.String userI
d) { | |
1008 var _url = null; | 1005 var _url = null; |
1009 var _queryParams = new core.Map(); | 1006 var _queryParams = new core.Map(); |
1010 var _uploadMedia = null; | 1007 var _uploadMedia = null; |
1011 var _uploadOptions = null; | 1008 var _uploadOptions = null; |
1012 var _downloadOptions = commons.DownloadOptions.Metadata; | 1009 var _downloadOptions = commons.DownloadOptions.Metadata; |
1013 var _body = null; | 1010 var _body = null; |
1014 | 1011 |
1015 if (request != null) { | 1012 if (request != null) { |
1016 _body = convert.JSON.encode((request).toJson()); | 1013 _body = convert.JSON.encode((request).toJson()); |
1017 } | 1014 } |
1018 if (userId == null) { | 1015 if (userId == null) { |
1019 throw new core.ArgumentError("Parameter userId is required."); | 1016 throw new core.ArgumentError("Parameter userId is required."); |
1020 } | 1017 } |
1021 | 1018 |
1022 _downloadOptions = null; | 1019 _downloadOptions = null; |
1023 | 1020 |
1024 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/batchModify'; | 1021 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/batchModify'; |
1025 | 1022 |
1026 var _response = _requester.request(_url, | 1023 var _response = _requester.request(_url, "POST", |
1027 "POST", | 1024 body: _body, |
1028 body: _body, | 1025 queryParams: _queryParams, |
1029 queryParams: _queryParams, | 1026 uploadOptions: _uploadOptions, |
1030 uploadOptions: _uploadOptions, | 1027 uploadMedia: _uploadMedia, |
1031 uploadMedia: _uploadMedia, | 1028 downloadOptions: _downloadOptions); |
1032 downloadOptions: _downloadOptions); | |
1033 return _response.then((data) => null); | 1029 return _response.then((data) => null); |
1034 } | 1030 } |
1035 | 1031 |
1036 /** | 1032 /// Immediately and permanently deletes the specified message. This operation |
1037 * Immediately and permanently deletes the specified message. This operation | 1033 /// cannot be undone. Prefer messages.trash instead. |
1038 * cannot be undone. Prefer messages.trash instead. | 1034 /// |
1039 * | 1035 /// Request parameters: |
1040 * Request parameters: | 1036 /// |
1041 * | 1037 /// [userId] - The user's email address. The special value me can be used to |
1042 * [userId] - The user's email address. The special value me can be used to | 1038 /// indicate the authenticated user. |
1043 * indicate the authenticated user. | 1039 /// |
1044 * | 1040 /// [id] - The ID of the message to delete. |
1045 * [id] - The ID of the message to delete. | 1041 /// |
1046 * | 1042 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1047 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1043 /// an error. |
1048 * error. | 1044 /// |
1049 * | 1045 /// If the used [http.Client] completes with an error when making a REST |
1050 * If the used [http.Client] completes with an error when making a REST call, | 1046 /// call, this method will complete with the same error. |
1051 * this method will complete with the same error. | |
1052 */ | |
1053 async.Future delete(core.String userId, core.String id) { | 1047 async.Future delete(core.String userId, core.String id) { |
1054 var _url = null; | 1048 var _url = null; |
1055 var _queryParams = new core.Map(); | 1049 var _queryParams = new core.Map(); |
1056 var _uploadMedia = null; | 1050 var _uploadMedia = null; |
1057 var _uploadOptions = null; | 1051 var _uploadOptions = null; |
1058 var _downloadOptions = commons.DownloadOptions.Metadata; | 1052 var _downloadOptions = commons.DownloadOptions.Metadata; |
1059 var _body = null; | 1053 var _body = null; |
1060 | 1054 |
1061 if (userId == null) { | 1055 if (userId == null) { |
1062 throw new core.ArgumentError("Parameter userId is required."); | 1056 throw new core.ArgumentError("Parameter userId is required."); |
1063 } | 1057 } |
1064 if (id == null) { | 1058 if (id == null) { |
1065 throw new core.ArgumentError("Parameter id is required."); | 1059 throw new core.ArgumentError("Parameter id is required."); |
1066 } | 1060 } |
1067 | 1061 |
1068 _downloadOptions = null; | 1062 _downloadOptions = null; |
1069 | 1063 |
1070 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id'); | 1064 _url = commons.Escaper.ecapeVariable('$userId') + |
| 1065 '/messages/' + |
| 1066 commons.Escaper.ecapeVariable('$id'); |
1071 | 1067 |
1072 var _response = _requester.request(_url, | 1068 var _response = _requester.request(_url, "DELETE", |
1073 "DELETE", | 1069 body: _body, |
1074 body: _body, | 1070 queryParams: _queryParams, |
1075 queryParams: _queryParams, | 1071 uploadOptions: _uploadOptions, |
1076 uploadOptions: _uploadOptions, | 1072 uploadMedia: _uploadMedia, |
1077 uploadMedia: _uploadMedia, | 1073 downloadOptions: _downloadOptions); |
1078 downloadOptions: _downloadOptions); | |
1079 return _response.then((data) => null); | 1074 return _response.then((data) => null); |
1080 } | 1075 } |
1081 | 1076 |
1082 /** | 1077 /// Gets the specified message. |
1083 * Gets the specified message. | 1078 /// |
1084 * | 1079 /// Request parameters: |
1085 * Request parameters: | 1080 /// |
1086 * | 1081 /// [userId] - The user's email address. The special value me can be used to |
1087 * [userId] - The user's email address. The special value me can be used to | 1082 /// indicate the authenticated user. |
1088 * indicate the authenticated user. | 1083 /// |
1089 * | 1084 /// [id] - The ID of the message to retrieve. |
1090 * [id] - The ID of the message to retrieve. | 1085 /// |
1091 * | 1086 /// [format] - The format to return the message in. |
1092 * [format] - The format to return the message in. | 1087 /// Possible string values are: |
1093 * Possible string values are: | 1088 /// - "full" |
1094 * - "full" | 1089 /// - "metadata" |
1095 * - "metadata" | 1090 /// - "minimal" |
1096 * - "minimal" | 1091 /// - "raw" |
1097 * - "raw" | 1092 /// |
1098 * | 1093 /// [metadataHeaders] - When given and format is METADATA, only include |
1099 * [metadataHeaders] - When given and format is METADATA, only include headers | 1094 /// headers specified. |
1100 * specified. | 1095 /// |
1101 * | 1096 /// Completes with a [Message]. |
1102 * Completes with a [Message]. | 1097 /// |
1103 * | 1098 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1104 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1099 /// an error. |
1105 * error. | 1100 /// |
1106 * | 1101 /// If the used [http.Client] completes with an error when making a REST |
1107 * If the used [http.Client] completes with an error when making a REST call, | 1102 /// call, this method will complete with the same error. |
1108 * this method will complete with the same error. | 1103 async.Future<Message> get(core.String userId, core.String id, |
1109 */ | 1104 {core.String format, core.List<core.String> metadataHeaders}) { |
1110 async.Future<Message> get(core.String userId, core.String id, {core.String for
mat, core.List<core.String> metadataHeaders}) { | |
1111 var _url = null; | 1105 var _url = null; |
1112 var _queryParams = new core.Map(); | 1106 var _queryParams = new core.Map(); |
1113 var _uploadMedia = null; | 1107 var _uploadMedia = null; |
1114 var _uploadOptions = null; | 1108 var _uploadOptions = null; |
1115 var _downloadOptions = commons.DownloadOptions.Metadata; | 1109 var _downloadOptions = commons.DownloadOptions.Metadata; |
1116 var _body = null; | 1110 var _body = null; |
1117 | 1111 |
1118 if (userId == null) { | 1112 if (userId == null) { |
1119 throw new core.ArgumentError("Parameter userId is required."); | 1113 throw new core.ArgumentError("Parameter userId is required."); |
1120 } | 1114 } |
1121 if (id == null) { | 1115 if (id == null) { |
1122 throw new core.ArgumentError("Parameter id is required."); | 1116 throw new core.ArgumentError("Parameter id is required."); |
1123 } | 1117 } |
1124 if (format != null) { | 1118 if (format != null) { |
1125 _queryParams["format"] = [format]; | 1119 _queryParams["format"] = [format]; |
1126 } | 1120 } |
1127 if (metadataHeaders != null) { | 1121 if (metadataHeaders != null) { |
1128 _queryParams["metadataHeaders"] = metadataHeaders; | 1122 _queryParams["metadataHeaders"] = metadataHeaders; |
1129 } | 1123 } |
1130 | 1124 |
1131 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id'); | 1125 _url = commons.Escaper.ecapeVariable('$userId') + |
| 1126 '/messages/' + |
| 1127 commons.Escaper.ecapeVariable('$id'); |
1132 | 1128 |
1133 var _response = _requester.request(_url, | 1129 var _response = _requester.request(_url, "GET", |
1134 "GET", | 1130 body: _body, |
1135 body: _body, | 1131 queryParams: _queryParams, |
1136 queryParams: _queryParams, | 1132 uploadOptions: _uploadOptions, |
1137 uploadOptions: _uploadOptions, | 1133 uploadMedia: _uploadMedia, |
1138 uploadMedia: _uploadMedia, | 1134 downloadOptions: _downloadOptions); |
1139 downloadOptions: _downloadOptions); | |
1140 return _response.then((data) => new Message.fromJson(data)); | 1135 return _response.then((data) => new Message.fromJson(data)); |
1141 } | 1136 } |
1142 | 1137 |
1143 /** | 1138 /// Imports a message into only this user's mailbox, with standard email |
1144 * Imports a message into only this user's mailbox, with standard email | 1139 /// delivery scanning and classification similar to receiving via SMTP. Does |
1145 * delivery scanning and classification similar to receiving via SMTP. Does | 1140 /// not send a message. |
1146 * not send a message. | 1141 /// |
1147 * | 1142 /// [request] - The metadata request object. |
1148 * [request] - The metadata request object. | 1143 /// |
1149 * | 1144 /// Request parameters: |
1150 * Request parameters: | 1145 /// |
1151 * | 1146 /// [userId] - The user's email address. The special value me can be used to |
1152 * [userId] - The user's email address. The special value me can be used to | 1147 /// indicate the authenticated user. |
1153 * indicate the authenticated user. | 1148 /// |
1154 * | 1149 /// [deleted] - Mark the email as permanently deleted (not TRASH) and only |
1155 * [deleted] - Mark the email as permanently deleted (not TRASH) and only | 1150 /// visible in Google Vault to a Vault administrator. Only used for G Suite |
1156 * visible in Google Vault to a Vault administrator. Only used for G Suite | 1151 /// accounts. |
1157 * accounts. | 1152 /// |
1158 * | 1153 /// [internalDateSource] - Source for Gmail's internal date of the message. |
1159 * [internalDateSource] - Source for Gmail's internal date of the message. | 1154 /// Possible string values are: |
1160 * Possible string values are: | 1155 /// - "dateHeader" |
1161 * - "dateHeader" | 1156 /// - "receivedTime" |
1162 * - "receivedTime" | 1157 /// |
1163 * | 1158 /// [neverMarkSpam] - Ignore the Gmail spam classifier decision and never |
1164 * [neverMarkSpam] - Ignore the Gmail spam classifier decision and never mark | 1159 /// mark this email as SPAM in the mailbox. |
1165 * this email as SPAM in the mailbox. | 1160 /// |
1166 * | 1161 /// [processForCalendar] - Process calendar invites in the email and add any |
1167 * [processForCalendar] - Process calendar invites in the email and add any | 1162 /// extracted meetings to the Google Calendar for this user. |
1168 * extracted meetings to the Google Calendar for this user. | 1163 /// |
1169 * | 1164 /// [uploadMedia] - The media to upload. |
1170 * [uploadMedia] - The media to upload. | 1165 /// |
1171 * | 1166 /// [uploadOptions] - Options for the media upload. Streaming Media without |
1172 * [uploadOptions] - Options for the media upload. Streaming Media without the | 1167 /// the length being known ahead of time is only supported via resumable |
1173 * length being known ahead of time is only supported via resumable uploads. | 1168 /// uploads. |
1174 * | 1169 /// |
1175 * Completes with a [Message]. | 1170 /// Completes with a [Message]. |
1176 * | 1171 /// |
1177 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1172 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1178 * error. | 1173 /// an error. |
1179 * | 1174 /// |
1180 * If the used [http.Client] completes with an error when making a REST call, | 1175 /// If the used [http.Client] completes with an error when making a REST |
1181 * this method will complete with the same error. | 1176 /// call, this method will complete with the same error. |
1182 */ | 1177 async.Future<Message> import(Message request, core.String userId, |
1183 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}) { | 1178 {core.bool deleted, |
| 1179 core.String internalDateSource, |
| 1180 core.bool neverMarkSpam, |
| 1181 core.bool processForCalendar, |
| 1182 commons.UploadOptions uploadOptions: commons.UploadOptions.Default, |
| 1183 commons.Media uploadMedia}) { |
1184 var _url = null; | 1184 var _url = null; |
1185 var _queryParams = new core.Map(); | 1185 var _queryParams = new core.Map(); |
1186 var _uploadMedia = null; | 1186 var _uploadMedia = null; |
1187 var _uploadOptions = null; | 1187 var _uploadOptions = null; |
1188 var _downloadOptions = commons.DownloadOptions.Metadata; | 1188 var _downloadOptions = commons.DownloadOptions.Metadata; |
1189 var _body = null; | 1189 var _body = null; |
1190 | 1190 |
1191 if (request != null) { | 1191 if (request != null) { |
1192 _body = convert.JSON.encode((request).toJson()); | 1192 _body = convert.JSON.encode((request).toJson()); |
1193 } | 1193 } |
1194 if (userId == null) { | 1194 if (userId == null) { |
1195 throw new core.ArgumentError("Parameter userId is required."); | 1195 throw new core.ArgumentError("Parameter userId is required."); |
1196 } | 1196 } |
1197 if (deleted != null) { | 1197 if (deleted != null) { |
1198 _queryParams["deleted"] = ["${deleted}"]; | 1198 _queryParams["deleted"] = ["${deleted}"]; |
1199 } | 1199 } |
1200 if (internalDateSource != null) { | 1200 if (internalDateSource != null) { |
1201 _queryParams["internalDateSource"] = [internalDateSource]; | 1201 _queryParams["internalDateSource"] = [internalDateSource]; |
1202 } | 1202 } |
1203 if (neverMarkSpam != null) { | 1203 if (neverMarkSpam != null) { |
1204 _queryParams["neverMarkSpam"] = ["${neverMarkSpam}"]; | 1204 _queryParams["neverMarkSpam"] = ["${neverMarkSpam}"]; |
1205 } | 1205 } |
1206 if (processForCalendar != null) { | 1206 if (processForCalendar != null) { |
1207 _queryParams["processForCalendar"] = ["${processForCalendar}"]; | 1207 _queryParams["processForCalendar"] = ["${processForCalendar}"]; |
1208 } | 1208 } |
1209 | 1209 |
1210 _uploadMedia = uploadMedia; | 1210 _uploadMedia = uploadMedia; |
1211 _uploadOptions = uploadOptions; | 1211 _uploadOptions = uploadOptions; |
1212 | 1212 |
1213 if (_uploadMedia == null) { | 1213 if (_uploadMedia == null) { |
1214 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/import'; | 1214 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/import'; |
1215 } else if (_uploadOptions is commons.ResumableUploadOptions) { | 1215 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
1216 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/messages/import'; | 1216 _url = '/resumable/upload/gmail/v1/users/' + |
| 1217 commons.Escaper.ecapeVariable('$userId') + |
| 1218 '/messages/import'; |
1217 } else { | 1219 } else { |
1218 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/messages/import'; | 1220 _url = '/upload/gmail/v1/users/' + |
| 1221 commons.Escaper.ecapeVariable('$userId') + |
| 1222 '/messages/import'; |
1219 } | 1223 } |
1220 | 1224 |
1221 | 1225 var _response = _requester.request(_url, "POST", |
1222 var _response = _requester.request(_url, | 1226 body: _body, |
1223 "POST", | 1227 queryParams: _queryParams, |
1224 body: _body, | 1228 uploadOptions: _uploadOptions, |
1225 queryParams: _queryParams, | 1229 uploadMedia: _uploadMedia, |
1226 uploadOptions: _uploadOptions, | 1230 downloadOptions: _downloadOptions); |
1227 uploadMedia: _uploadMedia, | |
1228 downloadOptions: _downloadOptions); | |
1229 return _response.then((data) => new Message.fromJson(data)); | 1231 return _response.then((data) => new Message.fromJson(data)); |
1230 } | 1232 } |
1231 | 1233 |
1232 /** | 1234 /// Directly inserts a message into only this user's mailbox similar to IMAP |
1233 * Directly inserts a message into only this user's mailbox similar to IMAP | 1235 /// APPEND, bypassing most scanning and classification. Does not send a |
1234 * APPEND, bypassing most scanning and classification. Does not send a | 1236 /// message. |
1235 * message. | 1237 /// |
1236 * | 1238 /// [request] - The metadata request object. |
1237 * [request] - The metadata request object. | 1239 /// |
1238 * | 1240 /// Request parameters: |
1239 * Request parameters: | 1241 /// |
1240 * | 1242 /// [userId] - The user's email address. The special value me can be used to |
1241 * [userId] - The user's email address. The special value me can be used to | 1243 /// indicate the authenticated user. |
1242 * indicate the authenticated user. | 1244 /// |
1243 * | 1245 /// [deleted] - Mark the email as permanently deleted (not TRASH) and only |
1244 * [deleted] - Mark the email as permanently deleted (not TRASH) and only | 1246 /// visible in Google Vault to a Vault administrator. Only used for G Suite |
1245 * visible in Google Vault to a Vault administrator. Only used for G Suite | 1247 /// accounts. |
1246 * accounts. | 1248 /// |
1247 * | 1249 /// [internalDateSource] - Source for Gmail's internal date of the message. |
1248 * [internalDateSource] - Source for Gmail's internal date of the message. | 1250 /// Possible string values are: |
1249 * Possible string values are: | 1251 /// - "dateHeader" |
1250 * - "dateHeader" | 1252 /// - "receivedTime" |
1251 * - "receivedTime" | 1253 /// |
1252 * | 1254 /// [uploadMedia] - The media to upload. |
1253 * [uploadMedia] - The media to upload. | 1255 /// |
1254 * | 1256 /// [uploadOptions] - Options for the media upload. Streaming Media without |
1255 * [uploadOptions] - Options for the media upload. Streaming Media without the | 1257 /// the length being known ahead of time is only supported via resumable |
1256 * length being known ahead of time is only supported via resumable uploads. | 1258 /// uploads. |
1257 * | 1259 /// |
1258 * Completes with a [Message]. | 1260 /// Completes with a [Message]. |
1259 * | 1261 /// |
1260 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1262 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1261 * error. | 1263 /// an error. |
1262 * | 1264 /// |
1263 * If the used [http.Client] completes with an error when making a REST call, | 1265 /// If the used [http.Client] completes with an error when making a REST |
1264 * this method will complete with the same error. | 1266 /// call, this method will complete with the same error. |
1265 */ | 1267 async.Future<Message> insert(Message request, core.String userId, |
1266 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}) { | 1268 {core.bool deleted, |
| 1269 core.String internalDateSource, |
| 1270 commons.UploadOptions uploadOptions: commons.UploadOptions.Default, |
| 1271 commons.Media uploadMedia}) { |
1267 var _url = null; | 1272 var _url = null; |
1268 var _queryParams = new core.Map(); | 1273 var _queryParams = new core.Map(); |
1269 var _uploadMedia = null; | 1274 var _uploadMedia = null; |
1270 var _uploadOptions = null; | 1275 var _uploadOptions = null; |
1271 var _downloadOptions = commons.DownloadOptions.Metadata; | 1276 var _downloadOptions = commons.DownloadOptions.Metadata; |
1272 var _body = null; | 1277 var _body = null; |
1273 | 1278 |
1274 if (request != null) { | 1279 if (request != null) { |
1275 _body = convert.JSON.encode((request).toJson()); | 1280 _body = convert.JSON.encode((request).toJson()); |
1276 } | 1281 } |
1277 if (userId == null) { | 1282 if (userId == null) { |
1278 throw new core.ArgumentError("Parameter userId is required."); | 1283 throw new core.ArgumentError("Parameter userId is required."); |
1279 } | 1284 } |
1280 if (deleted != null) { | 1285 if (deleted != null) { |
1281 _queryParams["deleted"] = ["${deleted}"]; | 1286 _queryParams["deleted"] = ["${deleted}"]; |
1282 } | 1287 } |
1283 if (internalDateSource != null) { | 1288 if (internalDateSource != null) { |
1284 _queryParams["internalDateSource"] = [internalDateSource]; | 1289 _queryParams["internalDateSource"] = [internalDateSource]; |
1285 } | 1290 } |
1286 | 1291 |
1287 _uploadMedia = uploadMedia; | 1292 _uploadMedia = uploadMedia; |
1288 _uploadOptions = uploadOptions; | 1293 _uploadOptions = uploadOptions; |
1289 | 1294 |
1290 if (_uploadMedia == null) { | 1295 if (_uploadMedia == null) { |
1291 _url = commons.Escaper.ecapeVariable('$userId') + '/messages'; | 1296 _url = commons.Escaper.ecapeVariable('$userId') + '/messages'; |
1292 } else if (_uploadOptions is commons.ResumableUploadOptions) { | 1297 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
1293 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/messages'; | 1298 _url = '/resumable/upload/gmail/v1/users/' + |
| 1299 commons.Escaper.ecapeVariable('$userId') + |
| 1300 '/messages'; |
1294 } else { | 1301 } else { |
1295 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/messages'; | 1302 _url = '/upload/gmail/v1/users/' + |
| 1303 commons.Escaper.ecapeVariable('$userId') + |
| 1304 '/messages'; |
1296 } | 1305 } |
1297 | 1306 |
1298 | 1307 var _response = _requester.request(_url, "POST", |
1299 var _response = _requester.request(_url, | 1308 body: _body, |
1300 "POST", | 1309 queryParams: _queryParams, |
1301 body: _body, | 1310 uploadOptions: _uploadOptions, |
1302 queryParams: _queryParams, | 1311 uploadMedia: _uploadMedia, |
1303 uploadOptions: _uploadOptions, | 1312 downloadOptions: _downloadOptions); |
1304 uploadMedia: _uploadMedia, | |
1305 downloadOptions: _downloadOptions); | |
1306 return _response.then((data) => new Message.fromJson(data)); | 1313 return _response.then((data) => new Message.fromJson(data)); |
1307 } | 1314 } |
1308 | 1315 |
1309 /** | 1316 /// Lists the messages in the user's mailbox. |
1310 * Lists the messages in the user's mailbox. | 1317 /// |
1311 * | 1318 /// Request parameters: |
1312 * Request parameters: | 1319 /// |
1313 * | 1320 /// [userId] - The user's email address. The special value me can be used to |
1314 * [userId] - The user's email address. The special value me can be used to | 1321 /// indicate the authenticated user. |
1315 * indicate the authenticated user. | 1322 /// |
1316 * | 1323 /// [includeSpamTrash] - Include messages from SPAM and TRASH in the results. |
1317 * [includeSpamTrash] - Include messages from SPAM and TRASH in the results. | 1324 /// |
1318 * | 1325 /// [labelIds] - Only return messages with labels that match all of the |
1319 * [labelIds] - Only return messages with labels that match all of the | 1326 /// specified label IDs. |
1320 * specified label IDs. | 1327 /// |
1321 * | 1328 /// [maxResults] - Maximum number of messages to return. |
1322 * [maxResults] - Maximum number of messages to return. | 1329 /// |
1323 * | 1330 /// [pageToken] - Page token to retrieve a specific page of results in the |
1324 * [pageToken] - Page token to retrieve a specific page of results in the | 1331 /// list. |
1325 * list. | 1332 /// |
1326 * | 1333 /// [q] - Only return messages matching the specified query. Supports the |
1327 * [q] - Only return messages matching the specified query. Supports the same | 1334 /// same query format as the Gmail search box. For example, |
1328 * query format as the Gmail search box. For example, | 1335 /// "from:someuser@example.com rfc822msgid:<somemsgid@example.com> |
1329 * "from:someuser@example.com rfc822msgid:<somemsgid@example.com> is:unread". | 1336 /// is:unread". Parameter cannot be used when accessing the api using the |
1330 * Parameter cannot be used when accessing the api using the gmail.metadata | 1337 /// gmail.metadata scope. |
1331 * scope. | 1338 /// |
1332 * | 1339 /// Completes with a [ListMessagesResponse]. |
1333 * Completes with a [ListMessagesResponse]. | 1340 /// |
1334 * | 1341 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1335 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1342 /// an error. |
1336 * error. | 1343 /// |
1337 * | 1344 /// If the used [http.Client] completes with an error when making a REST |
1338 * If the used [http.Client] completes with an error when making a REST call, | 1345 /// call, this method will complete with the same error. |
1339 * this method will complete with the same error. | 1346 async.Future<ListMessagesResponse> list(core.String userId, |
1340 */ | 1347 {core.bool includeSpamTrash, |
1341 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}) { | 1348 core.List<core.String> labelIds, |
| 1349 core.int maxResults, |
| 1350 core.String pageToken, |
| 1351 core.String q}) { |
1342 var _url = null; | 1352 var _url = null; |
1343 var _queryParams = new core.Map(); | 1353 var _queryParams = new core.Map(); |
1344 var _uploadMedia = null; | 1354 var _uploadMedia = null; |
1345 var _uploadOptions = null; | 1355 var _uploadOptions = null; |
1346 var _downloadOptions = commons.DownloadOptions.Metadata; | 1356 var _downloadOptions = commons.DownloadOptions.Metadata; |
1347 var _body = null; | 1357 var _body = null; |
1348 | 1358 |
1349 if (userId == null) { | 1359 if (userId == null) { |
1350 throw new core.ArgumentError("Parameter userId is required."); | 1360 throw new core.ArgumentError("Parameter userId is required."); |
1351 } | 1361 } |
1352 if (includeSpamTrash != null) { | 1362 if (includeSpamTrash != null) { |
1353 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; | 1363 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; |
1354 } | 1364 } |
1355 if (labelIds != null) { | 1365 if (labelIds != null) { |
1356 _queryParams["labelIds"] = labelIds; | 1366 _queryParams["labelIds"] = labelIds; |
1357 } | 1367 } |
1358 if (maxResults != null) { | 1368 if (maxResults != null) { |
1359 _queryParams["maxResults"] = ["${maxResults}"]; | 1369 _queryParams["maxResults"] = ["${maxResults}"]; |
1360 } | 1370 } |
1361 if (pageToken != null) { | 1371 if (pageToken != null) { |
1362 _queryParams["pageToken"] = [pageToken]; | 1372 _queryParams["pageToken"] = [pageToken]; |
1363 } | 1373 } |
1364 if (q != null) { | 1374 if (q != null) { |
1365 _queryParams["q"] = [q]; | 1375 _queryParams["q"] = [q]; |
1366 } | 1376 } |
1367 | 1377 |
1368 _url = commons.Escaper.ecapeVariable('$userId') + '/messages'; | 1378 _url = commons.Escaper.ecapeVariable('$userId') + '/messages'; |
1369 | 1379 |
1370 var _response = _requester.request(_url, | 1380 var _response = _requester.request(_url, "GET", |
1371 "GET", | 1381 body: _body, |
1372 body: _body, | 1382 queryParams: _queryParams, |
1373 queryParams: _queryParams, | 1383 uploadOptions: _uploadOptions, |
1374 uploadOptions: _uploadOptions, | 1384 uploadMedia: _uploadMedia, |
1375 uploadMedia: _uploadMedia, | 1385 downloadOptions: _downloadOptions); |
1376 downloadOptions: _downloadOptions); | |
1377 return _response.then((data) => new ListMessagesResponse.fromJson(data)); | 1386 return _response.then((data) => new ListMessagesResponse.fromJson(data)); |
1378 } | 1387 } |
1379 | 1388 |
1380 /** | 1389 /// Modifies the labels on the specified message. |
1381 * Modifies the labels on the specified message. | 1390 /// |
1382 * | 1391 /// [request] - The metadata request object. |
1383 * [request] - The metadata request object. | 1392 /// |
1384 * | 1393 /// Request parameters: |
1385 * Request parameters: | 1394 /// |
1386 * | 1395 /// [userId] - The user's email address. The special value me can be used to |
1387 * [userId] - The user's email address. The special value me can be used to | 1396 /// indicate the authenticated user. |
1388 * indicate the authenticated user. | 1397 /// |
1389 * | 1398 /// [id] - The ID of the message to modify. |
1390 * [id] - The ID of the message to modify. | 1399 /// |
1391 * | 1400 /// Completes with a [Message]. |
1392 * Completes with a [Message]. | 1401 /// |
1393 * | 1402 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1394 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1403 /// an error. |
1395 * error. | 1404 /// |
1396 * | 1405 /// If the used [http.Client] completes with an error when making a REST |
1397 * If the used [http.Client] completes with an error when making a REST call, | 1406 /// call, this method will complete with the same error. |
1398 * this method will complete with the same error. | 1407 async.Future<Message> modify( |
1399 */ | 1408 ModifyMessageRequest request, core.String userId, core.String id) { |
1400 async.Future<Message> modify(ModifyMessageRequest request, core.String userId,
core.String id) { | |
1401 var _url = null; | 1409 var _url = null; |
1402 var _queryParams = new core.Map(); | 1410 var _queryParams = new core.Map(); |
1403 var _uploadMedia = null; | 1411 var _uploadMedia = null; |
1404 var _uploadOptions = null; | 1412 var _uploadOptions = null; |
1405 var _downloadOptions = commons.DownloadOptions.Metadata; | 1413 var _downloadOptions = commons.DownloadOptions.Metadata; |
1406 var _body = null; | 1414 var _body = null; |
1407 | 1415 |
1408 if (request != null) { | 1416 if (request != null) { |
1409 _body = convert.JSON.encode((request).toJson()); | 1417 _body = convert.JSON.encode((request).toJson()); |
1410 } | 1418 } |
1411 if (userId == null) { | 1419 if (userId == null) { |
1412 throw new core.ArgumentError("Parameter userId is required."); | 1420 throw new core.ArgumentError("Parameter userId is required."); |
1413 } | 1421 } |
1414 if (id == null) { | 1422 if (id == null) { |
1415 throw new core.ArgumentError("Parameter id is required."); | 1423 throw new core.ArgumentError("Parameter id is required."); |
1416 } | 1424 } |
1417 | 1425 |
1418 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id') + '/modify'; | 1426 _url = commons.Escaper.ecapeVariable('$userId') + |
| 1427 '/messages/' + |
| 1428 commons.Escaper.ecapeVariable('$id') + |
| 1429 '/modify'; |
1419 | 1430 |
1420 var _response = _requester.request(_url, | 1431 var _response = _requester.request(_url, "POST", |
1421 "POST", | 1432 body: _body, |
1422 body: _body, | 1433 queryParams: _queryParams, |
1423 queryParams: _queryParams, | 1434 uploadOptions: _uploadOptions, |
1424 uploadOptions: _uploadOptions, | 1435 uploadMedia: _uploadMedia, |
1425 uploadMedia: _uploadMedia, | 1436 downloadOptions: _downloadOptions); |
1426 downloadOptions: _downloadOptions); | |
1427 return _response.then((data) => new Message.fromJson(data)); | 1437 return _response.then((data) => new Message.fromJson(data)); |
1428 } | 1438 } |
1429 | 1439 |
1430 /** | 1440 /// Sends the specified message to the recipients in the To, Cc, and Bcc |
1431 * Sends the specified message to the recipients in the To, Cc, and Bcc | 1441 /// headers. |
1432 * headers. | 1442 /// |
1433 * | 1443 /// [request] - The metadata request object. |
1434 * [request] - The metadata request object. | 1444 /// |
1435 * | 1445 /// Request parameters: |
1436 * Request parameters: | 1446 /// |
1437 * | 1447 /// [userId] - The user's email address. The special value me can be used to |
1438 * [userId] - The user's email address. The special value me can be used to | 1448 /// indicate the authenticated user. |
1439 * indicate the authenticated user. | 1449 /// |
1440 * | 1450 /// [uploadMedia] - The media to upload. |
1441 * [uploadMedia] - The media to upload. | 1451 /// |
1442 * | 1452 /// [uploadOptions] - Options for the media upload. Streaming Media without |
1443 * [uploadOptions] - Options for the media upload. Streaming Media without the | 1453 /// the length being known ahead of time is only supported via resumable |
1444 * length being known ahead of time is only supported via resumable uploads. | 1454 /// uploads. |
1445 * | 1455 /// |
1446 * Completes with a [Message]. | 1456 /// Completes with a [Message]. |
1447 * | 1457 /// |
1448 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1458 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1449 * error. | 1459 /// an error. |
1450 * | 1460 /// |
1451 * If the used [http.Client] completes with an error when making a REST call, | 1461 /// If the used [http.Client] completes with an error when making a REST |
1452 * this method will complete with the same error. | 1462 /// call, this method will complete with the same error. |
1453 */ | 1463 async.Future<Message> send(Message request, core.String userId, |
1454 async.Future<Message> send(Message request, core.String userId, {commons.Uploa
dOptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedi
a}) { | 1464 {commons.UploadOptions uploadOptions: commons.UploadOptions.Default, |
| 1465 commons.Media uploadMedia}) { |
1455 var _url = null; | 1466 var _url = null; |
1456 var _queryParams = new core.Map(); | 1467 var _queryParams = new core.Map(); |
1457 var _uploadMedia = null; | 1468 var _uploadMedia = null; |
1458 var _uploadOptions = null; | 1469 var _uploadOptions = null; |
1459 var _downloadOptions = commons.DownloadOptions.Metadata; | 1470 var _downloadOptions = commons.DownloadOptions.Metadata; |
1460 var _body = null; | 1471 var _body = null; |
1461 | 1472 |
1462 if (request != null) { | 1473 if (request != null) { |
1463 _body = convert.JSON.encode((request).toJson()); | 1474 _body = convert.JSON.encode((request).toJson()); |
1464 } | 1475 } |
1465 if (userId == null) { | 1476 if (userId == null) { |
1466 throw new core.ArgumentError("Parameter userId is required."); | 1477 throw new core.ArgumentError("Parameter userId is required."); |
1467 } | 1478 } |
1468 | 1479 |
1469 _uploadMedia = uploadMedia; | 1480 _uploadMedia = uploadMedia; |
1470 _uploadOptions = uploadOptions; | 1481 _uploadOptions = uploadOptions; |
1471 | 1482 |
1472 if (_uploadMedia == null) { | 1483 if (_uploadMedia == null) { |
1473 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/send'; | 1484 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/send'; |
1474 } else if (_uploadOptions is commons.ResumableUploadOptions) { | 1485 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
1475 _url = '/resumable/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable
('$userId') + '/messages/send'; | 1486 _url = '/resumable/upload/gmail/v1/users/' + |
| 1487 commons.Escaper.ecapeVariable('$userId') + |
| 1488 '/messages/send'; |
1476 } else { | 1489 } else { |
1477 _url = '/upload/gmail/v1/users/' + commons.Escaper.ecapeVariable('$userId'
) + '/messages/send'; | 1490 _url = '/upload/gmail/v1/users/' + |
| 1491 commons.Escaper.ecapeVariable('$userId') + |
| 1492 '/messages/send'; |
1478 } | 1493 } |
1479 | 1494 |
1480 | 1495 var _response = _requester.request(_url, "POST", |
1481 var _response = _requester.request(_url, | 1496 body: _body, |
1482 "POST", | 1497 queryParams: _queryParams, |
1483 body: _body, | 1498 uploadOptions: _uploadOptions, |
1484 queryParams: _queryParams, | 1499 uploadMedia: _uploadMedia, |
1485 uploadOptions: _uploadOptions, | 1500 downloadOptions: _downloadOptions); |
1486 uploadMedia: _uploadMedia, | |
1487 downloadOptions: _downloadOptions); | |
1488 return _response.then((data) => new Message.fromJson(data)); | 1501 return _response.then((data) => new Message.fromJson(data)); |
1489 } | 1502 } |
1490 | 1503 |
1491 /** | 1504 /// Moves the specified message to the trash. |
1492 * Moves the specified message to the trash. | 1505 /// |
1493 * | 1506 /// Request parameters: |
1494 * Request parameters: | 1507 /// |
1495 * | 1508 /// [userId] - The user's email address. The special value me can be used to |
1496 * [userId] - The user's email address. The special value me can be used to | 1509 /// indicate the authenticated user. |
1497 * indicate the authenticated user. | 1510 /// |
1498 * | 1511 /// [id] - The ID of the message to Trash. |
1499 * [id] - The ID of the message to Trash. | 1512 /// |
1500 * | 1513 /// Completes with a [Message]. |
1501 * Completes with a [Message]. | 1514 /// |
1502 * | 1515 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1503 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1516 /// an error. |
1504 * error. | 1517 /// |
1505 * | 1518 /// If the used [http.Client] completes with an error when making a REST |
1506 * If the used [http.Client] completes with an error when making a REST call, | 1519 /// call, this method will complete with the same error. |
1507 * this method will complete with the same error. | |
1508 */ | |
1509 async.Future<Message> trash(core.String userId, core.String id) { | 1520 async.Future<Message> trash(core.String userId, core.String id) { |
1510 var _url = null; | 1521 var _url = null; |
1511 var _queryParams = new core.Map(); | 1522 var _queryParams = new core.Map(); |
1512 var _uploadMedia = null; | 1523 var _uploadMedia = null; |
1513 var _uploadOptions = null; | 1524 var _uploadOptions = null; |
1514 var _downloadOptions = commons.DownloadOptions.Metadata; | 1525 var _downloadOptions = commons.DownloadOptions.Metadata; |
1515 var _body = null; | 1526 var _body = null; |
1516 | 1527 |
1517 if (userId == null) { | 1528 if (userId == null) { |
1518 throw new core.ArgumentError("Parameter userId is required."); | 1529 throw new core.ArgumentError("Parameter userId is required."); |
1519 } | 1530 } |
1520 if (id == null) { | 1531 if (id == null) { |
1521 throw new core.ArgumentError("Parameter id is required."); | 1532 throw new core.ArgumentError("Parameter id is required."); |
1522 } | 1533 } |
1523 | 1534 |
1524 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id') + '/trash'; | 1535 _url = commons.Escaper.ecapeVariable('$userId') + |
| 1536 '/messages/' + |
| 1537 commons.Escaper.ecapeVariable('$id') + |
| 1538 '/trash'; |
1525 | 1539 |
1526 var _response = _requester.request(_url, | 1540 var _response = _requester.request(_url, "POST", |
1527 "POST", | 1541 body: _body, |
1528 body: _body, | 1542 queryParams: _queryParams, |
1529 queryParams: _queryParams, | 1543 uploadOptions: _uploadOptions, |
1530 uploadOptions: _uploadOptions, | 1544 uploadMedia: _uploadMedia, |
1531 uploadMedia: _uploadMedia, | 1545 downloadOptions: _downloadOptions); |
1532 downloadOptions: _downloadOptions); | |
1533 return _response.then((data) => new Message.fromJson(data)); | 1546 return _response.then((data) => new Message.fromJson(data)); |
1534 } | 1547 } |
1535 | 1548 |
1536 /** | 1549 /// Removes the specified message from the trash. |
1537 * Removes the specified message from the trash. | 1550 /// |
1538 * | 1551 /// Request parameters: |
1539 * Request parameters: | 1552 /// |
1540 * | 1553 /// [userId] - The user's email address. The special value me can be used to |
1541 * [userId] - The user's email address. The special value me can be used to | 1554 /// indicate the authenticated user. |
1542 * indicate the authenticated user. | 1555 /// |
1543 * | 1556 /// [id] - The ID of the message to remove from Trash. |
1544 * [id] - The ID of the message to remove from Trash. | 1557 /// |
1545 * | 1558 /// Completes with a [Message]. |
1546 * Completes with a [Message]. | 1559 /// |
1547 * | 1560 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1548 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1561 /// an error. |
1549 * error. | 1562 /// |
1550 * | 1563 /// If the used [http.Client] completes with an error when making a REST |
1551 * If the used [http.Client] completes with an error when making a REST call, | 1564 /// call, this method will complete with the same error. |
1552 * this method will complete with the same error. | |
1553 */ | |
1554 async.Future<Message> untrash(core.String userId, core.String id) { | 1565 async.Future<Message> untrash(core.String userId, core.String id) { |
1555 var _url = null; | 1566 var _url = null; |
1556 var _queryParams = new core.Map(); | 1567 var _queryParams = new core.Map(); |
1557 var _uploadMedia = null; | 1568 var _uploadMedia = null; |
1558 var _uploadOptions = null; | 1569 var _uploadOptions = null; |
1559 var _downloadOptions = commons.DownloadOptions.Metadata; | 1570 var _downloadOptions = commons.DownloadOptions.Metadata; |
1560 var _body = null; | 1571 var _body = null; |
1561 | 1572 |
1562 if (userId == null) { | 1573 if (userId == null) { |
1563 throw new core.ArgumentError("Parameter userId is required."); | 1574 throw new core.ArgumentError("Parameter userId is required."); |
1564 } | 1575 } |
1565 if (id == null) { | 1576 if (id == null) { |
1566 throw new core.ArgumentError("Parameter id is required."); | 1577 throw new core.ArgumentError("Parameter id is required."); |
1567 } | 1578 } |
1568 | 1579 |
1569 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$id') + '/untrash'; | 1580 _url = commons.Escaper.ecapeVariable('$userId') + |
| 1581 '/messages/' + |
| 1582 commons.Escaper.ecapeVariable('$id') + |
| 1583 '/untrash'; |
1570 | 1584 |
1571 var _response = _requester.request(_url, | 1585 var _response = _requester.request(_url, "POST", |
1572 "POST", | 1586 body: _body, |
1573 body: _body, | 1587 queryParams: _queryParams, |
1574 queryParams: _queryParams, | 1588 uploadOptions: _uploadOptions, |
1575 uploadOptions: _uploadOptions, | 1589 uploadMedia: _uploadMedia, |
1576 uploadMedia: _uploadMedia, | 1590 downloadOptions: _downloadOptions); |
1577 downloadOptions: _downloadOptions); | |
1578 return _response.then((data) => new Message.fromJson(data)); | 1591 return _response.then((data) => new Message.fromJson(data)); |
1579 } | 1592 } |
1580 | |
1581 } | 1593 } |
1582 | 1594 |
1583 | |
1584 class UsersMessagesAttachmentsResourceApi { | 1595 class UsersMessagesAttachmentsResourceApi { |
1585 final commons.ApiRequester _requester; | 1596 final commons.ApiRequester _requester; |
1586 | 1597 |
1587 UsersMessagesAttachmentsResourceApi(commons.ApiRequester client) : | 1598 UsersMessagesAttachmentsResourceApi(commons.ApiRequester client) |
1588 _requester = client; | 1599 : _requester = client; |
1589 | 1600 |
1590 /** | 1601 /// Gets the specified message attachment. |
1591 * Gets the specified message attachment. | 1602 /// |
1592 * | 1603 /// Request parameters: |
1593 * Request parameters: | 1604 /// |
1594 * | 1605 /// [userId] - The user's email address. The special value me can be used to |
1595 * [userId] - The user's email address. The special value me can be used to | 1606 /// indicate the authenticated user. |
1596 * indicate the authenticated user. | 1607 /// |
1597 * | 1608 /// [messageId] - The ID of the message containing the attachment. |
1598 * [messageId] - The ID of the message containing the attachment. | 1609 /// |
1599 * | 1610 /// [id] - The ID of the attachment. |
1600 * [id] - The ID of the attachment. | 1611 /// |
1601 * | 1612 /// Completes with a [MessagePartBody]. |
1602 * Completes with a [MessagePartBody]. | 1613 /// |
1603 * | 1614 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1604 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1615 /// an error. |
1605 * error. | 1616 /// |
1606 * | 1617 /// If the used [http.Client] completes with an error when making a REST |
1607 * If the used [http.Client] completes with an error when making a REST call, | 1618 /// call, this method will complete with the same error. |
1608 * this method will complete with the same error. | 1619 async.Future<MessagePartBody> get( |
1609 */ | 1620 core.String userId, core.String messageId, core.String id) { |
1610 async.Future<MessagePartBody> get(core.String userId, core.String messageId, c
ore.String id) { | |
1611 var _url = null; | 1621 var _url = null; |
1612 var _queryParams = new core.Map(); | 1622 var _queryParams = new core.Map(); |
1613 var _uploadMedia = null; | 1623 var _uploadMedia = null; |
1614 var _uploadOptions = null; | 1624 var _uploadOptions = null; |
1615 var _downloadOptions = commons.DownloadOptions.Metadata; | 1625 var _downloadOptions = commons.DownloadOptions.Metadata; |
1616 var _body = null; | 1626 var _body = null; |
1617 | 1627 |
1618 if (userId == null) { | 1628 if (userId == null) { |
1619 throw new core.ArgumentError("Parameter userId is required."); | 1629 throw new core.ArgumentError("Parameter userId is required."); |
1620 } | 1630 } |
1621 if (messageId == null) { | 1631 if (messageId == null) { |
1622 throw new core.ArgumentError("Parameter messageId is required."); | 1632 throw new core.ArgumentError("Parameter messageId is required."); |
1623 } | 1633 } |
1624 if (id == null) { | 1634 if (id == null) { |
1625 throw new core.ArgumentError("Parameter id is required."); | 1635 throw new core.ArgumentError("Parameter id is required."); |
1626 } | 1636 } |
1627 | 1637 |
1628 _url = commons.Escaper.ecapeVariable('$userId') + '/messages/' + commons.Esc
aper.ecapeVariable('$messageId') + '/attachments/' + commons.Escaper.ecapeVariab
le('$id'); | 1638 _url = commons.Escaper.ecapeVariable('$userId') + |
| 1639 '/messages/' + |
| 1640 commons.Escaper.ecapeVariable('$messageId') + |
| 1641 '/attachments/' + |
| 1642 commons.Escaper.ecapeVariable('$id'); |
1629 | 1643 |
1630 var _response = _requester.request(_url, | 1644 var _response = _requester.request(_url, "GET", |
1631 "GET", | 1645 body: _body, |
1632 body: _body, | 1646 queryParams: _queryParams, |
1633 queryParams: _queryParams, | 1647 uploadOptions: _uploadOptions, |
1634 uploadOptions: _uploadOptions, | 1648 uploadMedia: _uploadMedia, |
1635 uploadMedia: _uploadMedia, | 1649 downloadOptions: _downloadOptions); |
1636 downloadOptions: _downloadOptions); | |
1637 return _response.then((data) => new MessagePartBody.fromJson(data)); | 1650 return _response.then((data) => new MessagePartBody.fromJson(data)); |
1638 } | 1651 } |
1639 | |
1640 } | 1652 } |
1641 | 1653 |
1642 | |
1643 class UsersSettingsResourceApi { | 1654 class UsersSettingsResourceApi { |
1644 final commons.ApiRequester _requester; | 1655 final commons.ApiRequester _requester; |
1645 | 1656 |
1646 UsersSettingsFiltersResourceApi get filters => new UsersSettingsFiltersResourc
eApi(_requester); | 1657 UsersSettingsFiltersResourceApi get filters => |
1647 UsersSettingsForwardingAddressesResourceApi get forwardingAddresses => new Use
rsSettingsForwardingAddressesResourceApi(_requester); | 1658 new UsersSettingsFiltersResourceApi(_requester); |
1648 UsersSettingsSendAsResourceApi get sendAs => new UsersSettingsSendAsResourceAp
i(_requester); | 1659 UsersSettingsForwardingAddressesResourceApi get forwardingAddresses => |
| 1660 new UsersSettingsForwardingAddressesResourceApi(_requester); |
| 1661 UsersSettingsSendAsResourceApi get sendAs => |
| 1662 new UsersSettingsSendAsResourceApi(_requester); |
1649 | 1663 |
1650 UsersSettingsResourceApi(commons.ApiRequester client) : | 1664 UsersSettingsResourceApi(commons.ApiRequester client) : _requester = client; |
1651 _requester = client; | |
1652 | 1665 |
1653 /** | 1666 /// Gets the auto-forwarding setting for the specified account. |
1654 * Gets the auto-forwarding setting for the specified account. | 1667 /// |
1655 * | 1668 /// Request parameters: |
1656 * Request parameters: | 1669 /// |
1657 * | 1670 /// [userId] - User's email address. The special value "me" can be used to |
1658 * [userId] - User's email address. The special value "me" can be used to | 1671 /// indicate the authenticated user. |
1659 * indicate the authenticated user. | 1672 /// |
1660 * | 1673 /// Completes with a [AutoForwarding]. |
1661 * Completes with a [AutoForwarding]. | 1674 /// |
1662 * | 1675 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1663 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1676 /// an error. |
1664 * error. | 1677 /// |
1665 * | 1678 /// If the used [http.Client] completes with an error when making a REST |
1666 * If the used [http.Client] completes with an error when making a REST call, | 1679 /// call, this method will complete with the same error. |
1667 * this method will complete with the same error. | |
1668 */ | |
1669 async.Future<AutoForwarding> getAutoForwarding(core.String userId) { | 1680 async.Future<AutoForwarding> getAutoForwarding(core.String userId) { |
1670 var _url = null; | 1681 var _url = null; |
1671 var _queryParams = new core.Map(); | 1682 var _queryParams = new core.Map(); |
1672 var _uploadMedia = null; | 1683 var _uploadMedia = null; |
1673 var _uploadOptions = null; | 1684 var _uploadOptions = null; |
1674 var _downloadOptions = commons.DownloadOptions.Metadata; | 1685 var _downloadOptions = commons.DownloadOptions.Metadata; |
1675 var _body = null; | 1686 var _body = null; |
1676 | 1687 |
1677 if (userId == null) { | 1688 if (userId == null) { |
1678 throw new core.ArgumentError("Parameter userId is required."); | 1689 throw new core.ArgumentError("Parameter userId is required."); |
1679 } | 1690 } |
1680 | 1691 |
1681 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/autoForwarding'
; | 1692 _url = |
| 1693 commons.Escaper.ecapeVariable('$userId') + '/settings/autoForwarding'; |
1682 | 1694 |
1683 var _response = _requester.request(_url, | 1695 var _response = _requester.request(_url, "GET", |
1684 "GET", | 1696 body: _body, |
1685 body: _body, | 1697 queryParams: _queryParams, |
1686 queryParams: _queryParams, | 1698 uploadOptions: _uploadOptions, |
1687 uploadOptions: _uploadOptions, | 1699 uploadMedia: _uploadMedia, |
1688 uploadMedia: _uploadMedia, | 1700 downloadOptions: _downloadOptions); |
1689 downloadOptions: _downloadOptions); | |
1690 return _response.then((data) => new AutoForwarding.fromJson(data)); | 1701 return _response.then((data) => new AutoForwarding.fromJson(data)); |
1691 } | 1702 } |
1692 | 1703 |
1693 /** | 1704 /// Gets IMAP settings. |
1694 * Gets IMAP settings. | 1705 /// |
1695 * | 1706 /// Request parameters: |
1696 * Request parameters: | 1707 /// |
1697 * | 1708 /// [userId] - User's email address. The special value "me" can be used to |
1698 * [userId] - User's email address. The special value "me" can be used to | 1709 /// indicate the authenticated user. |
1699 * indicate the authenticated user. | 1710 /// |
1700 * | 1711 /// Completes with a [ImapSettings]. |
1701 * Completes with a [ImapSettings]. | 1712 /// |
1702 * | 1713 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1703 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1714 /// an error. |
1704 * error. | 1715 /// |
1705 * | 1716 /// If the used [http.Client] completes with an error when making a REST |
1706 * If the used [http.Client] completes with an error when making a REST call, | 1717 /// call, this method will complete with the same error. |
1707 * this method will complete with the same error. | |
1708 */ | |
1709 async.Future<ImapSettings> getImap(core.String userId) { | 1718 async.Future<ImapSettings> getImap(core.String userId) { |
1710 var _url = null; | 1719 var _url = null; |
1711 var _queryParams = new core.Map(); | 1720 var _queryParams = new core.Map(); |
1712 var _uploadMedia = null; | 1721 var _uploadMedia = null; |
1713 var _uploadOptions = null; | 1722 var _uploadOptions = null; |
1714 var _downloadOptions = commons.DownloadOptions.Metadata; | 1723 var _downloadOptions = commons.DownloadOptions.Metadata; |
1715 var _body = null; | 1724 var _body = null; |
1716 | 1725 |
1717 if (userId == null) { | 1726 if (userId == null) { |
1718 throw new core.ArgumentError("Parameter userId is required."); | 1727 throw new core.ArgumentError("Parameter userId is required."); |
1719 } | 1728 } |
1720 | 1729 |
1721 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/imap'; | 1730 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/imap'; |
1722 | 1731 |
1723 var _response = _requester.request(_url, | 1732 var _response = _requester.request(_url, "GET", |
1724 "GET", | 1733 body: _body, |
1725 body: _body, | 1734 queryParams: _queryParams, |
1726 queryParams: _queryParams, | 1735 uploadOptions: _uploadOptions, |
1727 uploadOptions: _uploadOptions, | 1736 uploadMedia: _uploadMedia, |
1728 uploadMedia: _uploadMedia, | 1737 downloadOptions: _downloadOptions); |
1729 downloadOptions: _downloadOptions); | |
1730 return _response.then((data) => new ImapSettings.fromJson(data)); | 1738 return _response.then((data) => new ImapSettings.fromJson(data)); |
1731 } | 1739 } |
1732 | 1740 |
1733 /** | 1741 /// Gets POP settings. |
1734 * Gets POP settings. | 1742 /// |
1735 * | 1743 /// Request parameters: |
1736 * Request parameters: | 1744 /// |
1737 * | 1745 /// [userId] - User's email address. The special value "me" can be used to |
1738 * [userId] - User's email address. The special value "me" can be used to | 1746 /// indicate the authenticated user. |
1739 * indicate the authenticated user. | 1747 /// |
1740 * | 1748 /// Completes with a [PopSettings]. |
1741 * Completes with a [PopSettings]. | 1749 /// |
1742 * | 1750 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1743 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1751 /// an error. |
1744 * error. | 1752 /// |
1745 * | 1753 /// If the used [http.Client] completes with an error when making a REST |
1746 * If the used [http.Client] completes with an error when making a REST call, | 1754 /// call, this method will complete with the same error. |
1747 * this method will complete with the same error. | |
1748 */ | |
1749 async.Future<PopSettings> getPop(core.String userId) { | 1755 async.Future<PopSettings> getPop(core.String userId) { |
1750 var _url = null; | 1756 var _url = null; |
1751 var _queryParams = new core.Map(); | 1757 var _queryParams = new core.Map(); |
1752 var _uploadMedia = null; | 1758 var _uploadMedia = null; |
1753 var _uploadOptions = null; | 1759 var _uploadOptions = null; |
1754 var _downloadOptions = commons.DownloadOptions.Metadata; | 1760 var _downloadOptions = commons.DownloadOptions.Metadata; |
1755 var _body = null; | 1761 var _body = null; |
1756 | 1762 |
1757 if (userId == null) { | 1763 if (userId == null) { |
1758 throw new core.ArgumentError("Parameter userId is required."); | 1764 throw new core.ArgumentError("Parameter userId is required."); |
1759 } | 1765 } |
1760 | 1766 |
1761 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/pop'; | 1767 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/pop'; |
1762 | 1768 |
1763 var _response = _requester.request(_url, | 1769 var _response = _requester.request(_url, "GET", |
1764 "GET", | 1770 body: _body, |
1765 body: _body, | 1771 queryParams: _queryParams, |
1766 queryParams: _queryParams, | 1772 uploadOptions: _uploadOptions, |
1767 uploadOptions: _uploadOptions, | 1773 uploadMedia: _uploadMedia, |
1768 uploadMedia: _uploadMedia, | 1774 downloadOptions: _downloadOptions); |
1769 downloadOptions: _downloadOptions); | |
1770 return _response.then((data) => new PopSettings.fromJson(data)); | 1775 return _response.then((data) => new PopSettings.fromJson(data)); |
1771 } | 1776 } |
1772 | 1777 |
1773 /** | 1778 /// Gets vacation responder settings. |
1774 * Gets vacation responder settings. | 1779 /// |
1775 * | 1780 /// Request parameters: |
1776 * Request parameters: | 1781 /// |
1777 * | 1782 /// [userId] - User's email address. The special value "me" can be used to |
1778 * [userId] - User's email address. The special value "me" can be used to | 1783 /// indicate the authenticated user. |
1779 * indicate the authenticated user. | 1784 /// |
1780 * | 1785 /// Completes with a [VacationSettings]. |
1781 * Completes with a [VacationSettings]. | 1786 /// |
1782 * | 1787 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1783 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1788 /// an error. |
1784 * error. | 1789 /// |
1785 * | 1790 /// If the used [http.Client] completes with an error when making a REST |
1786 * If the used [http.Client] completes with an error when making a REST call, | 1791 /// call, this method will complete with the same error. |
1787 * this method will complete with the same error. | |
1788 */ | |
1789 async.Future<VacationSettings> getVacation(core.String userId) { | 1792 async.Future<VacationSettings> getVacation(core.String userId) { |
1790 var _url = null; | 1793 var _url = null; |
1791 var _queryParams = new core.Map(); | 1794 var _queryParams = new core.Map(); |
1792 var _uploadMedia = null; | 1795 var _uploadMedia = null; |
1793 var _uploadOptions = null; | 1796 var _uploadOptions = null; |
1794 var _downloadOptions = commons.DownloadOptions.Metadata; | 1797 var _downloadOptions = commons.DownloadOptions.Metadata; |
1795 var _body = null; | 1798 var _body = null; |
1796 | 1799 |
1797 if (userId == null) { | 1800 if (userId == null) { |
1798 throw new core.ArgumentError("Parameter userId is required."); | 1801 throw new core.ArgumentError("Parameter userId is required."); |
1799 } | 1802 } |
1800 | 1803 |
1801 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/vacation'; | 1804 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/vacation'; |
1802 | 1805 |
1803 var _response = _requester.request(_url, | 1806 var _response = _requester.request(_url, "GET", |
1804 "GET", | 1807 body: _body, |
1805 body: _body, | 1808 queryParams: _queryParams, |
1806 queryParams: _queryParams, | 1809 uploadOptions: _uploadOptions, |
1807 uploadOptions: _uploadOptions, | 1810 uploadMedia: _uploadMedia, |
1808 uploadMedia: _uploadMedia, | 1811 downloadOptions: _downloadOptions); |
1809 downloadOptions: _downloadOptions); | |
1810 return _response.then((data) => new VacationSettings.fromJson(data)); | 1812 return _response.then((data) => new VacationSettings.fromJson(data)); |
1811 } | 1813 } |
1812 | 1814 |
1813 /** | 1815 /// Updates the auto-forwarding setting for the specified account. A verified |
1814 * Updates the auto-forwarding setting for the specified account. A verified | 1816 /// forwarding address must be specified when auto-forwarding is enabled. |
1815 * forwarding address must be specified when auto-forwarding is enabled. | 1817 /// |
1816 * | 1818 /// This method is only available to service account clients that have been |
1817 * This method is only available to service account clients that have been | 1819 /// delegated domain-wide authority. |
1818 * delegated domain-wide authority. | 1820 /// |
1819 * | 1821 /// [request] - The metadata request object. |
1820 * [request] - The metadata request object. | 1822 /// |
1821 * | 1823 /// Request parameters: |
1822 * Request parameters: | 1824 /// |
1823 * | 1825 /// [userId] - User's email address. The special value "me" can be used to |
1824 * [userId] - User's email address. The special value "me" can be used to | 1826 /// indicate the authenticated user. |
1825 * indicate the authenticated user. | 1827 /// |
1826 * | 1828 /// Completes with a [AutoForwarding]. |
1827 * Completes with a [AutoForwarding]. | 1829 /// |
1828 * | 1830 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1829 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1831 /// an error. |
1830 * error. | 1832 /// |
1831 * | 1833 /// If the used [http.Client] completes with an error when making a REST |
1832 * If the used [http.Client] completes with an error when making a REST call, | 1834 /// call, this method will complete with the same error. |
1833 * this method will complete with the same error. | 1835 async.Future<AutoForwarding> updateAutoForwarding( |
1834 */ | 1836 AutoForwarding request, core.String userId) { |
1835 async.Future<AutoForwarding> updateAutoForwarding(AutoForwarding request, core
.String userId) { | |
1836 var _url = null; | 1837 var _url = null; |
1837 var _queryParams = new core.Map(); | 1838 var _queryParams = new core.Map(); |
1838 var _uploadMedia = null; | 1839 var _uploadMedia = null; |
1839 var _uploadOptions = null; | 1840 var _uploadOptions = null; |
1840 var _downloadOptions = commons.DownloadOptions.Metadata; | 1841 var _downloadOptions = commons.DownloadOptions.Metadata; |
1841 var _body = null; | 1842 var _body = null; |
1842 | 1843 |
1843 if (request != null) { | 1844 if (request != null) { |
1844 _body = convert.JSON.encode((request).toJson()); | 1845 _body = convert.JSON.encode((request).toJson()); |
1845 } | 1846 } |
1846 if (userId == null) { | 1847 if (userId == null) { |
1847 throw new core.ArgumentError("Parameter userId is required."); | 1848 throw new core.ArgumentError("Parameter userId is required."); |
1848 } | 1849 } |
1849 | 1850 |
1850 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/autoForwarding'
; | 1851 _url = |
| 1852 commons.Escaper.ecapeVariable('$userId') + '/settings/autoForwarding'; |
1851 | 1853 |
1852 var _response = _requester.request(_url, | 1854 var _response = _requester.request(_url, "PUT", |
1853 "PUT", | 1855 body: _body, |
1854 body: _body, | 1856 queryParams: _queryParams, |
1855 queryParams: _queryParams, | 1857 uploadOptions: _uploadOptions, |
1856 uploadOptions: _uploadOptions, | 1858 uploadMedia: _uploadMedia, |
1857 uploadMedia: _uploadMedia, | 1859 downloadOptions: _downloadOptions); |
1858 downloadOptions: _downloadOptions); | |
1859 return _response.then((data) => new AutoForwarding.fromJson(data)); | 1860 return _response.then((data) => new AutoForwarding.fromJson(data)); |
1860 } | 1861 } |
1861 | 1862 |
1862 /** | 1863 /// Updates IMAP settings. |
1863 * Updates IMAP settings. | 1864 /// |
1864 * | 1865 /// [request] - The metadata request object. |
1865 * [request] - The metadata request object. | 1866 /// |
1866 * | 1867 /// Request parameters: |
1867 * Request parameters: | 1868 /// |
1868 * | 1869 /// [userId] - User's email address. The special value "me" can be used to |
1869 * [userId] - User's email address. The special value "me" can be used to | 1870 /// indicate the authenticated user. |
1870 * indicate the authenticated user. | 1871 /// |
1871 * | 1872 /// Completes with a [ImapSettings]. |
1872 * Completes with a [ImapSettings]. | 1873 /// |
1873 * | 1874 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1874 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1875 /// an error. |
1875 * error. | 1876 /// |
1876 * | 1877 /// If the used [http.Client] completes with an error when making a REST |
1877 * If the used [http.Client] completes with an error when making a REST call, | 1878 /// call, this method will complete with the same error. |
1878 * this method will complete with the same error. | 1879 async.Future<ImapSettings> updateImap( |
1879 */ | 1880 ImapSettings request, core.String userId) { |
1880 async.Future<ImapSettings> updateImap(ImapSettings request, core.String userId
) { | |
1881 var _url = null; | 1881 var _url = null; |
1882 var _queryParams = new core.Map(); | 1882 var _queryParams = new core.Map(); |
1883 var _uploadMedia = null; | 1883 var _uploadMedia = null; |
1884 var _uploadOptions = null; | 1884 var _uploadOptions = null; |
1885 var _downloadOptions = commons.DownloadOptions.Metadata; | 1885 var _downloadOptions = commons.DownloadOptions.Metadata; |
1886 var _body = null; | 1886 var _body = null; |
1887 | 1887 |
1888 if (request != null) { | 1888 if (request != null) { |
1889 _body = convert.JSON.encode((request).toJson()); | 1889 _body = convert.JSON.encode((request).toJson()); |
1890 } | 1890 } |
1891 if (userId == null) { | 1891 if (userId == null) { |
1892 throw new core.ArgumentError("Parameter userId is required."); | 1892 throw new core.ArgumentError("Parameter userId is required."); |
1893 } | 1893 } |
1894 | 1894 |
1895 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/imap'; | 1895 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/imap'; |
1896 | 1896 |
1897 var _response = _requester.request(_url, | 1897 var _response = _requester.request(_url, "PUT", |
1898 "PUT", | 1898 body: _body, |
1899 body: _body, | 1899 queryParams: _queryParams, |
1900 queryParams: _queryParams, | 1900 uploadOptions: _uploadOptions, |
1901 uploadOptions: _uploadOptions, | 1901 uploadMedia: _uploadMedia, |
1902 uploadMedia: _uploadMedia, | 1902 downloadOptions: _downloadOptions); |
1903 downloadOptions: _downloadOptions); | |
1904 return _response.then((data) => new ImapSettings.fromJson(data)); | 1903 return _response.then((data) => new ImapSettings.fromJson(data)); |
1905 } | 1904 } |
1906 | 1905 |
1907 /** | 1906 /// Updates POP settings. |
1908 * Updates POP settings. | 1907 /// |
1909 * | 1908 /// [request] - The metadata request object. |
1910 * [request] - The metadata request object. | 1909 /// |
1911 * | 1910 /// Request parameters: |
1912 * Request parameters: | 1911 /// |
1913 * | 1912 /// [userId] - User's email address. The special value "me" can be used to |
1914 * [userId] - User's email address. The special value "me" can be used to | 1913 /// indicate the authenticated user. |
1915 * indicate the authenticated user. | 1914 /// |
1916 * | 1915 /// Completes with a [PopSettings]. |
1917 * Completes with a [PopSettings]. | 1916 /// |
1918 * | 1917 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1919 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1918 /// an error. |
1920 * error. | 1919 /// |
1921 * | 1920 /// If the used [http.Client] completes with an error when making a REST |
1922 * If the used [http.Client] completes with an error when making a REST call, | 1921 /// call, this method will complete with the same error. |
1923 * this method will complete with the same error. | |
1924 */ | |
1925 async.Future<PopSettings> updatePop(PopSettings request, core.String userId) { | 1922 async.Future<PopSettings> updatePop(PopSettings request, core.String userId) { |
1926 var _url = null; | 1923 var _url = null; |
1927 var _queryParams = new core.Map(); | 1924 var _queryParams = new core.Map(); |
1928 var _uploadMedia = null; | 1925 var _uploadMedia = null; |
1929 var _uploadOptions = null; | 1926 var _uploadOptions = null; |
1930 var _downloadOptions = commons.DownloadOptions.Metadata; | 1927 var _downloadOptions = commons.DownloadOptions.Metadata; |
1931 var _body = null; | 1928 var _body = null; |
1932 | 1929 |
1933 if (request != null) { | 1930 if (request != null) { |
1934 _body = convert.JSON.encode((request).toJson()); | 1931 _body = convert.JSON.encode((request).toJson()); |
1935 } | 1932 } |
1936 if (userId == null) { | 1933 if (userId == null) { |
1937 throw new core.ArgumentError("Parameter userId is required."); | 1934 throw new core.ArgumentError("Parameter userId is required."); |
1938 } | 1935 } |
1939 | 1936 |
1940 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/pop'; | 1937 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/pop'; |
1941 | 1938 |
1942 var _response = _requester.request(_url, | 1939 var _response = _requester.request(_url, "PUT", |
1943 "PUT", | 1940 body: _body, |
1944 body: _body, | 1941 queryParams: _queryParams, |
1945 queryParams: _queryParams, | 1942 uploadOptions: _uploadOptions, |
1946 uploadOptions: _uploadOptions, | 1943 uploadMedia: _uploadMedia, |
1947 uploadMedia: _uploadMedia, | 1944 downloadOptions: _downloadOptions); |
1948 downloadOptions: _downloadOptions); | |
1949 return _response.then((data) => new PopSettings.fromJson(data)); | 1945 return _response.then((data) => new PopSettings.fromJson(data)); |
1950 } | 1946 } |
1951 | 1947 |
1952 /** | 1948 /// Updates vacation responder settings. |
1953 * Updates vacation responder settings. | 1949 /// |
1954 * | 1950 /// [request] - The metadata request object. |
1955 * [request] - The metadata request object. | 1951 /// |
1956 * | 1952 /// Request parameters: |
1957 * Request parameters: | 1953 /// |
1958 * | 1954 /// [userId] - User's email address. The special value "me" can be used to |
1959 * [userId] - User's email address. The special value "me" can be used to | 1955 /// indicate the authenticated user. |
1960 * indicate the authenticated user. | 1956 /// |
1961 * | 1957 /// Completes with a [VacationSettings]. |
1962 * Completes with a [VacationSettings]. | 1958 /// |
1963 * | 1959 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1964 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1960 /// an error. |
1965 * error. | 1961 /// |
1966 * | 1962 /// If the used [http.Client] completes with an error when making a REST |
1967 * If the used [http.Client] completes with an error when making a REST call, | 1963 /// call, this method will complete with the same error. |
1968 * this method will complete with the same error. | 1964 async.Future<VacationSettings> updateVacation( |
1969 */ | 1965 VacationSettings request, core.String userId) { |
1970 async.Future<VacationSettings> updateVacation(VacationSettings request, core.S
tring userId) { | |
1971 var _url = null; | 1966 var _url = null; |
1972 var _queryParams = new core.Map(); | 1967 var _queryParams = new core.Map(); |
1973 var _uploadMedia = null; | 1968 var _uploadMedia = null; |
1974 var _uploadOptions = null; | 1969 var _uploadOptions = null; |
1975 var _downloadOptions = commons.DownloadOptions.Metadata; | 1970 var _downloadOptions = commons.DownloadOptions.Metadata; |
1976 var _body = null; | 1971 var _body = null; |
1977 | 1972 |
1978 if (request != null) { | 1973 if (request != null) { |
1979 _body = convert.JSON.encode((request).toJson()); | 1974 _body = convert.JSON.encode((request).toJson()); |
1980 } | 1975 } |
1981 if (userId == null) { | 1976 if (userId == null) { |
1982 throw new core.ArgumentError("Parameter userId is required."); | 1977 throw new core.ArgumentError("Parameter userId is required."); |
1983 } | 1978 } |
1984 | 1979 |
1985 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/vacation'; | 1980 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/vacation'; |
1986 | 1981 |
1987 var _response = _requester.request(_url, | 1982 var _response = _requester.request(_url, "PUT", |
1988 "PUT", | 1983 body: _body, |
1989 body: _body, | 1984 queryParams: _queryParams, |
1990 queryParams: _queryParams, | 1985 uploadOptions: _uploadOptions, |
1991 uploadOptions: _uploadOptions, | 1986 uploadMedia: _uploadMedia, |
1992 uploadMedia: _uploadMedia, | 1987 downloadOptions: _downloadOptions); |
1993 downloadOptions: _downloadOptions); | |
1994 return _response.then((data) => new VacationSettings.fromJson(data)); | 1988 return _response.then((data) => new VacationSettings.fromJson(data)); |
1995 } | 1989 } |
1996 | |
1997 } | 1990 } |
1998 | 1991 |
1999 | |
2000 class UsersSettingsFiltersResourceApi { | 1992 class UsersSettingsFiltersResourceApi { |
2001 final commons.ApiRequester _requester; | 1993 final commons.ApiRequester _requester; |
2002 | 1994 |
2003 UsersSettingsFiltersResourceApi(commons.ApiRequester client) : | 1995 UsersSettingsFiltersResourceApi(commons.ApiRequester client) |
2004 _requester = client; | 1996 : _requester = client; |
2005 | 1997 |
2006 /** | 1998 /// Creates a filter. |
2007 * Creates a filter. | 1999 /// |
2008 * | 2000 /// [request] - The metadata request object. |
2009 * [request] - The metadata request object. | 2001 /// |
2010 * | 2002 /// Request parameters: |
2011 * Request parameters: | 2003 /// |
2012 * | 2004 /// [userId] - User's email address. The special value "me" can be used to |
2013 * [userId] - User's email address. The special value "me" can be used to | 2005 /// indicate the authenticated user. |
2014 * indicate the authenticated user. | 2006 /// |
2015 * | 2007 /// Completes with a [Filter]. |
2016 * Completes with a [Filter]. | 2008 /// |
2017 * | 2009 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2018 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2010 /// an error. |
2019 * error. | 2011 /// |
2020 * | 2012 /// If the used [http.Client] completes with an error when making a REST |
2021 * If the used [http.Client] completes with an error when making a REST call, | 2013 /// call, this method will complete with the same error. |
2022 * this method will complete with the same error. | |
2023 */ | |
2024 async.Future<Filter> create(Filter request, core.String userId) { | 2014 async.Future<Filter> create(Filter request, core.String userId) { |
2025 var _url = null; | 2015 var _url = null; |
2026 var _queryParams = new core.Map(); | 2016 var _queryParams = new core.Map(); |
2027 var _uploadMedia = null; | 2017 var _uploadMedia = null; |
2028 var _uploadOptions = null; | 2018 var _uploadOptions = null; |
2029 var _downloadOptions = commons.DownloadOptions.Metadata; | 2019 var _downloadOptions = commons.DownloadOptions.Metadata; |
2030 var _body = null; | 2020 var _body = null; |
2031 | 2021 |
2032 if (request != null) { | 2022 if (request != null) { |
2033 _body = convert.JSON.encode((request).toJson()); | 2023 _body = convert.JSON.encode((request).toJson()); |
2034 } | 2024 } |
2035 if (userId == null) { | 2025 if (userId == null) { |
2036 throw new core.ArgumentError("Parameter userId is required."); | 2026 throw new core.ArgumentError("Parameter userId is required."); |
2037 } | 2027 } |
2038 | 2028 |
2039 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters'; | 2029 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters'; |
2040 | 2030 |
2041 var _response = _requester.request(_url, | 2031 var _response = _requester.request(_url, "POST", |
2042 "POST", | 2032 body: _body, |
2043 body: _body, | 2033 queryParams: _queryParams, |
2044 queryParams: _queryParams, | 2034 uploadOptions: _uploadOptions, |
2045 uploadOptions: _uploadOptions, | 2035 uploadMedia: _uploadMedia, |
2046 uploadMedia: _uploadMedia, | 2036 downloadOptions: _downloadOptions); |
2047 downloadOptions: _downloadOptions); | |
2048 return _response.then((data) => new Filter.fromJson(data)); | 2037 return _response.then((data) => new Filter.fromJson(data)); |
2049 } | 2038 } |
2050 | 2039 |
2051 /** | 2040 /// Deletes a filter. |
2052 * Deletes a filter. | 2041 /// |
2053 * | 2042 /// Request parameters: |
2054 * Request parameters: | 2043 /// |
2055 * | 2044 /// [userId] - User's email address. The special value "me" can be used to |
2056 * [userId] - User's email address. The special value "me" can be used to | 2045 /// indicate the authenticated user. |
2057 * indicate the authenticated user. | 2046 /// |
2058 * | 2047 /// [id] - The ID of the filter to be deleted. |
2059 * [id] - The ID of the filter to be deleted. | 2048 /// |
2060 * | 2049 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2061 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2050 /// an error. |
2062 * error. | 2051 /// |
2063 * | 2052 /// If the used [http.Client] completes with an error when making a REST |
2064 * If the used [http.Client] completes with an error when making a REST call, | 2053 /// call, this method will complete with the same error. |
2065 * this method will complete with the same error. | |
2066 */ | |
2067 async.Future delete(core.String userId, core.String id) { | 2054 async.Future delete(core.String userId, core.String id) { |
2068 var _url = null; | 2055 var _url = null; |
2069 var _queryParams = new core.Map(); | 2056 var _queryParams = new core.Map(); |
2070 var _uploadMedia = null; | 2057 var _uploadMedia = null; |
2071 var _uploadOptions = null; | 2058 var _uploadOptions = null; |
2072 var _downloadOptions = commons.DownloadOptions.Metadata; | 2059 var _downloadOptions = commons.DownloadOptions.Metadata; |
2073 var _body = null; | 2060 var _body = null; |
2074 | 2061 |
2075 if (userId == null) { | 2062 if (userId == null) { |
2076 throw new core.ArgumentError("Parameter userId is required."); | 2063 throw new core.ArgumentError("Parameter userId is required."); |
2077 } | 2064 } |
2078 if (id == null) { | 2065 if (id == null) { |
2079 throw new core.ArgumentError("Parameter id is required."); | 2066 throw new core.ArgumentError("Parameter id is required."); |
2080 } | 2067 } |
2081 | 2068 |
2082 _downloadOptions = null; | 2069 _downloadOptions = null; |
2083 | 2070 |
2084 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters/' + com
mons.Escaper.ecapeVariable('$id'); | 2071 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2072 '/settings/filters/' + |
| 2073 commons.Escaper.ecapeVariable('$id'); |
2085 | 2074 |
2086 var _response = _requester.request(_url, | 2075 var _response = _requester.request(_url, "DELETE", |
2087 "DELETE", | 2076 body: _body, |
2088 body: _body, | 2077 queryParams: _queryParams, |
2089 queryParams: _queryParams, | 2078 uploadOptions: _uploadOptions, |
2090 uploadOptions: _uploadOptions, | 2079 uploadMedia: _uploadMedia, |
2091 uploadMedia: _uploadMedia, | 2080 downloadOptions: _downloadOptions); |
2092 downloadOptions: _downloadOptions); | |
2093 return _response.then((data) => null); | 2081 return _response.then((data) => null); |
2094 } | 2082 } |
2095 | 2083 |
2096 /** | 2084 /// Gets a filter. |
2097 * Gets a filter. | 2085 /// |
2098 * | 2086 /// Request parameters: |
2099 * Request parameters: | 2087 /// |
2100 * | 2088 /// [userId] - User's email address. The special value "me" can be used to |
2101 * [userId] - User's email address. The special value "me" can be used to | 2089 /// indicate the authenticated user. |
2102 * indicate the authenticated user. | 2090 /// |
2103 * | 2091 /// [id] - The ID of the filter to be fetched. |
2104 * [id] - The ID of the filter to be fetched. | 2092 /// |
2105 * | 2093 /// Completes with a [Filter]. |
2106 * Completes with a [Filter]. | 2094 /// |
2107 * | 2095 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2108 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2096 /// an error. |
2109 * error. | 2097 /// |
2110 * | 2098 /// If the used [http.Client] completes with an error when making a REST |
2111 * If the used [http.Client] completes with an error when making a REST call, | 2099 /// call, this method will complete with the same error. |
2112 * this method will complete with the same error. | |
2113 */ | |
2114 async.Future<Filter> get(core.String userId, core.String id) { | 2100 async.Future<Filter> get(core.String userId, core.String id) { |
2115 var _url = null; | 2101 var _url = null; |
2116 var _queryParams = new core.Map(); | 2102 var _queryParams = new core.Map(); |
2117 var _uploadMedia = null; | 2103 var _uploadMedia = null; |
2118 var _uploadOptions = null; | 2104 var _uploadOptions = null; |
2119 var _downloadOptions = commons.DownloadOptions.Metadata; | 2105 var _downloadOptions = commons.DownloadOptions.Metadata; |
2120 var _body = null; | 2106 var _body = null; |
2121 | 2107 |
2122 if (userId == null) { | 2108 if (userId == null) { |
2123 throw new core.ArgumentError("Parameter userId is required."); | 2109 throw new core.ArgumentError("Parameter userId is required."); |
2124 } | 2110 } |
2125 if (id == null) { | 2111 if (id == null) { |
2126 throw new core.ArgumentError("Parameter id is required."); | 2112 throw new core.ArgumentError("Parameter id is required."); |
2127 } | 2113 } |
2128 | 2114 |
2129 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters/' + com
mons.Escaper.ecapeVariable('$id'); | 2115 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2116 '/settings/filters/' + |
| 2117 commons.Escaper.ecapeVariable('$id'); |
2130 | 2118 |
2131 var _response = _requester.request(_url, | 2119 var _response = _requester.request(_url, "GET", |
2132 "GET", | 2120 body: _body, |
2133 body: _body, | 2121 queryParams: _queryParams, |
2134 queryParams: _queryParams, | 2122 uploadOptions: _uploadOptions, |
2135 uploadOptions: _uploadOptions, | 2123 uploadMedia: _uploadMedia, |
2136 uploadMedia: _uploadMedia, | 2124 downloadOptions: _downloadOptions); |
2137 downloadOptions: _downloadOptions); | |
2138 return _response.then((data) => new Filter.fromJson(data)); | 2125 return _response.then((data) => new Filter.fromJson(data)); |
2139 } | 2126 } |
2140 | 2127 |
2141 /** | 2128 /// Lists the message filters of a Gmail user. |
2142 * Lists the message filters of a Gmail user. | 2129 /// |
2143 * | 2130 /// Request parameters: |
2144 * Request parameters: | 2131 /// |
2145 * | 2132 /// [userId] - User's email address. The special value "me" can be used to |
2146 * [userId] - User's email address. The special value "me" can be used to | 2133 /// indicate the authenticated user. |
2147 * indicate the authenticated user. | 2134 /// |
2148 * | 2135 /// Completes with a [ListFiltersResponse]. |
2149 * Completes with a [ListFiltersResponse]. | 2136 /// |
2150 * | 2137 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2151 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2138 /// an error. |
2152 * error. | 2139 /// |
2153 * | 2140 /// If the used [http.Client] completes with an error when making a REST |
2154 * If the used [http.Client] completes with an error when making a REST call, | 2141 /// call, this method will complete with the same error. |
2155 * this method will complete with the same error. | |
2156 */ | |
2157 async.Future<ListFiltersResponse> list(core.String userId) { | 2142 async.Future<ListFiltersResponse> list(core.String userId) { |
2158 var _url = null; | 2143 var _url = null; |
2159 var _queryParams = new core.Map(); | 2144 var _queryParams = new core.Map(); |
2160 var _uploadMedia = null; | 2145 var _uploadMedia = null; |
2161 var _uploadOptions = null; | 2146 var _uploadOptions = null; |
2162 var _downloadOptions = commons.DownloadOptions.Metadata; | 2147 var _downloadOptions = commons.DownloadOptions.Metadata; |
2163 var _body = null; | 2148 var _body = null; |
2164 | 2149 |
2165 if (userId == null) { | 2150 if (userId == null) { |
2166 throw new core.ArgumentError("Parameter userId is required."); | 2151 throw new core.ArgumentError("Parameter userId is required."); |
2167 } | 2152 } |
2168 | 2153 |
2169 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters'; | 2154 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/filters'; |
2170 | 2155 |
2171 var _response = _requester.request(_url, | 2156 var _response = _requester.request(_url, "GET", |
2172 "GET", | 2157 body: _body, |
2173 body: _body, | 2158 queryParams: _queryParams, |
2174 queryParams: _queryParams, | 2159 uploadOptions: _uploadOptions, |
2175 uploadOptions: _uploadOptions, | 2160 uploadMedia: _uploadMedia, |
2176 uploadMedia: _uploadMedia, | 2161 downloadOptions: _downloadOptions); |
2177 downloadOptions: _downloadOptions); | |
2178 return _response.then((data) => new ListFiltersResponse.fromJson(data)); | 2162 return _response.then((data) => new ListFiltersResponse.fromJson(data)); |
2179 } | 2163 } |
2180 | |
2181 } | 2164 } |
2182 | 2165 |
2183 | |
2184 class UsersSettingsForwardingAddressesResourceApi { | 2166 class UsersSettingsForwardingAddressesResourceApi { |
2185 final commons.ApiRequester _requester; | 2167 final commons.ApiRequester _requester; |
2186 | 2168 |
2187 UsersSettingsForwardingAddressesResourceApi(commons.ApiRequester client) : | 2169 UsersSettingsForwardingAddressesResourceApi(commons.ApiRequester client) |
2188 _requester = client; | 2170 : _requester = client; |
2189 | 2171 |
2190 /** | 2172 /// Creates a forwarding address. If ownership verification is required, a |
2191 * Creates a forwarding address. If ownership verification is required, a | 2173 /// message will be sent to the recipient and the resource's verification |
2192 * message will be sent to the recipient and the resource's verification | 2174 /// status will be set to pending; otherwise, the resource will be created |
2193 * status will be set to pending; otherwise, the resource will be created with | 2175 /// with verification status set to accepted. |
2194 * verification status set to accepted. | 2176 /// |
2195 * | 2177 /// This method is only available to service account clients that have been |
2196 * This method is only available to service account clients that have been | 2178 /// delegated domain-wide authority. |
2197 * delegated domain-wide authority. | 2179 /// |
2198 * | 2180 /// [request] - The metadata request object. |
2199 * [request] - The metadata request object. | 2181 /// |
2200 * | 2182 /// Request parameters: |
2201 * Request parameters: | 2183 /// |
2202 * | 2184 /// [userId] - User's email address. The special value "me" can be used to |
2203 * [userId] - User's email address. The special value "me" can be used to | 2185 /// indicate the authenticated user. |
2204 * indicate the authenticated user. | 2186 /// |
2205 * | 2187 /// Completes with a [ForwardingAddress]. |
2206 * Completes with a [ForwardingAddress]. | 2188 /// |
2207 * | 2189 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2208 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2190 /// an error. |
2209 * error. | 2191 /// |
2210 * | 2192 /// If the used [http.Client] completes with an error when making a REST |
2211 * If the used [http.Client] completes with an error when making a REST call, | 2193 /// call, this method will complete with the same error. |
2212 * this method will complete with the same error. | 2194 async.Future<ForwardingAddress> create( |
2213 */ | 2195 ForwardingAddress request, core.String userId) { |
2214 async.Future<ForwardingAddress> create(ForwardingAddress request, core.String
userId) { | |
2215 var _url = null; | 2196 var _url = null; |
2216 var _queryParams = new core.Map(); | 2197 var _queryParams = new core.Map(); |
2217 var _uploadMedia = null; | 2198 var _uploadMedia = null; |
2218 var _uploadOptions = null; | 2199 var _uploadOptions = null; |
2219 var _downloadOptions = commons.DownloadOptions.Metadata; | 2200 var _downloadOptions = commons.DownloadOptions.Metadata; |
2220 var _body = null; | 2201 var _body = null; |
2221 | 2202 |
2222 if (request != null) { | 2203 if (request != null) { |
2223 _body = convert.JSON.encode((request).toJson()); | 2204 _body = convert.JSON.encode((request).toJson()); |
2224 } | 2205 } |
2225 if (userId == null) { | 2206 if (userId == null) { |
2226 throw new core.ArgumentError("Parameter userId is required."); | 2207 throw new core.ArgumentError("Parameter userId is required."); |
2227 } | 2208 } |
2228 | 2209 |
2229 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddre
sses'; | 2210 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2211 '/settings/forwardingAddresses'; |
2230 | 2212 |
2231 var _response = _requester.request(_url, | 2213 var _response = _requester.request(_url, "POST", |
2232 "POST", | 2214 body: _body, |
2233 body: _body, | 2215 queryParams: _queryParams, |
2234 queryParams: _queryParams, | 2216 uploadOptions: _uploadOptions, |
2235 uploadOptions: _uploadOptions, | 2217 uploadMedia: _uploadMedia, |
2236 uploadMedia: _uploadMedia, | 2218 downloadOptions: _downloadOptions); |
2237 downloadOptions: _downloadOptions); | |
2238 return _response.then((data) => new ForwardingAddress.fromJson(data)); | 2219 return _response.then((data) => new ForwardingAddress.fromJson(data)); |
2239 } | 2220 } |
2240 | 2221 |
2241 /** | 2222 /// Deletes the specified forwarding address and revokes any verification |
2242 * Deletes the specified forwarding address and revokes any verification that | 2223 /// that may have been required. |
2243 * may have been required. | 2224 /// |
2244 * | 2225 /// This method is only available to service account clients that have been |
2245 * This method is only available to service account clients that have been | 2226 /// delegated domain-wide authority. |
2246 * delegated domain-wide authority. | 2227 /// |
2247 * | 2228 /// Request parameters: |
2248 * Request parameters: | 2229 /// |
2249 * | 2230 /// [userId] - User's email address. The special value "me" can be used to |
2250 * [userId] - User's email address. The special value "me" can be used to | 2231 /// indicate the authenticated user. |
2251 * indicate the authenticated user. | 2232 /// |
2252 * | 2233 /// [forwardingEmail] - The forwarding address to be deleted. |
2253 * [forwardingEmail] - The forwarding address to be deleted. | 2234 /// |
2254 * | 2235 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2255 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2236 /// an error. |
2256 * error. | 2237 /// |
2257 * | 2238 /// If the used [http.Client] completes with an error when making a REST |
2258 * If the used [http.Client] completes with an error when making a REST call, | 2239 /// call, this method will complete with the same error. |
2259 * this method will complete with the same error. | |
2260 */ | |
2261 async.Future delete(core.String userId, core.String forwardingEmail) { | 2240 async.Future delete(core.String userId, core.String forwardingEmail) { |
2262 var _url = null; | 2241 var _url = null; |
2263 var _queryParams = new core.Map(); | 2242 var _queryParams = new core.Map(); |
2264 var _uploadMedia = null; | 2243 var _uploadMedia = null; |
2265 var _uploadOptions = null; | 2244 var _uploadOptions = null; |
2266 var _downloadOptions = commons.DownloadOptions.Metadata; | 2245 var _downloadOptions = commons.DownloadOptions.Metadata; |
2267 var _body = null; | 2246 var _body = null; |
2268 | 2247 |
2269 if (userId == null) { | 2248 if (userId == null) { |
2270 throw new core.ArgumentError("Parameter userId is required."); | 2249 throw new core.ArgumentError("Parameter userId is required."); |
2271 } | 2250 } |
2272 if (forwardingEmail == null) { | 2251 if (forwardingEmail == null) { |
2273 throw new core.ArgumentError("Parameter forwardingEmail is required."); | 2252 throw new core.ArgumentError("Parameter forwardingEmail is required."); |
2274 } | 2253 } |
2275 | 2254 |
2276 _downloadOptions = null; | 2255 _downloadOptions = null; |
2277 | 2256 |
2278 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddre
sses/' + commons.Escaper.ecapeVariable('$forwardingEmail'); | 2257 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2258 '/settings/forwardingAddresses/' + |
| 2259 commons.Escaper.ecapeVariable('$forwardingEmail'); |
2279 | 2260 |
2280 var _response = _requester.request(_url, | 2261 var _response = _requester.request(_url, "DELETE", |
2281 "DELETE", | 2262 body: _body, |
2282 body: _body, | 2263 queryParams: _queryParams, |
2283 queryParams: _queryParams, | 2264 uploadOptions: _uploadOptions, |
2284 uploadOptions: _uploadOptions, | 2265 uploadMedia: _uploadMedia, |
2285 uploadMedia: _uploadMedia, | 2266 downloadOptions: _downloadOptions); |
2286 downloadOptions: _downloadOptions); | |
2287 return _response.then((data) => null); | 2267 return _response.then((data) => null); |
2288 } | 2268 } |
2289 | 2269 |
2290 /** | 2270 /// Gets the specified forwarding address. |
2291 * Gets the specified forwarding address. | 2271 /// |
2292 * | 2272 /// Request parameters: |
2293 * Request parameters: | 2273 /// |
2294 * | 2274 /// [userId] - User's email address. The special value "me" can be used to |
2295 * [userId] - User's email address. The special value "me" can be used to | 2275 /// indicate the authenticated user. |
2296 * indicate the authenticated user. | 2276 /// |
2297 * | 2277 /// [forwardingEmail] - The forwarding address to be retrieved. |
2298 * [forwardingEmail] - The forwarding address to be retrieved. | 2278 /// |
2299 * | 2279 /// Completes with a [ForwardingAddress]. |
2300 * Completes with a [ForwardingAddress]. | 2280 /// |
2301 * | 2281 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2302 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2282 /// an error. |
2303 * error. | 2283 /// |
2304 * | 2284 /// If the used [http.Client] completes with an error when making a REST |
2305 * If the used [http.Client] completes with an error when making a REST call, | 2285 /// call, this method will complete with the same error. |
2306 * this method will complete with the same error. | 2286 async.Future<ForwardingAddress> get( |
2307 */ | 2287 core.String userId, core.String forwardingEmail) { |
2308 async.Future<ForwardingAddress> get(core.String userId, core.String forwarding
Email) { | |
2309 var _url = null; | 2288 var _url = null; |
2310 var _queryParams = new core.Map(); | 2289 var _queryParams = new core.Map(); |
2311 var _uploadMedia = null; | 2290 var _uploadMedia = null; |
2312 var _uploadOptions = null; | 2291 var _uploadOptions = null; |
2313 var _downloadOptions = commons.DownloadOptions.Metadata; | 2292 var _downloadOptions = commons.DownloadOptions.Metadata; |
2314 var _body = null; | 2293 var _body = null; |
2315 | 2294 |
2316 if (userId == null) { | 2295 if (userId == null) { |
2317 throw new core.ArgumentError("Parameter userId is required."); | 2296 throw new core.ArgumentError("Parameter userId is required."); |
2318 } | 2297 } |
2319 if (forwardingEmail == null) { | 2298 if (forwardingEmail == null) { |
2320 throw new core.ArgumentError("Parameter forwardingEmail is required."); | 2299 throw new core.ArgumentError("Parameter forwardingEmail is required."); |
2321 } | 2300 } |
2322 | 2301 |
2323 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddre
sses/' + commons.Escaper.ecapeVariable('$forwardingEmail'); | 2302 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2303 '/settings/forwardingAddresses/' + |
| 2304 commons.Escaper.ecapeVariable('$forwardingEmail'); |
2324 | 2305 |
2325 var _response = _requester.request(_url, | 2306 var _response = _requester.request(_url, "GET", |
2326 "GET", | 2307 body: _body, |
2327 body: _body, | 2308 queryParams: _queryParams, |
2328 queryParams: _queryParams, | 2309 uploadOptions: _uploadOptions, |
2329 uploadOptions: _uploadOptions, | 2310 uploadMedia: _uploadMedia, |
2330 uploadMedia: _uploadMedia, | 2311 downloadOptions: _downloadOptions); |
2331 downloadOptions: _downloadOptions); | |
2332 return _response.then((data) => new ForwardingAddress.fromJson(data)); | 2312 return _response.then((data) => new ForwardingAddress.fromJson(data)); |
2333 } | 2313 } |
2334 | 2314 |
2335 /** | 2315 /// Lists the forwarding addresses for the specified account. |
2336 * Lists the forwarding addresses for the specified account. | 2316 /// |
2337 * | 2317 /// Request parameters: |
2338 * Request parameters: | 2318 /// |
2339 * | 2319 /// [userId] - User's email address. The special value "me" can be used to |
2340 * [userId] - User's email address. The special value "me" can be used to | 2320 /// indicate the authenticated user. |
2341 * indicate the authenticated user. | 2321 /// |
2342 * | 2322 /// Completes with a [ListForwardingAddressesResponse]. |
2343 * Completes with a [ListForwardingAddressesResponse]. | 2323 /// |
2344 * | 2324 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2345 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2325 /// an error. |
2346 * error. | 2326 /// |
2347 * | 2327 /// If the used [http.Client] completes with an error when making a REST |
2348 * If the used [http.Client] completes with an error when making a REST call, | 2328 /// call, this method will complete with the same error. |
2349 * this method will complete with the same error. | |
2350 */ | |
2351 async.Future<ListForwardingAddressesResponse> list(core.String userId) { | 2329 async.Future<ListForwardingAddressesResponse> list(core.String userId) { |
2352 var _url = null; | 2330 var _url = null; |
2353 var _queryParams = new core.Map(); | 2331 var _queryParams = new core.Map(); |
2354 var _uploadMedia = null; | 2332 var _uploadMedia = null; |
2355 var _uploadOptions = null; | 2333 var _uploadOptions = null; |
2356 var _downloadOptions = commons.DownloadOptions.Metadata; | 2334 var _downloadOptions = commons.DownloadOptions.Metadata; |
2357 var _body = null; | 2335 var _body = null; |
2358 | 2336 |
2359 if (userId == null) { | 2337 if (userId == null) { |
2360 throw new core.ArgumentError("Parameter userId is required."); | 2338 throw new core.ArgumentError("Parameter userId is required."); |
2361 } | 2339 } |
2362 | 2340 |
2363 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/forwardingAddre
sses'; | 2341 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2342 '/settings/forwardingAddresses'; |
2364 | 2343 |
2365 var _response = _requester.request(_url, | 2344 var _response = _requester.request(_url, "GET", |
2366 "GET", | 2345 body: _body, |
2367 body: _body, | 2346 queryParams: _queryParams, |
2368 queryParams: _queryParams, | 2347 uploadOptions: _uploadOptions, |
2369 uploadOptions: _uploadOptions, | 2348 uploadMedia: _uploadMedia, |
2370 uploadMedia: _uploadMedia, | 2349 downloadOptions: _downloadOptions); |
2371 downloadOptions: _downloadOptions); | 2350 return _response |
2372 return _response.then((data) => new ListForwardingAddressesResponse.fromJson
(data)); | 2351 .then((data) => new ListForwardingAddressesResponse.fromJson(data)); |
2373 } | 2352 } |
2374 | |
2375 } | 2353 } |
2376 | 2354 |
2377 | |
2378 class UsersSettingsSendAsResourceApi { | 2355 class UsersSettingsSendAsResourceApi { |
2379 final commons.ApiRequester _requester; | 2356 final commons.ApiRequester _requester; |
2380 | 2357 |
2381 UsersSettingsSendAsSmimeInfoResourceApi get smimeInfo => new UsersSettingsSend
AsSmimeInfoResourceApi(_requester); | 2358 UsersSettingsSendAsSmimeInfoResourceApi get smimeInfo => |
| 2359 new UsersSettingsSendAsSmimeInfoResourceApi(_requester); |
2382 | 2360 |
2383 UsersSettingsSendAsResourceApi(commons.ApiRequester client) : | 2361 UsersSettingsSendAsResourceApi(commons.ApiRequester client) |
2384 _requester = client; | 2362 : _requester = client; |
2385 | 2363 |
2386 /** | 2364 /// Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail |
2387 * Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail | 2365 /// will attempt to connect to the SMTP service to validate the configuration |
2388 * will attempt to connect to the SMTP service to validate the configuration | 2366 /// before creating the alias. If ownership verification is required for the |
2389 * before creating the alias. If ownership verification is required for the | 2367 /// alias, a message will be sent to the email address and the resource's |
2390 * alias, a message will be sent to the email address and the resource's | 2368 /// verification status will be set to pending; otherwise, the resource will |
2391 * verification status will be set to pending; otherwise, the resource will be | 2369 /// be created with verification status set to accepted. If a signature is |
2392 * created with verification status set to accepted. If a signature is | 2370 /// provided, Gmail will sanitize the HTML before saving it with the alias. |
2393 * provided, Gmail will sanitize the HTML before saving it with the alias. | 2371 /// |
2394 * | 2372 /// This method is only available to service account clients that have been |
2395 * This method is only available to service account clients that have been | 2373 /// delegated domain-wide authority. |
2396 * delegated domain-wide authority. | 2374 /// |
2397 * | 2375 /// [request] - The metadata request object. |
2398 * [request] - The metadata request object. | 2376 /// |
2399 * | 2377 /// Request parameters: |
2400 * Request parameters: | 2378 /// |
2401 * | 2379 /// [userId] - User's email address. The special value "me" can be used to |
2402 * [userId] - User's email address. The special value "me" can be used to | 2380 /// indicate the authenticated user. |
2403 * indicate the authenticated user. | 2381 /// |
2404 * | 2382 /// Completes with a [SendAs]. |
2405 * Completes with a [SendAs]. | 2383 /// |
2406 * | 2384 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2407 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2385 /// an error. |
2408 * error. | 2386 /// |
2409 * | 2387 /// If the used [http.Client] completes with an error when making a REST |
2410 * If the used [http.Client] completes with an error when making a REST call, | 2388 /// call, this method will complete with the same error. |
2411 * this method will complete with the same error. | |
2412 */ | |
2413 async.Future<SendAs> create(SendAs request, core.String userId) { | 2389 async.Future<SendAs> create(SendAs request, core.String userId) { |
2414 var _url = null; | 2390 var _url = null; |
2415 var _queryParams = new core.Map(); | 2391 var _queryParams = new core.Map(); |
2416 var _uploadMedia = null; | 2392 var _uploadMedia = null; |
2417 var _uploadOptions = null; | 2393 var _uploadOptions = null; |
2418 var _downloadOptions = commons.DownloadOptions.Metadata; | 2394 var _downloadOptions = commons.DownloadOptions.Metadata; |
2419 var _body = null; | 2395 var _body = null; |
2420 | 2396 |
2421 if (request != null) { | 2397 if (request != null) { |
2422 _body = convert.JSON.encode((request).toJson()); | 2398 _body = convert.JSON.encode((request).toJson()); |
2423 } | 2399 } |
2424 if (userId == null) { | 2400 if (userId == null) { |
2425 throw new core.ArgumentError("Parameter userId is required."); | 2401 throw new core.ArgumentError("Parameter userId is required."); |
2426 } | 2402 } |
2427 | 2403 |
2428 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs'; | 2404 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs'; |
2429 | 2405 |
2430 var _response = _requester.request(_url, | 2406 var _response = _requester.request(_url, "POST", |
2431 "POST", | 2407 body: _body, |
2432 body: _body, | 2408 queryParams: _queryParams, |
2433 queryParams: _queryParams, | 2409 uploadOptions: _uploadOptions, |
2434 uploadOptions: _uploadOptions, | 2410 uploadMedia: _uploadMedia, |
2435 uploadMedia: _uploadMedia, | 2411 downloadOptions: _downloadOptions); |
2436 downloadOptions: _downloadOptions); | |
2437 return _response.then((data) => new SendAs.fromJson(data)); | 2412 return _response.then((data) => new SendAs.fromJson(data)); |
2438 } | 2413 } |
2439 | 2414 |
2440 /** | 2415 /// Deletes the specified send-as alias. Revokes any verification that may |
2441 * Deletes the specified send-as alias. Revokes any verification that may have | 2416 /// have been required for using it. |
2442 * been required for using it. | 2417 /// |
2443 * | 2418 /// This method is only available to service account clients that have been |
2444 * This method is only available to service account clients that have been | 2419 /// delegated domain-wide authority. |
2445 * delegated domain-wide authority. | 2420 /// |
2446 * | 2421 /// Request parameters: |
2447 * Request parameters: | 2422 /// |
2448 * | 2423 /// [userId] - User's email address. The special value "me" can be used to |
2449 * [userId] - User's email address. The special value "me" can be used to | 2424 /// indicate the authenticated user. |
2450 * indicate the authenticated user. | 2425 /// |
2451 * | 2426 /// [sendAsEmail] - The send-as alias to be deleted. |
2452 * [sendAsEmail] - The send-as alias to be deleted. | 2427 /// |
2453 * | 2428 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2454 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2429 /// an error. |
2455 * error. | 2430 /// |
2456 * | 2431 /// If the used [http.Client] completes with an error when making a REST |
2457 * If the used [http.Client] completes with an error when making a REST call, | 2432 /// call, this method will complete with the same error. |
2458 * this method will complete with the same error. | |
2459 */ | |
2460 async.Future delete(core.String userId, core.String sendAsEmail) { | 2433 async.Future delete(core.String userId, core.String sendAsEmail) { |
2461 var _url = null; | 2434 var _url = null; |
2462 var _queryParams = new core.Map(); | 2435 var _queryParams = new core.Map(); |
2463 var _uploadMedia = null; | 2436 var _uploadMedia = null; |
2464 var _uploadOptions = null; | 2437 var _uploadOptions = null; |
2465 var _downloadOptions = commons.DownloadOptions.Metadata; | 2438 var _downloadOptions = commons.DownloadOptions.Metadata; |
2466 var _body = null; | 2439 var _body = null; |
2467 | 2440 |
2468 if (userId == null) { | 2441 if (userId == null) { |
2469 throw new core.ArgumentError("Parameter userId is required."); | 2442 throw new core.ArgumentError("Parameter userId is required."); |
2470 } | 2443 } |
2471 if (sendAsEmail == null) { | 2444 if (sendAsEmail == null) { |
2472 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2445 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2473 } | 2446 } |
2474 | 2447 |
2475 _downloadOptions = null; | 2448 _downloadOptions = null; |
2476 | 2449 |
2477 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail'); | 2450 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2451 '/settings/sendAs/' + |
| 2452 commons.Escaper.ecapeVariable('$sendAsEmail'); |
2478 | 2453 |
2479 var _response = _requester.request(_url, | 2454 var _response = _requester.request(_url, "DELETE", |
2480 "DELETE", | 2455 body: _body, |
2481 body: _body, | 2456 queryParams: _queryParams, |
2482 queryParams: _queryParams, | 2457 uploadOptions: _uploadOptions, |
2483 uploadOptions: _uploadOptions, | 2458 uploadMedia: _uploadMedia, |
2484 uploadMedia: _uploadMedia, | 2459 downloadOptions: _downloadOptions); |
2485 downloadOptions: _downloadOptions); | |
2486 return _response.then((data) => null); | 2460 return _response.then((data) => null); |
2487 } | 2461 } |
2488 | 2462 |
2489 /** | 2463 /// Gets the specified send-as alias. Fails with an HTTP 404 error if the |
2490 * Gets the specified send-as alias. Fails with an HTTP 404 error if the | 2464 /// specified address is not a member of the collection. |
2491 * specified address is not a member of the collection. | 2465 /// |
2492 * | 2466 /// Request parameters: |
2493 * Request parameters: | 2467 /// |
2494 * | 2468 /// [userId] - User's email address. The special value "me" can be used to |
2495 * [userId] - User's email address. The special value "me" can be used to | 2469 /// indicate the authenticated user. |
2496 * indicate the authenticated user. | 2470 /// |
2497 * | 2471 /// [sendAsEmail] - The send-as alias to be retrieved. |
2498 * [sendAsEmail] - The send-as alias to be retrieved. | 2472 /// |
2499 * | 2473 /// Completes with a [SendAs]. |
2500 * Completes with a [SendAs]. | 2474 /// |
2501 * | 2475 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2502 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2476 /// an error. |
2503 * error. | 2477 /// |
2504 * | 2478 /// If the used [http.Client] completes with an error when making a REST |
2505 * If the used [http.Client] completes with an error when making a REST call, | 2479 /// call, this method will complete with the same error. |
2506 * this method will complete with the same error. | |
2507 */ | |
2508 async.Future<SendAs> get(core.String userId, core.String sendAsEmail) { | 2480 async.Future<SendAs> get(core.String userId, core.String sendAsEmail) { |
2509 var _url = null; | 2481 var _url = null; |
2510 var _queryParams = new core.Map(); | 2482 var _queryParams = new core.Map(); |
2511 var _uploadMedia = null; | 2483 var _uploadMedia = null; |
2512 var _uploadOptions = null; | 2484 var _uploadOptions = null; |
2513 var _downloadOptions = commons.DownloadOptions.Metadata; | 2485 var _downloadOptions = commons.DownloadOptions.Metadata; |
2514 var _body = null; | 2486 var _body = null; |
2515 | 2487 |
2516 if (userId == null) { | 2488 if (userId == null) { |
2517 throw new core.ArgumentError("Parameter userId is required."); | 2489 throw new core.ArgumentError("Parameter userId is required."); |
2518 } | 2490 } |
2519 if (sendAsEmail == null) { | 2491 if (sendAsEmail == null) { |
2520 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2492 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2521 } | 2493 } |
2522 | 2494 |
2523 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail'); | 2495 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2496 '/settings/sendAs/' + |
| 2497 commons.Escaper.ecapeVariable('$sendAsEmail'); |
2524 | 2498 |
2525 var _response = _requester.request(_url, | 2499 var _response = _requester.request(_url, "GET", |
2526 "GET", | 2500 body: _body, |
2527 body: _body, | 2501 queryParams: _queryParams, |
2528 queryParams: _queryParams, | 2502 uploadOptions: _uploadOptions, |
2529 uploadOptions: _uploadOptions, | 2503 uploadMedia: _uploadMedia, |
2530 uploadMedia: _uploadMedia, | 2504 downloadOptions: _downloadOptions); |
2531 downloadOptions: _downloadOptions); | |
2532 return _response.then((data) => new SendAs.fromJson(data)); | 2505 return _response.then((data) => new SendAs.fromJson(data)); |
2533 } | 2506 } |
2534 | 2507 |
2535 /** | 2508 /// Lists the send-as aliases for the specified account. The result includes |
2536 * Lists the send-as aliases for the specified account. The result includes | 2509 /// the primary send-as address associated with the account as well as any |
2537 * the primary send-as address associated with the account as well as any | 2510 /// custom "from" aliases. |
2538 * custom "from" aliases. | 2511 /// |
2539 * | 2512 /// Request parameters: |
2540 * Request parameters: | 2513 /// |
2541 * | 2514 /// [userId] - User's email address. The special value "me" can be used to |
2542 * [userId] - User's email address. The special value "me" can be used to | 2515 /// indicate the authenticated user. |
2543 * indicate the authenticated user. | 2516 /// |
2544 * | 2517 /// Completes with a [ListSendAsResponse]. |
2545 * Completes with a [ListSendAsResponse]. | 2518 /// |
2546 * | 2519 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2547 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2520 /// an error. |
2548 * error. | 2521 /// |
2549 * | 2522 /// If the used [http.Client] completes with an error when making a REST |
2550 * If the used [http.Client] completes with an error when making a REST call, | 2523 /// call, this method will complete with the same error. |
2551 * this method will complete with the same error. | |
2552 */ | |
2553 async.Future<ListSendAsResponse> list(core.String userId) { | 2524 async.Future<ListSendAsResponse> list(core.String userId) { |
2554 var _url = null; | 2525 var _url = null; |
2555 var _queryParams = new core.Map(); | 2526 var _queryParams = new core.Map(); |
2556 var _uploadMedia = null; | 2527 var _uploadMedia = null; |
2557 var _uploadOptions = null; | 2528 var _uploadOptions = null; |
2558 var _downloadOptions = commons.DownloadOptions.Metadata; | 2529 var _downloadOptions = commons.DownloadOptions.Metadata; |
2559 var _body = null; | 2530 var _body = null; |
2560 | 2531 |
2561 if (userId == null) { | 2532 if (userId == null) { |
2562 throw new core.ArgumentError("Parameter userId is required."); | 2533 throw new core.ArgumentError("Parameter userId is required."); |
2563 } | 2534 } |
2564 | 2535 |
2565 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs'; | 2536 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs'; |
2566 | 2537 |
2567 var _response = _requester.request(_url, | 2538 var _response = _requester.request(_url, "GET", |
2568 "GET", | 2539 body: _body, |
2569 body: _body, | 2540 queryParams: _queryParams, |
2570 queryParams: _queryParams, | 2541 uploadOptions: _uploadOptions, |
2571 uploadOptions: _uploadOptions, | 2542 uploadMedia: _uploadMedia, |
2572 uploadMedia: _uploadMedia, | 2543 downloadOptions: _downloadOptions); |
2573 downloadOptions: _downloadOptions); | |
2574 return _response.then((data) => new ListSendAsResponse.fromJson(data)); | 2544 return _response.then((data) => new ListSendAsResponse.fromJson(data)); |
2575 } | 2545 } |
2576 | 2546 |
2577 /** | 2547 /// Updates a send-as alias. If a signature is provided, Gmail will sanitize |
2578 * Updates a send-as alias. If a signature is provided, Gmail will sanitize | 2548 /// the HTML before saving it with the alias. |
2579 * the HTML before saving it with the alias. | 2549 /// |
2580 * | 2550 /// Addresses other than the primary address for the account can only be |
2581 * Addresses other than the primary address for the account can only be | 2551 /// updated by service account clients that have been delegated domain-wide |
2582 * updated by service account clients that have been delegated domain-wide | 2552 /// authority. This method supports patch semantics. |
2583 * authority. This method supports patch semantics. | 2553 /// |
2584 * | 2554 /// [request] - The metadata request object. |
2585 * [request] - The metadata request object. | 2555 /// |
2586 * | 2556 /// Request parameters: |
2587 * Request parameters: | 2557 /// |
2588 * | 2558 /// [userId] - User's email address. The special value "me" can be used to |
2589 * [userId] - User's email address. The special value "me" can be used to | 2559 /// indicate the authenticated user. |
2590 * indicate the authenticated user. | 2560 /// |
2591 * | 2561 /// [sendAsEmail] - The send-as alias to be updated. |
2592 * [sendAsEmail] - The send-as alias to be updated. | 2562 /// |
2593 * | 2563 /// Completes with a [SendAs]. |
2594 * Completes with a [SendAs]. | 2564 /// |
2595 * | 2565 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2596 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2566 /// an error. |
2597 * error. | 2567 /// |
2598 * | 2568 /// If the used [http.Client] completes with an error when making a REST |
2599 * If the used [http.Client] completes with an error when making a REST call, | 2569 /// call, this method will complete with the same error. |
2600 * this method will complete with the same error. | 2570 async.Future<SendAs> patch( |
2601 */ | 2571 SendAs request, core.String userId, core.String sendAsEmail) { |
2602 async.Future<SendAs> patch(SendAs request, core.String userId, core.String sen
dAsEmail) { | |
2603 var _url = null; | 2572 var _url = null; |
2604 var _queryParams = new core.Map(); | 2573 var _queryParams = new core.Map(); |
2605 var _uploadMedia = null; | 2574 var _uploadMedia = null; |
2606 var _uploadOptions = null; | 2575 var _uploadOptions = null; |
2607 var _downloadOptions = commons.DownloadOptions.Metadata; | 2576 var _downloadOptions = commons.DownloadOptions.Metadata; |
2608 var _body = null; | 2577 var _body = null; |
2609 | 2578 |
2610 if (request != null) { | 2579 if (request != null) { |
2611 _body = convert.JSON.encode((request).toJson()); | 2580 _body = convert.JSON.encode((request).toJson()); |
2612 } | 2581 } |
2613 if (userId == null) { | 2582 if (userId == null) { |
2614 throw new core.ArgumentError("Parameter userId is required."); | 2583 throw new core.ArgumentError("Parameter userId is required."); |
2615 } | 2584 } |
2616 if (sendAsEmail == null) { | 2585 if (sendAsEmail == null) { |
2617 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2586 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2618 } | 2587 } |
2619 | 2588 |
2620 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail'); | 2589 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2590 '/settings/sendAs/' + |
| 2591 commons.Escaper.ecapeVariable('$sendAsEmail'); |
2621 | 2592 |
2622 var _response = _requester.request(_url, | 2593 var _response = _requester.request(_url, "PATCH", |
2623 "PATCH", | 2594 body: _body, |
2624 body: _body, | 2595 queryParams: _queryParams, |
2625 queryParams: _queryParams, | 2596 uploadOptions: _uploadOptions, |
2626 uploadOptions: _uploadOptions, | 2597 uploadMedia: _uploadMedia, |
2627 uploadMedia: _uploadMedia, | 2598 downloadOptions: _downloadOptions); |
2628 downloadOptions: _downloadOptions); | |
2629 return _response.then((data) => new SendAs.fromJson(data)); | 2599 return _response.then((data) => new SendAs.fromJson(data)); |
2630 } | 2600 } |
2631 | 2601 |
2632 /** | 2602 /// Updates a send-as alias. If a signature is provided, Gmail will sanitize |
2633 * Updates a send-as alias. If a signature is provided, Gmail will sanitize | 2603 /// the HTML before saving it with the alias. |
2634 * the HTML before saving it with the alias. | 2604 /// |
2635 * | 2605 /// Addresses other than the primary address for the account can only be |
2636 * Addresses other than the primary address for the account can only be | 2606 /// updated by service account clients that have been delegated domain-wide |
2637 * updated by service account clients that have been delegated domain-wide | 2607 /// authority. |
2638 * authority. | 2608 /// |
2639 * | 2609 /// [request] - The metadata request object. |
2640 * [request] - The metadata request object. | 2610 /// |
2641 * | 2611 /// Request parameters: |
2642 * Request parameters: | 2612 /// |
2643 * | 2613 /// [userId] - User's email address. The special value "me" can be used to |
2644 * [userId] - User's email address. The special value "me" can be used to | 2614 /// indicate the authenticated user. |
2645 * indicate the authenticated user. | 2615 /// |
2646 * | 2616 /// [sendAsEmail] - The send-as alias to be updated. |
2647 * [sendAsEmail] - The send-as alias to be updated. | 2617 /// |
2648 * | 2618 /// Completes with a [SendAs]. |
2649 * Completes with a [SendAs]. | 2619 /// |
2650 * | 2620 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2651 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2621 /// an error. |
2652 * error. | 2622 /// |
2653 * | 2623 /// If the used [http.Client] completes with an error when making a REST |
2654 * If the used [http.Client] completes with an error when making a REST call, | 2624 /// call, this method will complete with the same error. |
2655 * this method will complete with the same error. | 2625 async.Future<SendAs> update( |
2656 */ | 2626 SendAs request, core.String userId, core.String sendAsEmail) { |
2657 async.Future<SendAs> update(SendAs request, core.String userId, core.String se
ndAsEmail) { | |
2658 var _url = null; | 2627 var _url = null; |
2659 var _queryParams = new core.Map(); | 2628 var _queryParams = new core.Map(); |
2660 var _uploadMedia = null; | 2629 var _uploadMedia = null; |
2661 var _uploadOptions = null; | 2630 var _uploadOptions = null; |
2662 var _downloadOptions = commons.DownloadOptions.Metadata; | 2631 var _downloadOptions = commons.DownloadOptions.Metadata; |
2663 var _body = null; | 2632 var _body = null; |
2664 | 2633 |
2665 if (request != null) { | 2634 if (request != null) { |
2666 _body = convert.JSON.encode((request).toJson()); | 2635 _body = convert.JSON.encode((request).toJson()); |
2667 } | 2636 } |
2668 if (userId == null) { | 2637 if (userId == null) { |
2669 throw new core.ArgumentError("Parameter userId is required."); | 2638 throw new core.ArgumentError("Parameter userId is required."); |
2670 } | 2639 } |
2671 if (sendAsEmail == null) { | 2640 if (sendAsEmail == null) { |
2672 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2641 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2673 } | 2642 } |
2674 | 2643 |
2675 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail'); | 2644 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2645 '/settings/sendAs/' + |
| 2646 commons.Escaper.ecapeVariable('$sendAsEmail'); |
2676 | 2647 |
2677 var _response = _requester.request(_url, | 2648 var _response = _requester.request(_url, "PUT", |
2678 "PUT", | 2649 body: _body, |
2679 body: _body, | 2650 queryParams: _queryParams, |
2680 queryParams: _queryParams, | 2651 uploadOptions: _uploadOptions, |
2681 uploadOptions: _uploadOptions, | 2652 uploadMedia: _uploadMedia, |
2682 uploadMedia: _uploadMedia, | 2653 downloadOptions: _downloadOptions); |
2683 downloadOptions: _downloadOptions); | |
2684 return _response.then((data) => new SendAs.fromJson(data)); | 2654 return _response.then((data) => new SendAs.fromJson(data)); |
2685 } | 2655 } |
2686 | 2656 |
2687 /** | 2657 /// Sends a verification email to the specified send-as alias address. The |
2688 * Sends a verification email to the specified send-as alias address. The | 2658 /// verification status must be pending. |
2689 * verification status must be pending. | 2659 /// |
2690 * | 2660 /// This method is only available to service account clients that have been |
2691 * This method is only available to service account clients that have been | 2661 /// delegated domain-wide authority. |
2692 * delegated domain-wide authority. | 2662 /// |
2693 * | 2663 /// Request parameters: |
2694 * Request parameters: | 2664 /// |
2695 * | 2665 /// [userId] - User's email address. The special value "me" can be used to |
2696 * [userId] - User's email address. The special value "me" can be used to | 2666 /// indicate the authenticated user. |
2697 * indicate the authenticated user. | 2667 /// |
2698 * | 2668 /// [sendAsEmail] - The send-as alias to be verified. |
2699 * [sendAsEmail] - The send-as alias to be verified. | 2669 /// |
2700 * | 2670 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2701 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2671 /// an error. |
2702 * error. | 2672 /// |
2703 * | 2673 /// If the used [http.Client] completes with an error when making a REST |
2704 * If the used [http.Client] completes with an error when making a REST call, | 2674 /// call, this method will complete with the same error. |
2705 * this method will complete with the same error. | |
2706 */ | |
2707 async.Future verify(core.String userId, core.String sendAsEmail) { | 2675 async.Future verify(core.String userId, core.String sendAsEmail) { |
2708 var _url = null; | 2676 var _url = null; |
2709 var _queryParams = new core.Map(); | 2677 var _queryParams = new core.Map(); |
2710 var _uploadMedia = null; | 2678 var _uploadMedia = null; |
2711 var _uploadOptions = null; | 2679 var _uploadOptions = null; |
2712 var _downloadOptions = commons.DownloadOptions.Metadata; | 2680 var _downloadOptions = commons.DownloadOptions.Metadata; |
2713 var _body = null; | 2681 var _body = null; |
2714 | 2682 |
2715 if (userId == null) { | 2683 if (userId == null) { |
2716 throw new core.ArgumentError("Parameter userId is required."); | 2684 throw new core.ArgumentError("Parameter userId is required."); |
2717 } | 2685 } |
2718 if (sendAsEmail == null) { | 2686 if (sendAsEmail == null) { |
2719 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2687 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2720 } | 2688 } |
2721 | 2689 |
2722 _downloadOptions = null; | 2690 _downloadOptions = null; |
2723 | 2691 |
2724 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail') + '/verify'; | 2692 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2693 '/settings/sendAs/' + |
| 2694 commons.Escaper.ecapeVariable('$sendAsEmail') + |
| 2695 '/verify'; |
2725 | 2696 |
2726 var _response = _requester.request(_url, | 2697 var _response = _requester.request(_url, "POST", |
2727 "POST", | 2698 body: _body, |
2728 body: _body, | 2699 queryParams: _queryParams, |
2729 queryParams: _queryParams, | 2700 uploadOptions: _uploadOptions, |
2730 uploadOptions: _uploadOptions, | 2701 uploadMedia: _uploadMedia, |
2731 uploadMedia: _uploadMedia, | 2702 downloadOptions: _downloadOptions); |
2732 downloadOptions: _downloadOptions); | |
2733 return _response.then((data) => null); | 2703 return _response.then((data) => null); |
2734 } | 2704 } |
2735 | |
2736 } | 2705 } |
2737 | 2706 |
2738 | |
2739 class UsersSettingsSendAsSmimeInfoResourceApi { | 2707 class UsersSettingsSendAsSmimeInfoResourceApi { |
2740 final commons.ApiRequester _requester; | 2708 final commons.ApiRequester _requester; |
2741 | 2709 |
2742 UsersSettingsSendAsSmimeInfoResourceApi(commons.ApiRequester client) : | 2710 UsersSettingsSendAsSmimeInfoResourceApi(commons.ApiRequester client) |
2743 _requester = client; | 2711 : _requester = client; |
2744 | 2712 |
2745 /** | 2713 /// Deletes the specified S/MIME config for the specified send-as alias. |
2746 * Deletes the specified S/MIME config for the specified send-as alias. | 2714 /// |
2747 * | 2715 /// Request parameters: |
2748 * Request parameters: | 2716 /// |
2749 * | 2717 /// [userId] - The user's email address. The special value me can be used to |
2750 * [userId] - The user's email address. The special value me can be used to | 2718 /// indicate the authenticated user. |
2751 * indicate the authenticated user. | 2719 /// |
2752 * | 2720 /// [sendAsEmail] - The email address that appears in the "From:" header for |
2753 * [sendAsEmail] - The email address that appears in the "From:" header for | 2721 /// mail sent using this alias. |
2754 * mail sent using this alias. | 2722 /// |
2755 * | 2723 /// [id] - The immutable ID for the SmimeInfo. |
2756 * [id] - The immutable ID for the SmimeInfo. | 2724 /// |
2757 * | 2725 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2758 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2726 /// an error. |
2759 * error. | 2727 /// |
2760 * | 2728 /// If the used [http.Client] completes with an error when making a REST |
2761 * If the used [http.Client] completes with an error when making a REST call, | 2729 /// call, this method will complete with the same error. |
2762 * this method will complete with the same error. | 2730 async.Future delete( |
2763 */ | 2731 core.String userId, core.String sendAsEmail, core.String id) { |
2764 async.Future delete(core.String userId, core.String sendAsEmail, core.String i
d) { | |
2765 var _url = null; | 2732 var _url = null; |
2766 var _queryParams = new core.Map(); | 2733 var _queryParams = new core.Map(); |
2767 var _uploadMedia = null; | 2734 var _uploadMedia = null; |
2768 var _uploadOptions = null; | 2735 var _uploadOptions = null; |
2769 var _downloadOptions = commons.DownloadOptions.Metadata; | 2736 var _downloadOptions = commons.DownloadOptions.Metadata; |
2770 var _body = null; | 2737 var _body = null; |
2771 | 2738 |
2772 if (userId == null) { | 2739 if (userId == null) { |
2773 throw new core.ArgumentError("Parameter userId is required."); | 2740 throw new core.ArgumentError("Parameter userId is required."); |
2774 } | 2741 } |
2775 if (sendAsEmail == null) { | 2742 if (sendAsEmail == null) { |
2776 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2743 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2777 } | 2744 } |
2778 if (id == null) { | 2745 if (id == null) { |
2779 throw new core.ArgumentError("Parameter id is required."); | 2746 throw new core.ArgumentError("Parameter id is required."); |
2780 } | 2747 } |
2781 | 2748 |
2782 _downloadOptions = null; | 2749 _downloadOptions = null; |
2783 | 2750 |
2784 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail') + '/smimeInfo/' + commons.Escaper.ecap
eVariable('$id'); | 2751 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2752 '/settings/sendAs/' + |
| 2753 commons.Escaper.ecapeVariable('$sendAsEmail') + |
| 2754 '/smimeInfo/' + |
| 2755 commons.Escaper.ecapeVariable('$id'); |
2785 | 2756 |
2786 var _response = _requester.request(_url, | 2757 var _response = _requester.request(_url, "DELETE", |
2787 "DELETE", | 2758 body: _body, |
2788 body: _body, | 2759 queryParams: _queryParams, |
2789 queryParams: _queryParams, | 2760 uploadOptions: _uploadOptions, |
2790 uploadOptions: _uploadOptions, | 2761 uploadMedia: _uploadMedia, |
2791 uploadMedia: _uploadMedia, | 2762 downloadOptions: _downloadOptions); |
2792 downloadOptions: _downloadOptions); | |
2793 return _response.then((data) => null); | 2763 return _response.then((data) => null); |
2794 } | 2764 } |
2795 | 2765 |
2796 /** | 2766 /// Gets the specified S/MIME config for the specified send-as alias. |
2797 * Gets the specified S/MIME config for the specified send-as alias. | 2767 /// |
2798 * | 2768 /// Request parameters: |
2799 * Request parameters: | 2769 /// |
2800 * | 2770 /// [userId] - The user's email address. The special value me can be used to |
2801 * [userId] - The user's email address. The special value me can be used to | 2771 /// indicate the authenticated user. |
2802 * indicate the authenticated user. | 2772 /// |
2803 * | 2773 /// [sendAsEmail] - The email address that appears in the "From:" header for |
2804 * [sendAsEmail] - The email address that appears in the "From:" header for | 2774 /// mail sent using this alias. |
2805 * mail sent using this alias. | 2775 /// |
2806 * | 2776 /// [id] - The immutable ID for the SmimeInfo. |
2807 * [id] - The immutable ID for the SmimeInfo. | 2777 /// |
2808 * | 2778 /// Completes with a [SmimeInfo]. |
2809 * Completes with a [SmimeInfo]. | 2779 /// |
2810 * | 2780 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2811 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2781 /// an error. |
2812 * error. | 2782 /// |
2813 * | 2783 /// If the used [http.Client] completes with an error when making a REST |
2814 * If the used [http.Client] completes with an error when making a REST call, | 2784 /// call, this method will complete with the same error. |
2815 * this method will complete with the same error. | 2785 async.Future<SmimeInfo> get( |
2816 */ | 2786 core.String userId, core.String sendAsEmail, core.String id) { |
2817 async.Future<SmimeInfo> get(core.String userId, core.String sendAsEmail, core.
String id) { | |
2818 var _url = null; | 2787 var _url = null; |
2819 var _queryParams = new core.Map(); | 2788 var _queryParams = new core.Map(); |
2820 var _uploadMedia = null; | 2789 var _uploadMedia = null; |
2821 var _uploadOptions = null; | 2790 var _uploadOptions = null; |
2822 var _downloadOptions = commons.DownloadOptions.Metadata; | 2791 var _downloadOptions = commons.DownloadOptions.Metadata; |
2823 var _body = null; | 2792 var _body = null; |
2824 | 2793 |
2825 if (userId == null) { | 2794 if (userId == null) { |
2826 throw new core.ArgumentError("Parameter userId is required."); | 2795 throw new core.ArgumentError("Parameter userId is required."); |
2827 } | 2796 } |
2828 if (sendAsEmail == null) { | 2797 if (sendAsEmail == null) { |
2829 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2798 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2830 } | 2799 } |
2831 if (id == null) { | 2800 if (id == null) { |
2832 throw new core.ArgumentError("Parameter id is required."); | 2801 throw new core.ArgumentError("Parameter id is required."); |
2833 } | 2802 } |
2834 | 2803 |
2835 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail') + '/smimeInfo/' + commons.Escaper.ecap
eVariable('$id'); | 2804 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2805 '/settings/sendAs/' + |
| 2806 commons.Escaper.ecapeVariable('$sendAsEmail') + |
| 2807 '/smimeInfo/' + |
| 2808 commons.Escaper.ecapeVariable('$id'); |
2836 | 2809 |
2837 var _response = _requester.request(_url, | 2810 var _response = _requester.request(_url, "GET", |
2838 "GET", | 2811 body: _body, |
2839 body: _body, | 2812 queryParams: _queryParams, |
2840 queryParams: _queryParams, | 2813 uploadOptions: _uploadOptions, |
2841 uploadOptions: _uploadOptions, | 2814 uploadMedia: _uploadMedia, |
2842 uploadMedia: _uploadMedia, | 2815 downloadOptions: _downloadOptions); |
2843 downloadOptions: _downloadOptions); | |
2844 return _response.then((data) => new SmimeInfo.fromJson(data)); | 2816 return _response.then((data) => new SmimeInfo.fromJson(data)); |
2845 } | 2817 } |
2846 | 2818 |
2847 /** | 2819 /// Insert (upload) the given S/MIME config for the specified send-as alias. |
2848 * Insert (upload) the given S/MIME config for the specified send-as alias. | 2820 /// Note that pkcs12 format is required for the key. |
2849 * Note that pkcs12 format is required for the key. | 2821 /// |
2850 * | 2822 /// [request] - The metadata request object. |
2851 * [request] - The metadata request object. | 2823 /// |
2852 * | 2824 /// Request parameters: |
2853 * Request parameters: | 2825 /// |
2854 * | 2826 /// [userId] - The user's email address. The special value me can be used to |
2855 * [userId] - The user's email address. The special value me can be used to | 2827 /// indicate the authenticated user. |
2856 * indicate the authenticated user. | 2828 /// |
2857 * | 2829 /// [sendAsEmail] - The email address that appears in the "From:" header for |
2858 * [sendAsEmail] - The email address that appears in the "From:" header for | 2830 /// mail sent using this alias. |
2859 * mail sent using this alias. | 2831 /// |
2860 * | 2832 /// Completes with a [SmimeInfo]. |
2861 * Completes with a [SmimeInfo]. | 2833 /// |
2862 * | 2834 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2863 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2835 /// an error. |
2864 * error. | 2836 /// |
2865 * | 2837 /// If the used [http.Client] completes with an error when making a REST |
2866 * If the used [http.Client] completes with an error when making a REST call, | 2838 /// call, this method will complete with the same error. |
2867 * this method will complete with the same error. | 2839 async.Future<SmimeInfo> insert( |
2868 */ | 2840 SmimeInfo request, core.String userId, core.String sendAsEmail) { |
2869 async.Future<SmimeInfo> insert(SmimeInfo request, core.String userId, core.Str
ing sendAsEmail) { | |
2870 var _url = null; | 2841 var _url = null; |
2871 var _queryParams = new core.Map(); | 2842 var _queryParams = new core.Map(); |
2872 var _uploadMedia = null; | 2843 var _uploadMedia = null; |
2873 var _uploadOptions = null; | 2844 var _uploadOptions = null; |
2874 var _downloadOptions = commons.DownloadOptions.Metadata; | 2845 var _downloadOptions = commons.DownloadOptions.Metadata; |
2875 var _body = null; | 2846 var _body = null; |
2876 | 2847 |
2877 if (request != null) { | 2848 if (request != null) { |
2878 _body = convert.JSON.encode((request).toJson()); | 2849 _body = convert.JSON.encode((request).toJson()); |
2879 } | 2850 } |
2880 if (userId == null) { | 2851 if (userId == null) { |
2881 throw new core.ArgumentError("Parameter userId is required."); | 2852 throw new core.ArgumentError("Parameter userId is required."); |
2882 } | 2853 } |
2883 if (sendAsEmail == null) { | 2854 if (sendAsEmail == null) { |
2884 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2855 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2885 } | 2856 } |
2886 | 2857 |
2887 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail') + '/smimeInfo'; | 2858 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2859 '/settings/sendAs/' + |
| 2860 commons.Escaper.ecapeVariable('$sendAsEmail') + |
| 2861 '/smimeInfo'; |
2888 | 2862 |
2889 var _response = _requester.request(_url, | 2863 var _response = _requester.request(_url, "POST", |
2890 "POST", | 2864 body: _body, |
2891 body: _body, | 2865 queryParams: _queryParams, |
2892 queryParams: _queryParams, | 2866 uploadOptions: _uploadOptions, |
2893 uploadOptions: _uploadOptions, | 2867 uploadMedia: _uploadMedia, |
2894 uploadMedia: _uploadMedia, | 2868 downloadOptions: _downloadOptions); |
2895 downloadOptions: _downloadOptions); | |
2896 return _response.then((data) => new SmimeInfo.fromJson(data)); | 2869 return _response.then((data) => new SmimeInfo.fromJson(data)); |
2897 } | 2870 } |
2898 | 2871 |
2899 /** | 2872 /// Lists S/MIME configs for the specified send-as alias. |
2900 * Lists S/MIME configs for the specified send-as alias. | 2873 /// |
2901 * | 2874 /// Request parameters: |
2902 * Request parameters: | 2875 /// |
2903 * | 2876 /// [userId] - The user's email address. The special value me can be used to |
2904 * [userId] - The user's email address. The special value me can be used to | 2877 /// indicate the authenticated user. |
2905 * indicate the authenticated user. | 2878 /// |
2906 * | 2879 /// [sendAsEmail] - The email address that appears in the "From:" header for |
2907 * [sendAsEmail] - The email address that appears in the "From:" header for | 2880 /// mail sent using this alias. |
2908 * mail sent using this alias. | 2881 /// |
2909 * | 2882 /// Completes with a [ListSmimeInfoResponse]. |
2910 * Completes with a [ListSmimeInfoResponse]. | 2883 /// |
2911 * | 2884 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2912 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2885 /// an error. |
2913 * error. | 2886 /// |
2914 * | 2887 /// If the used [http.Client] completes with an error when making a REST |
2915 * If the used [http.Client] completes with an error when making a REST call, | 2888 /// call, this method will complete with the same error. |
2916 * this method will complete with the same error. | 2889 async.Future<ListSmimeInfoResponse> list( |
2917 */ | 2890 core.String userId, core.String sendAsEmail) { |
2918 async.Future<ListSmimeInfoResponse> list(core.String userId, core.String sendA
sEmail) { | |
2919 var _url = null; | 2891 var _url = null; |
2920 var _queryParams = new core.Map(); | 2892 var _queryParams = new core.Map(); |
2921 var _uploadMedia = null; | 2893 var _uploadMedia = null; |
2922 var _uploadOptions = null; | 2894 var _uploadOptions = null; |
2923 var _downloadOptions = commons.DownloadOptions.Metadata; | 2895 var _downloadOptions = commons.DownloadOptions.Metadata; |
2924 var _body = null; | 2896 var _body = null; |
2925 | 2897 |
2926 if (userId == null) { | 2898 if (userId == null) { |
2927 throw new core.ArgumentError("Parameter userId is required."); | 2899 throw new core.ArgumentError("Parameter userId is required."); |
2928 } | 2900 } |
2929 if (sendAsEmail == null) { | 2901 if (sendAsEmail == null) { |
2930 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2902 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2931 } | 2903 } |
2932 | 2904 |
2933 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail') + '/smimeInfo'; | 2905 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2906 '/settings/sendAs/' + |
| 2907 commons.Escaper.ecapeVariable('$sendAsEmail') + |
| 2908 '/smimeInfo'; |
2934 | 2909 |
2935 var _response = _requester.request(_url, | 2910 var _response = _requester.request(_url, "GET", |
2936 "GET", | 2911 body: _body, |
2937 body: _body, | 2912 queryParams: _queryParams, |
2938 queryParams: _queryParams, | 2913 uploadOptions: _uploadOptions, |
2939 uploadOptions: _uploadOptions, | 2914 uploadMedia: _uploadMedia, |
2940 uploadMedia: _uploadMedia, | 2915 downloadOptions: _downloadOptions); |
2941 downloadOptions: _downloadOptions); | |
2942 return _response.then((data) => new ListSmimeInfoResponse.fromJson(data)); | 2916 return _response.then((data) => new ListSmimeInfoResponse.fromJson(data)); |
2943 } | 2917 } |
2944 | 2918 |
2945 /** | 2919 /// Sets the default S/MIME config for the specified send-as alias. |
2946 * Sets the default S/MIME config for the specified send-as alias. | 2920 /// |
2947 * | 2921 /// Request parameters: |
2948 * Request parameters: | 2922 /// |
2949 * | 2923 /// [userId] - The user's email address. The special value me can be used to |
2950 * [userId] - The user's email address. The special value me can be used to | 2924 /// indicate the authenticated user. |
2951 * indicate the authenticated user. | 2925 /// |
2952 * | 2926 /// [sendAsEmail] - The email address that appears in the "From:" header for |
2953 * [sendAsEmail] - The email address that appears in the "From:" header for | 2927 /// mail sent using this alias. |
2954 * mail sent using this alias. | 2928 /// |
2955 * | 2929 /// [id] - The immutable ID for the SmimeInfo. |
2956 * [id] - The immutable ID for the SmimeInfo. | 2930 /// |
2957 * | 2931 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2958 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2932 /// an error. |
2959 * error. | 2933 /// |
2960 * | 2934 /// If the used [http.Client] completes with an error when making a REST |
2961 * If the used [http.Client] completes with an error when making a REST call, | 2935 /// call, this method will complete with the same error. |
2962 * this method will complete with the same error. | 2936 async.Future setDefault( |
2963 */ | 2937 core.String userId, core.String sendAsEmail, core.String id) { |
2964 async.Future setDefault(core.String userId, core.String sendAsEmail, core.Stri
ng id) { | |
2965 var _url = null; | 2938 var _url = null; |
2966 var _queryParams = new core.Map(); | 2939 var _queryParams = new core.Map(); |
2967 var _uploadMedia = null; | 2940 var _uploadMedia = null; |
2968 var _uploadOptions = null; | 2941 var _uploadOptions = null; |
2969 var _downloadOptions = commons.DownloadOptions.Metadata; | 2942 var _downloadOptions = commons.DownloadOptions.Metadata; |
2970 var _body = null; | 2943 var _body = null; |
2971 | 2944 |
2972 if (userId == null) { | 2945 if (userId == null) { |
2973 throw new core.ArgumentError("Parameter userId is required."); | 2946 throw new core.ArgumentError("Parameter userId is required."); |
2974 } | 2947 } |
2975 if (sendAsEmail == null) { | 2948 if (sendAsEmail == null) { |
2976 throw new core.ArgumentError("Parameter sendAsEmail is required."); | 2949 throw new core.ArgumentError("Parameter sendAsEmail is required."); |
2977 } | 2950 } |
2978 if (id == null) { | 2951 if (id == null) { |
2979 throw new core.ArgumentError("Parameter id is required."); | 2952 throw new core.ArgumentError("Parameter id is required."); |
2980 } | 2953 } |
2981 | 2954 |
2982 _downloadOptions = null; | 2955 _downloadOptions = null; |
2983 | 2956 |
2984 _url = commons.Escaper.ecapeVariable('$userId') + '/settings/sendAs/' + comm
ons.Escaper.ecapeVariable('$sendAsEmail') + '/smimeInfo/' + commons.Escaper.ecap
eVariable('$id') + '/setDefault'; | 2957 _url = commons.Escaper.ecapeVariable('$userId') + |
| 2958 '/settings/sendAs/' + |
| 2959 commons.Escaper.ecapeVariable('$sendAsEmail') + |
| 2960 '/smimeInfo/' + |
| 2961 commons.Escaper.ecapeVariable('$id') + |
| 2962 '/setDefault'; |
2985 | 2963 |
2986 var _response = _requester.request(_url, | 2964 var _response = _requester.request(_url, "POST", |
2987 "POST", | 2965 body: _body, |
2988 body: _body, | 2966 queryParams: _queryParams, |
2989 queryParams: _queryParams, | 2967 uploadOptions: _uploadOptions, |
2990 uploadOptions: _uploadOptions, | 2968 uploadMedia: _uploadMedia, |
2991 uploadMedia: _uploadMedia, | 2969 downloadOptions: _downloadOptions); |
2992 downloadOptions: _downloadOptions); | |
2993 return _response.then((data) => null); | 2970 return _response.then((data) => null); |
2994 } | 2971 } |
2995 | |
2996 } | 2972 } |
2997 | 2973 |
2998 | |
2999 class UsersThreadsResourceApi { | 2974 class UsersThreadsResourceApi { |
3000 final commons.ApiRequester _requester; | 2975 final commons.ApiRequester _requester; |
3001 | 2976 |
3002 UsersThreadsResourceApi(commons.ApiRequester client) : | 2977 UsersThreadsResourceApi(commons.ApiRequester client) : _requester = client; |
3003 _requester = client; | |
3004 | 2978 |
3005 /** | 2979 /// Immediately and permanently deletes the specified thread. This operation |
3006 * Immediately and permanently deletes the specified thread. This operation | 2980 /// cannot be undone. Prefer threads.trash instead. |
3007 * cannot be undone. Prefer threads.trash instead. | 2981 /// |
3008 * | 2982 /// Request parameters: |
3009 * Request parameters: | 2983 /// |
3010 * | 2984 /// [userId] - The user's email address. The special value me can be used to |
3011 * [userId] - The user's email address. The special value me can be used to | 2985 /// indicate the authenticated user. |
3012 * indicate the authenticated user. | 2986 /// |
3013 * | 2987 /// [id] - ID of the Thread to delete. |
3014 * [id] - ID of the Thread to delete. | 2988 /// |
3015 * | 2989 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
3016 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2990 /// an error. |
3017 * error. | 2991 /// |
3018 * | 2992 /// If the used [http.Client] completes with an error when making a REST |
3019 * If the used [http.Client] completes with an error when making a REST call, | 2993 /// call, this method will complete with the same error. |
3020 * this method will complete with the same error. | |
3021 */ | |
3022 async.Future delete(core.String userId, core.String id) { | 2994 async.Future delete(core.String userId, core.String id) { |
3023 var _url = null; | 2995 var _url = null; |
3024 var _queryParams = new core.Map(); | 2996 var _queryParams = new core.Map(); |
3025 var _uploadMedia = null; | 2997 var _uploadMedia = null; |
3026 var _uploadOptions = null; | 2998 var _uploadOptions = null; |
3027 var _downloadOptions = commons.DownloadOptions.Metadata; | 2999 var _downloadOptions = commons.DownloadOptions.Metadata; |
3028 var _body = null; | 3000 var _body = null; |
3029 | 3001 |
3030 if (userId == null) { | 3002 if (userId == null) { |
3031 throw new core.ArgumentError("Parameter userId is required."); | 3003 throw new core.ArgumentError("Parameter userId is required."); |
3032 } | 3004 } |
3033 if (id == null) { | 3005 if (id == null) { |
3034 throw new core.ArgumentError("Parameter id is required."); | 3006 throw new core.ArgumentError("Parameter id is required."); |
3035 } | 3007 } |
3036 | 3008 |
3037 _downloadOptions = null; | 3009 _downloadOptions = null; |
3038 | 3010 |
3039 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id'); | 3011 _url = commons.Escaper.ecapeVariable('$userId') + |
| 3012 '/threads/' + |
| 3013 commons.Escaper.ecapeVariable('$id'); |
3040 | 3014 |
3041 var _response = _requester.request(_url, | 3015 var _response = _requester.request(_url, "DELETE", |
3042 "DELETE", | 3016 body: _body, |
3043 body: _body, | 3017 queryParams: _queryParams, |
3044 queryParams: _queryParams, | 3018 uploadOptions: _uploadOptions, |
3045 uploadOptions: _uploadOptions, | 3019 uploadMedia: _uploadMedia, |
3046 uploadMedia: _uploadMedia, | 3020 downloadOptions: _downloadOptions); |
3047 downloadOptions: _downloadOptions); | |
3048 return _response.then((data) => null); | 3021 return _response.then((data) => null); |
3049 } | 3022 } |
3050 | 3023 |
3051 /** | 3024 /// Gets the specified thread. |
3052 * Gets the specified thread. | 3025 /// |
3053 * | 3026 /// Request parameters: |
3054 * Request parameters: | 3027 /// |
3055 * | 3028 /// [userId] - The user's email address. The special value me can be used to |
3056 * [userId] - The user's email address. The special value me can be used to | 3029 /// indicate the authenticated user. |
3057 * indicate the authenticated user. | 3030 /// |
3058 * | 3031 /// [id] - The ID of the thread to retrieve. |
3059 * [id] - The ID of the thread to retrieve. | 3032 /// |
3060 * | 3033 /// [format] - The format to return the messages in. |
3061 * [format] - The format to return the messages in. | 3034 /// Possible string values are: |
3062 * Possible string values are: | 3035 /// - "full" |
3063 * - "full" | 3036 /// - "metadata" |
3064 * - "metadata" | 3037 /// - "minimal" |
3065 * - "minimal" | 3038 /// |
3066 * | 3039 /// [metadataHeaders] - When given and format is METADATA, only include |
3067 * [metadataHeaders] - When given and format is METADATA, only include headers | 3040 /// headers specified. |
3068 * specified. | 3041 /// |
3069 * | 3042 /// Completes with a [Thread]. |
3070 * Completes with a [Thread]. | 3043 /// |
3071 * | 3044 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
3072 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 3045 /// an error. |
3073 * error. | 3046 /// |
3074 * | 3047 /// If the used [http.Client] completes with an error when making a REST |
3075 * If the used [http.Client] completes with an error when making a REST call, | 3048 /// call, this method will complete with the same error. |
3076 * this method will complete with the same error. | 3049 async.Future<Thread> get(core.String userId, core.String id, |
3077 */ | 3050 {core.String format, core.List<core.String> metadataHeaders}) { |
3078 async.Future<Thread> get(core.String userId, core.String id, {core.String form
at, core.List<core.String> metadataHeaders}) { | |
3079 var _url = null; | 3051 var _url = null; |
3080 var _queryParams = new core.Map(); | 3052 var _queryParams = new core.Map(); |
3081 var _uploadMedia = null; | 3053 var _uploadMedia = null; |
3082 var _uploadOptions = null; | 3054 var _uploadOptions = null; |
3083 var _downloadOptions = commons.DownloadOptions.Metadata; | 3055 var _downloadOptions = commons.DownloadOptions.Metadata; |
3084 var _body = null; | 3056 var _body = null; |
3085 | 3057 |
3086 if (userId == null) { | 3058 if (userId == null) { |
3087 throw new core.ArgumentError("Parameter userId is required."); | 3059 throw new core.ArgumentError("Parameter userId is required."); |
3088 } | 3060 } |
3089 if (id == null) { | 3061 if (id == null) { |
3090 throw new core.ArgumentError("Parameter id is required."); | 3062 throw new core.ArgumentError("Parameter id is required."); |
3091 } | 3063 } |
3092 if (format != null) { | 3064 if (format != null) { |
3093 _queryParams["format"] = [format]; | 3065 _queryParams["format"] = [format]; |
3094 } | 3066 } |
3095 if (metadataHeaders != null) { | 3067 if (metadataHeaders != null) { |
3096 _queryParams["metadataHeaders"] = metadataHeaders; | 3068 _queryParams["metadataHeaders"] = metadataHeaders; |
3097 } | 3069 } |
3098 | 3070 |
3099 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id'); | 3071 _url = commons.Escaper.ecapeVariable('$userId') + |
| 3072 '/threads/' + |
| 3073 commons.Escaper.ecapeVariable('$id'); |
3100 | 3074 |
3101 var _response = _requester.request(_url, | 3075 var _response = _requester.request(_url, "GET", |
3102 "GET", | 3076 body: _body, |
3103 body: _body, | 3077 queryParams: _queryParams, |
3104 queryParams: _queryParams, | 3078 uploadOptions: _uploadOptions, |
3105 uploadOptions: _uploadOptions, | 3079 uploadMedia: _uploadMedia, |
3106 uploadMedia: _uploadMedia, | 3080 downloadOptions: _downloadOptions); |
3107 downloadOptions: _downloadOptions); | |
3108 return _response.then((data) => new Thread.fromJson(data)); | 3081 return _response.then((data) => new Thread.fromJson(data)); |
3109 } | 3082 } |
3110 | 3083 |
3111 /** | 3084 /// Lists the threads in the user's mailbox. |
3112 * Lists the threads in the user's mailbox. | 3085 /// |
3113 * | 3086 /// Request parameters: |
3114 * Request parameters: | 3087 /// |
3115 * | 3088 /// [userId] - The user's email address. The special value me can be used to |
3116 * [userId] - The user's email address. The special value me can be used to | 3089 /// indicate the authenticated user. |
3117 * indicate the authenticated user. | 3090 /// |
3118 * | 3091 /// [includeSpamTrash] - Include threads from SPAM and TRASH in the results. |
3119 * [includeSpamTrash] - Include threads from SPAM and TRASH in the results. | 3092 /// |
3120 * | 3093 /// [labelIds] - Only return threads with labels that match all of the |
3121 * [labelIds] - Only return threads with labels that match all of the | 3094 /// specified label IDs. |
3122 * specified label IDs. | 3095 /// |
3123 * | 3096 /// [maxResults] - Maximum number of threads to return. |
3124 * [maxResults] - Maximum number of threads to return. | 3097 /// |
3125 * | 3098 /// [pageToken] - Page token to retrieve a specific page of results in the |
3126 * [pageToken] - Page token to retrieve a specific page of results in the | 3099 /// list. |
3127 * list. | 3100 /// |
3128 * | 3101 /// [q] - Only return threads matching the specified query. Supports the same |
3129 * [q] - Only return threads matching the specified query. Supports the same | 3102 /// query format as the Gmail search box. For example, |
3130 * query format as the Gmail search box. For example, | 3103 /// "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be |
3131 * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be | 3104 /// used when accessing the api using the gmail.metadata scope. |
3132 * used when accessing the api using the gmail.metadata scope. | 3105 /// |
3133 * | 3106 /// Completes with a [ListThreadsResponse]. |
3134 * Completes with a [ListThreadsResponse]. | 3107 /// |
3135 * | 3108 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
3136 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 3109 /// an error. |
3137 * error. | 3110 /// |
3138 * | 3111 /// If the used [http.Client] completes with an error when making a REST |
3139 * If the used [http.Client] completes with an error when making a REST call, | 3112 /// call, this method will complete with the same error. |
3140 * this method will complete with the same error. | 3113 async.Future<ListThreadsResponse> list(core.String userId, |
3141 */ | 3114 {core.bool includeSpamTrash, |
3142 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}) { | 3115 core.List<core.String> labelIds, |
| 3116 core.int maxResults, |
| 3117 core.String pageToken, |
| 3118 core.String q}) { |
3143 var _url = null; | 3119 var _url = null; |
3144 var _queryParams = new core.Map(); | 3120 var _queryParams = new core.Map(); |
3145 var _uploadMedia = null; | 3121 var _uploadMedia = null; |
3146 var _uploadOptions = null; | 3122 var _uploadOptions = null; |
3147 var _downloadOptions = commons.DownloadOptions.Metadata; | 3123 var _downloadOptions = commons.DownloadOptions.Metadata; |
3148 var _body = null; | 3124 var _body = null; |
3149 | 3125 |
3150 if (userId == null) { | 3126 if (userId == null) { |
3151 throw new core.ArgumentError("Parameter userId is required."); | 3127 throw new core.ArgumentError("Parameter userId is required."); |
3152 } | 3128 } |
3153 if (includeSpamTrash != null) { | 3129 if (includeSpamTrash != null) { |
3154 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; | 3130 _queryParams["includeSpamTrash"] = ["${includeSpamTrash}"]; |
3155 } | 3131 } |
3156 if (labelIds != null) { | 3132 if (labelIds != null) { |
3157 _queryParams["labelIds"] = labelIds; | 3133 _queryParams["labelIds"] = labelIds; |
3158 } | 3134 } |
3159 if (maxResults != null) { | 3135 if (maxResults != null) { |
3160 _queryParams["maxResults"] = ["${maxResults}"]; | 3136 _queryParams["maxResults"] = ["${maxResults}"]; |
3161 } | 3137 } |
3162 if (pageToken != null) { | 3138 if (pageToken != null) { |
3163 _queryParams["pageToken"] = [pageToken]; | 3139 _queryParams["pageToken"] = [pageToken]; |
3164 } | 3140 } |
3165 if (q != null) { | 3141 if (q != null) { |
3166 _queryParams["q"] = [q]; | 3142 _queryParams["q"] = [q]; |
3167 } | 3143 } |
3168 | 3144 |
3169 _url = commons.Escaper.ecapeVariable('$userId') + '/threads'; | 3145 _url = commons.Escaper.ecapeVariable('$userId') + '/threads'; |
3170 | 3146 |
3171 var _response = _requester.request(_url, | 3147 var _response = _requester.request(_url, "GET", |
3172 "GET", | 3148 body: _body, |
3173 body: _body, | 3149 queryParams: _queryParams, |
3174 queryParams: _queryParams, | 3150 uploadOptions: _uploadOptions, |
3175 uploadOptions: _uploadOptions, | 3151 uploadMedia: _uploadMedia, |
3176 uploadMedia: _uploadMedia, | 3152 downloadOptions: _downloadOptions); |
3177 downloadOptions: _downloadOptions); | |
3178 return _response.then((data) => new ListThreadsResponse.fromJson(data)); | 3153 return _response.then((data) => new ListThreadsResponse.fromJson(data)); |
3179 } | 3154 } |
3180 | 3155 |
3181 /** | 3156 /// Modifies the labels applied to the thread. This applies to all messages |
3182 * Modifies the labels applied to the thread. This applies to all messages in | 3157 /// in the thread. |
3183 * the thread. | 3158 /// |
3184 * | 3159 /// [request] - The metadata request object. |
3185 * [request] - The metadata request object. | 3160 /// |
3186 * | 3161 /// Request parameters: |
3187 * Request parameters: | 3162 /// |
3188 * | 3163 /// [userId] - The user's email address. The special value me can be used to |
3189 * [userId] - The user's email address. The special value me can be used to | 3164 /// indicate the authenticated user. |
3190 * indicate the authenticated user. | 3165 /// |
3191 * | 3166 /// [id] - The ID of the thread to modify. |
3192 * [id] - The ID of the thread to modify. | 3167 /// |
3193 * | 3168 /// Completes with a [Thread]. |
3194 * Completes with a [Thread]. | 3169 /// |
3195 * | 3170 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
3196 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 3171 /// an error. |
3197 * error. | 3172 /// |
3198 * | 3173 /// If the used [http.Client] completes with an error when making a REST |
3199 * If the used [http.Client] completes with an error when making a REST call, | 3174 /// call, this method will complete with the same error. |
3200 * this method will complete with the same error. | 3175 async.Future<Thread> modify( |
3201 */ | 3176 ModifyThreadRequest request, core.String userId, core.String id) { |
3202 async.Future<Thread> modify(ModifyThreadRequest request, core.String userId, c
ore.String id) { | |
3203 var _url = null; | 3177 var _url = null; |
3204 var _queryParams = new core.Map(); | 3178 var _queryParams = new core.Map(); |
3205 var _uploadMedia = null; | 3179 var _uploadMedia = null; |
3206 var _uploadOptions = null; | 3180 var _uploadOptions = null; |
3207 var _downloadOptions = commons.DownloadOptions.Metadata; | 3181 var _downloadOptions = commons.DownloadOptions.Metadata; |
3208 var _body = null; | 3182 var _body = null; |
3209 | 3183 |
3210 if (request != null) { | 3184 if (request != null) { |
3211 _body = convert.JSON.encode((request).toJson()); | 3185 _body = convert.JSON.encode((request).toJson()); |
3212 } | 3186 } |
3213 if (userId == null) { | 3187 if (userId == null) { |
3214 throw new core.ArgumentError("Parameter userId is required."); | 3188 throw new core.ArgumentError("Parameter userId is required."); |
3215 } | 3189 } |
3216 if (id == null) { | 3190 if (id == null) { |
3217 throw new core.ArgumentError("Parameter id is required."); | 3191 throw new core.ArgumentError("Parameter id is required."); |
3218 } | 3192 } |
3219 | 3193 |
3220 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id') + '/modify'; | 3194 _url = commons.Escaper.ecapeVariable('$userId') + |
| 3195 '/threads/' + |
| 3196 commons.Escaper.ecapeVariable('$id') + |
| 3197 '/modify'; |
3221 | 3198 |
3222 var _response = _requester.request(_url, | 3199 var _response = _requester.request(_url, "POST", |
3223 "POST", | 3200 body: _body, |
3224 body: _body, | 3201 queryParams: _queryParams, |
3225 queryParams: _queryParams, | 3202 uploadOptions: _uploadOptions, |
3226 uploadOptions: _uploadOptions, | 3203 uploadMedia: _uploadMedia, |
3227 uploadMedia: _uploadMedia, | 3204 downloadOptions: _downloadOptions); |
3228 downloadOptions: _downloadOptions); | |
3229 return _response.then((data) => new Thread.fromJson(data)); | 3205 return _response.then((data) => new Thread.fromJson(data)); |
3230 } | 3206 } |
3231 | 3207 |
3232 /** | 3208 /// Moves the specified thread to the trash. |
3233 * Moves the specified thread to the trash. | 3209 /// |
3234 * | 3210 /// Request parameters: |
3235 * Request parameters: | 3211 /// |
3236 * | 3212 /// [userId] - The user's email address. The special value me can be used to |
3237 * [userId] - The user's email address. The special value me can be used to | 3213 /// indicate the authenticated user. |
3238 * indicate the authenticated user. | 3214 /// |
3239 * | 3215 /// [id] - The ID of the thread to Trash. |
3240 * [id] - The ID of the thread to Trash. | 3216 /// |
3241 * | 3217 /// Completes with a [Thread]. |
3242 * Completes with a [Thread]. | 3218 /// |
3243 * | 3219 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
3244 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 3220 /// an error. |
3245 * error. | 3221 /// |
3246 * | 3222 /// If the used [http.Client] completes with an error when making a REST |
3247 * If the used [http.Client] completes with an error when making a REST call, | 3223 /// call, this method will complete with the same error. |
3248 * this method will complete with the same error. | |
3249 */ | |
3250 async.Future<Thread> trash(core.String userId, core.String id) { | 3224 async.Future<Thread> trash(core.String userId, core.String id) { |
3251 var _url = null; | 3225 var _url = null; |
3252 var _queryParams = new core.Map(); | 3226 var _queryParams = new core.Map(); |
3253 var _uploadMedia = null; | 3227 var _uploadMedia = null; |
3254 var _uploadOptions = null; | 3228 var _uploadOptions = null; |
3255 var _downloadOptions = commons.DownloadOptions.Metadata; | 3229 var _downloadOptions = commons.DownloadOptions.Metadata; |
3256 var _body = null; | 3230 var _body = null; |
3257 | 3231 |
3258 if (userId == null) { | 3232 if (userId == null) { |
3259 throw new core.ArgumentError("Parameter userId is required."); | 3233 throw new core.ArgumentError("Parameter userId is required."); |
3260 } | 3234 } |
3261 if (id == null) { | 3235 if (id == null) { |
3262 throw new core.ArgumentError("Parameter id is required."); | 3236 throw new core.ArgumentError("Parameter id is required."); |
3263 } | 3237 } |
3264 | 3238 |
3265 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id') + '/trash'; | 3239 _url = commons.Escaper.ecapeVariable('$userId') + |
| 3240 '/threads/' + |
| 3241 commons.Escaper.ecapeVariable('$id') + |
| 3242 '/trash'; |
3266 | 3243 |
3267 var _response = _requester.request(_url, | 3244 var _response = _requester.request(_url, "POST", |
3268 "POST", | 3245 body: _body, |
3269 body: _body, | 3246 queryParams: _queryParams, |
3270 queryParams: _queryParams, | 3247 uploadOptions: _uploadOptions, |
3271 uploadOptions: _uploadOptions, | 3248 uploadMedia: _uploadMedia, |
3272 uploadMedia: _uploadMedia, | 3249 downloadOptions: _downloadOptions); |
3273 downloadOptions: _downloadOptions); | |
3274 return _response.then((data) => new Thread.fromJson(data)); | 3250 return _response.then((data) => new Thread.fromJson(data)); |
3275 } | 3251 } |
3276 | 3252 |
3277 /** | 3253 /// Removes the specified thread from the trash. |
3278 * Removes the specified thread from the trash. | 3254 /// |
3279 * | 3255 /// Request parameters: |
3280 * Request parameters: | 3256 /// |
3281 * | 3257 /// [userId] - The user's email address. The special value me can be used to |
3282 * [userId] - The user's email address. The special value me can be used to | 3258 /// indicate the authenticated user. |
3283 * indicate the authenticated user. | 3259 /// |
3284 * | 3260 /// [id] - The ID of the thread to remove from Trash. |
3285 * [id] - The ID of the thread to remove from Trash. | 3261 /// |
3286 * | 3262 /// Completes with a [Thread]. |
3287 * Completes with a [Thread]. | 3263 /// |
3288 * | 3264 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
3289 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 3265 /// an error. |
3290 * error. | 3266 /// |
3291 * | 3267 /// If the used [http.Client] completes with an error when making a REST |
3292 * If the used [http.Client] completes with an error when making a REST call, | 3268 /// call, this method will complete with the same error. |
3293 * this method will complete with the same error. | |
3294 */ | |
3295 async.Future<Thread> untrash(core.String userId, core.String id) { | 3269 async.Future<Thread> untrash(core.String userId, core.String id) { |
3296 var _url = null; | 3270 var _url = null; |
3297 var _queryParams = new core.Map(); | 3271 var _queryParams = new core.Map(); |
3298 var _uploadMedia = null; | 3272 var _uploadMedia = null; |
3299 var _uploadOptions = null; | 3273 var _uploadOptions = null; |
3300 var _downloadOptions = commons.DownloadOptions.Metadata; | 3274 var _downloadOptions = commons.DownloadOptions.Metadata; |
3301 var _body = null; | 3275 var _body = null; |
3302 | 3276 |
3303 if (userId == null) { | 3277 if (userId == null) { |
3304 throw new core.ArgumentError("Parameter userId is required."); | 3278 throw new core.ArgumentError("Parameter userId is required."); |
3305 } | 3279 } |
3306 if (id == null) { | 3280 if (id == null) { |
3307 throw new core.ArgumentError("Parameter id is required."); | 3281 throw new core.ArgumentError("Parameter id is required."); |
3308 } | 3282 } |
3309 | 3283 |
3310 _url = commons.Escaper.ecapeVariable('$userId') + '/threads/' + commons.Esca
per.ecapeVariable('$id') + '/untrash'; | 3284 _url = commons.Escaper.ecapeVariable('$userId') + |
| 3285 '/threads/' + |
| 3286 commons.Escaper.ecapeVariable('$id') + |
| 3287 '/untrash'; |
3311 | 3288 |
3312 var _response = _requester.request(_url, | 3289 var _response = _requester.request(_url, "POST", |
3313 "POST", | 3290 body: _body, |
3314 body: _body, | 3291 queryParams: _queryParams, |
3315 queryParams: _queryParams, | 3292 uploadOptions: _uploadOptions, |
3316 uploadOptions: _uploadOptions, | 3293 uploadMedia: _uploadMedia, |
3317 uploadMedia: _uploadMedia, | 3294 downloadOptions: _downloadOptions); |
3318 downloadOptions: _downloadOptions); | |
3319 return _response.then((data) => new Thread.fromJson(data)); | 3295 return _response.then((data) => new Thread.fromJson(data)); |
3320 } | 3296 } |
3321 | |
3322 } | 3297 } |
3323 | 3298 |
| 3299 /// Auto-forwarding settings for an account. |
| 3300 class AutoForwarding { |
| 3301 /// The state that a message should be left in after it has been forwarded. |
| 3302 /// Possible string values are: |
| 3303 /// - "archive" |
| 3304 /// - "dispositionUnspecified" |
| 3305 /// - "leaveInInbox" |
| 3306 /// - "markRead" |
| 3307 /// - "trash" |
| 3308 core.String disposition; |
3324 | 3309 |
| 3310 /// Email address to which all incoming messages are forwarded. This email |
| 3311 /// address must be a verified member of the forwarding addresses. |
| 3312 core.String emailAddress; |
3325 | 3313 |
3326 /** Auto-forwarding settings for an account. */ | 3314 /// Whether all incoming mail is automatically forwarded to another address. |
3327 class AutoForwarding { | |
3328 /** | |
3329 * The state that a message should be left in after it has been forwarded. | |
3330 * Possible string values are: | |
3331 * - "archive" | |
3332 * - "dispositionUnspecified" | |
3333 * - "leaveInInbox" | |
3334 * - "markRead" | |
3335 * - "trash" | |
3336 */ | |
3337 core.String disposition; | |
3338 /** | |
3339 * Email address to which all incoming messages are forwarded. This email | |
3340 * address must be a verified member of the forwarding addresses. | |
3341 */ | |
3342 core.String emailAddress; | |
3343 /** | |
3344 * Whether all incoming mail is automatically forwarded to another address. | |
3345 */ | |
3346 core.bool enabled; | 3315 core.bool enabled; |
3347 | 3316 |
3348 AutoForwarding(); | 3317 AutoForwarding(); |
3349 | 3318 |
3350 AutoForwarding.fromJson(core.Map _json) { | 3319 AutoForwarding.fromJson(core.Map _json) { |
3351 if (_json.containsKey("disposition")) { | 3320 if (_json.containsKey("disposition")) { |
3352 disposition = _json["disposition"]; | 3321 disposition = _json["disposition"]; |
3353 } | 3322 } |
3354 if (_json.containsKey("emailAddress")) { | 3323 if (_json.containsKey("emailAddress")) { |
3355 emailAddress = _json["emailAddress"]; | 3324 emailAddress = _json["emailAddress"]; |
3356 } | 3325 } |
3357 if (_json.containsKey("enabled")) { | 3326 if (_json.containsKey("enabled")) { |
3358 enabled = _json["enabled"]; | 3327 enabled = _json["enabled"]; |
3359 } | 3328 } |
3360 } | 3329 } |
3361 | 3330 |
3362 core.Map<core.String, core.Object> toJson() { | 3331 core.Map<core.String, core.Object> toJson() { |
3363 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3332 final core.Map<core.String, core.Object> _json = |
| 3333 new core.Map<core.String, core.Object>(); |
3364 if (disposition != null) { | 3334 if (disposition != null) { |
3365 _json["disposition"] = disposition; | 3335 _json["disposition"] = disposition; |
3366 } | 3336 } |
3367 if (emailAddress != null) { | 3337 if (emailAddress != null) { |
3368 _json["emailAddress"] = emailAddress; | 3338 _json["emailAddress"] = emailAddress; |
3369 } | 3339 } |
3370 if (enabled != null) { | 3340 if (enabled != null) { |
3371 _json["enabled"] = enabled; | 3341 _json["enabled"] = enabled; |
3372 } | 3342 } |
3373 return _json; | 3343 return _json; |
3374 } | 3344 } |
3375 } | 3345 } |
3376 | 3346 |
3377 class BatchDeleteMessagesRequest { | 3347 class BatchDeleteMessagesRequest { |
3378 /** The IDs of the messages to delete. */ | 3348 /// The IDs of the messages to delete. |
3379 core.List<core.String> ids; | 3349 core.List<core.String> ids; |
3380 | 3350 |
3381 BatchDeleteMessagesRequest(); | 3351 BatchDeleteMessagesRequest(); |
3382 | 3352 |
3383 BatchDeleteMessagesRequest.fromJson(core.Map _json) { | 3353 BatchDeleteMessagesRequest.fromJson(core.Map _json) { |
3384 if (_json.containsKey("ids")) { | 3354 if (_json.containsKey("ids")) { |
3385 ids = _json["ids"]; | 3355 ids = _json["ids"]; |
3386 } | 3356 } |
3387 } | 3357 } |
3388 | 3358 |
3389 core.Map<core.String, core.Object> toJson() { | 3359 core.Map<core.String, core.Object> toJson() { |
3390 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3360 final core.Map<core.String, core.Object> _json = |
| 3361 new core.Map<core.String, core.Object>(); |
3391 if (ids != null) { | 3362 if (ids != null) { |
3392 _json["ids"] = ids; | 3363 _json["ids"] = ids; |
3393 } | 3364 } |
3394 return _json; | 3365 return _json; |
3395 } | 3366 } |
3396 } | 3367 } |
3397 | 3368 |
3398 class BatchModifyMessagesRequest { | 3369 class BatchModifyMessagesRequest { |
3399 /** A list of label IDs to add to messages. */ | 3370 /// A list of label IDs to add to messages. |
3400 core.List<core.String> addLabelIds; | 3371 core.List<core.String> addLabelIds; |
3401 /** | 3372 |
3402 * The IDs of the messages to modify. There is a limit of 1000 ids per | 3373 /// The IDs of the messages to modify. There is a limit of 1000 ids per |
3403 * request. | 3374 /// request. |
3404 */ | |
3405 core.List<core.String> ids; | 3375 core.List<core.String> ids; |
3406 /** A list of label IDs to remove from messages. */ | 3376 |
| 3377 /// A list of label IDs to remove from messages. |
3407 core.List<core.String> removeLabelIds; | 3378 core.List<core.String> removeLabelIds; |
3408 | 3379 |
3409 BatchModifyMessagesRequest(); | 3380 BatchModifyMessagesRequest(); |
3410 | 3381 |
3411 BatchModifyMessagesRequest.fromJson(core.Map _json) { | 3382 BatchModifyMessagesRequest.fromJson(core.Map _json) { |
3412 if (_json.containsKey("addLabelIds")) { | 3383 if (_json.containsKey("addLabelIds")) { |
3413 addLabelIds = _json["addLabelIds"]; | 3384 addLabelIds = _json["addLabelIds"]; |
3414 } | 3385 } |
3415 if (_json.containsKey("ids")) { | 3386 if (_json.containsKey("ids")) { |
3416 ids = _json["ids"]; | 3387 ids = _json["ids"]; |
3417 } | 3388 } |
3418 if (_json.containsKey("removeLabelIds")) { | 3389 if (_json.containsKey("removeLabelIds")) { |
3419 removeLabelIds = _json["removeLabelIds"]; | 3390 removeLabelIds = _json["removeLabelIds"]; |
3420 } | 3391 } |
3421 } | 3392 } |
3422 | 3393 |
3423 core.Map<core.String, core.Object> toJson() { | 3394 core.Map<core.String, core.Object> toJson() { |
3424 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3395 final core.Map<core.String, core.Object> _json = |
| 3396 new core.Map<core.String, core.Object>(); |
3425 if (addLabelIds != null) { | 3397 if (addLabelIds != null) { |
3426 _json["addLabelIds"] = addLabelIds; | 3398 _json["addLabelIds"] = addLabelIds; |
3427 } | 3399 } |
3428 if (ids != null) { | 3400 if (ids != null) { |
3429 _json["ids"] = ids; | 3401 _json["ids"] = ids; |
3430 } | 3402 } |
3431 if (removeLabelIds != null) { | 3403 if (removeLabelIds != null) { |
3432 _json["removeLabelIds"] = removeLabelIds; | 3404 _json["removeLabelIds"] = removeLabelIds; |
3433 } | 3405 } |
3434 return _json; | 3406 return _json; |
3435 } | 3407 } |
3436 } | 3408 } |
3437 | 3409 |
3438 /** A draft email in the user's mailbox. */ | 3410 /// A draft email in the user's mailbox. |
3439 class Draft { | 3411 class Draft { |
3440 /** The immutable ID of the draft. */ | 3412 /// The immutable ID of the draft. |
3441 core.String id; | 3413 core.String id; |
3442 /** The message content of the draft. */ | 3414 |
| 3415 /// The message content of the draft. |
3443 Message message; | 3416 Message message; |
3444 | 3417 |
3445 Draft(); | 3418 Draft(); |
3446 | 3419 |
3447 Draft.fromJson(core.Map _json) { | 3420 Draft.fromJson(core.Map _json) { |
3448 if (_json.containsKey("id")) { | 3421 if (_json.containsKey("id")) { |
3449 id = _json["id"]; | 3422 id = _json["id"]; |
3450 } | 3423 } |
3451 if (_json.containsKey("message")) { | 3424 if (_json.containsKey("message")) { |
3452 message = new Message.fromJson(_json["message"]); | 3425 message = new Message.fromJson(_json["message"]); |
3453 } | 3426 } |
3454 } | 3427 } |
3455 | 3428 |
3456 core.Map<core.String, core.Object> toJson() { | 3429 core.Map<core.String, core.Object> toJson() { |
3457 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3430 final core.Map<core.String, core.Object> _json = |
| 3431 new core.Map<core.String, core.Object>(); |
3458 if (id != null) { | 3432 if (id != null) { |
3459 _json["id"] = id; | 3433 _json["id"] = id; |
3460 } | 3434 } |
3461 if (message != null) { | 3435 if (message != null) { |
3462 _json["message"] = (message).toJson(); | 3436 _json["message"] = (message).toJson(); |
3463 } | 3437 } |
3464 return _json; | 3438 return _json; |
3465 } | 3439 } |
3466 } | 3440 } |
3467 | 3441 |
3468 /** | 3442 /// Resource definition for Gmail filters. Filters apply to specific messages |
3469 * Resource definition for Gmail filters. Filters apply to specific messages | 3443 /// instead of an entire email thread. |
3470 * instead of an entire email thread. | |
3471 */ | |
3472 class Filter { | 3444 class Filter { |
3473 /** Action that the filter performs. */ | 3445 /// Action that the filter performs. |
3474 FilterAction action; | 3446 FilterAction action; |
3475 /** Matching criteria for the filter. */ | 3447 |
| 3448 /// Matching criteria for the filter. |
3476 FilterCriteria criteria; | 3449 FilterCriteria criteria; |
3477 /** The server assigned ID of the filter. */ | 3450 |
| 3451 /// The server assigned ID of the filter. |
3478 core.String id; | 3452 core.String id; |
3479 | 3453 |
3480 Filter(); | 3454 Filter(); |
3481 | 3455 |
3482 Filter.fromJson(core.Map _json) { | 3456 Filter.fromJson(core.Map _json) { |
3483 if (_json.containsKey("action")) { | 3457 if (_json.containsKey("action")) { |
3484 action = new FilterAction.fromJson(_json["action"]); | 3458 action = new FilterAction.fromJson(_json["action"]); |
3485 } | 3459 } |
3486 if (_json.containsKey("criteria")) { | 3460 if (_json.containsKey("criteria")) { |
3487 criteria = new FilterCriteria.fromJson(_json["criteria"]); | 3461 criteria = new FilterCriteria.fromJson(_json["criteria"]); |
3488 } | 3462 } |
3489 if (_json.containsKey("id")) { | 3463 if (_json.containsKey("id")) { |
3490 id = _json["id"]; | 3464 id = _json["id"]; |
3491 } | 3465 } |
3492 } | 3466 } |
3493 | 3467 |
3494 core.Map<core.String, core.Object> toJson() { | 3468 core.Map<core.String, core.Object> toJson() { |
3495 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3469 final core.Map<core.String, core.Object> _json = |
| 3470 new core.Map<core.String, core.Object>(); |
3496 if (action != null) { | 3471 if (action != null) { |
3497 _json["action"] = (action).toJson(); | 3472 _json["action"] = (action).toJson(); |
3498 } | 3473 } |
3499 if (criteria != null) { | 3474 if (criteria != null) { |
3500 _json["criteria"] = (criteria).toJson(); | 3475 _json["criteria"] = (criteria).toJson(); |
3501 } | 3476 } |
3502 if (id != null) { | 3477 if (id != null) { |
3503 _json["id"] = id; | 3478 _json["id"] = id; |
3504 } | 3479 } |
3505 return _json; | 3480 return _json; |
3506 } | 3481 } |
3507 } | 3482 } |
3508 | 3483 |
3509 /** A set of actions to perform on a message. */ | 3484 /// A set of actions to perform on a message. |
3510 class FilterAction { | 3485 class FilterAction { |
3511 /** List of labels to add to the message. */ | 3486 /// List of labels to add to the message. |
3512 core.List<core.String> addLabelIds; | 3487 core.List<core.String> addLabelIds; |
3513 /** Email address that the message should be forwarded to. */ | 3488 |
| 3489 /// Email address that the message should be forwarded to. |
3514 core.String forward; | 3490 core.String forward; |
3515 /** List of labels to remove from the message. */ | 3491 |
| 3492 /// List of labels to remove from the message. |
3516 core.List<core.String> removeLabelIds; | 3493 core.List<core.String> removeLabelIds; |
3517 | 3494 |
3518 FilterAction(); | 3495 FilterAction(); |
3519 | 3496 |
3520 FilterAction.fromJson(core.Map _json) { | 3497 FilterAction.fromJson(core.Map _json) { |
3521 if (_json.containsKey("addLabelIds")) { | 3498 if (_json.containsKey("addLabelIds")) { |
3522 addLabelIds = _json["addLabelIds"]; | 3499 addLabelIds = _json["addLabelIds"]; |
3523 } | 3500 } |
3524 if (_json.containsKey("forward")) { | 3501 if (_json.containsKey("forward")) { |
3525 forward = _json["forward"]; | 3502 forward = _json["forward"]; |
3526 } | 3503 } |
3527 if (_json.containsKey("removeLabelIds")) { | 3504 if (_json.containsKey("removeLabelIds")) { |
3528 removeLabelIds = _json["removeLabelIds"]; | 3505 removeLabelIds = _json["removeLabelIds"]; |
3529 } | 3506 } |
3530 } | 3507 } |
3531 | 3508 |
3532 core.Map<core.String, core.Object> toJson() { | 3509 core.Map<core.String, core.Object> toJson() { |
3533 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3510 final core.Map<core.String, core.Object> _json = |
| 3511 new core.Map<core.String, core.Object>(); |
3534 if (addLabelIds != null) { | 3512 if (addLabelIds != null) { |
3535 _json["addLabelIds"] = addLabelIds; | 3513 _json["addLabelIds"] = addLabelIds; |
3536 } | 3514 } |
3537 if (forward != null) { | 3515 if (forward != null) { |
3538 _json["forward"] = forward; | 3516 _json["forward"] = forward; |
3539 } | 3517 } |
3540 if (removeLabelIds != null) { | 3518 if (removeLabelIds != null) { |
3541 _json["removeLabelIds"] = removeLabelIds; | 3519 _json["removeLabelIds"] = removeLabelIds; |
3542 } | 3520 } |
3543 return _json; | 3521 return _json; |
3544 } | 3522 } |
3545 } | 3523 } |
3546 | 3524 |
3547 /** Message matching criteria. */ | 3525 /// Message matching criteria. |
3548 class FilterCriteria { | 3526 class FilterCriteria { |
3549 /** Whether the response should exclude chats. */ | 3527 /// Whether the response should exclude chats. |
3550 core.bool excludeChats; | 3528 core.bool excludeChats; |
3551 /** The sender's display name or email address. */ | 3529 |
| 3530 /// The sender's display name or email address. |
3552 core.String from; | 3531 core.String from; |
3553 /** Whether the message has any attachment. */ | 3532 |
| 3533 /// Whether the message has any attachment. |
3554 core.bool hasAttachment; | 3534 core.bool hasAttachment; |
3555 /** | 3535 |
3556 * Only return messages not matching the specified query. Supports the same | 3536 /// Only return messages not matching the specified query. Supports the same |
3557 * query format as the Gmail search box. For example, | 3537 /// query format as the Gmail search box. For example, |
3558 * "from:someuser@example.com rfc822msgid: is:unread". | 3538 /// "from:someuser@example.com rfc822msgid: is:unread". |
3559 */ | |
3560 core.String negatedQuery; | 3539 core.String negatedQuery; |
3561 /** | 3540 |
3562 * Only return messages matching the specified query. Supports the same query | 3541 /// Only return messages matching the specified query. Supports the same |
3563 * format as the Gmail search box. For example, "from:someuser@example.com | 3542 /// query format as the Gmail search box. For example, |
3564 * rfc822msgid: is:unread". | 3543 /// "from:someuser@example.com rfc822msgid: is:unread". |
3565 */ | |
3566 core.String query; | 3544 core.String query; |
3567 /** | 3545 |
3568 * The size of the entire RFC822 message in bytes, including all headers and | 3546 /// The size of the entire RFC822 message in bytes, including all headers and |
3569 * attachments. | 3547 /// attachments. |
3570 */ | |
3571 core.int size; | 3548 core.int size; |
3572 /** | 3549 |
3573 * How the message size in bytes should be in relation to the size field. | 3550 /// How the message size in bytes should be in relation to the size field. |
3574 * Possible string values are: | 3551 /// Possible string values are: |
3575 * - "larger" | 3552 /// - "larger" |
3576 * - "smaller" | 3553 /// - "smaller" |
3577 * - "unspecified" | 3554 /// - "unspecified" |
3578 */ | |
3579 core.String sizeComparison; | 3555 core.String sizeComparison; |
3580 /** | 3556 |
3581 * Case-insensitive phrase found in the message's subject. Trailing and | 3557 /// Case-insensitive phrase found in the message's subject. Trailing and |
3582 * leading whitespace are be trimmed and adjacent spaces are collapsed. | 3558 /// leading whitespace are be trimmed and adjacent spaces are collapsed. |
3583 */ | |
3584 core.String subject; | 3559 core.String subject; |
3585 /** | 3560 |
3586 * The recipient's display name or email address. Includes recipients in the | 3561 /// The recipient's display name or email address. Includes recipients in the |
3587 * "to", "cc", and "bcc" header fields. You can use simply the local part of | 3562 /// "to", "cc", and "bcc" header fields. You can use simply the local part of |
3588 * the email address. For example, "example" and "example@" both match | 3563 /// the email address. For example, "example" and "example@" both match |
3589 * "example@gmail.com". This field is case-insensitive. | 3564 /// "example@gmail.com". This field is case-insensitive. |
3590 */ | |
3591 core.String to; | 3565 core.String to; |
3592 | 3566 |
3593 FilterCriteria(); | 3567 FilterCriteria(); |
3594 | 3568 |
3595 FilterCriteria.fromJson(core.Map _json) { | 3569 FilterCriteria.fromJson(core.Map _json) { |
3596 if (_json.containsKey("excludeChats")) { | 3570 if (_json.containsKey("excludeChats")) { |
3597 excludeChats = _json["excludeChats"]; | 3571 excludeChats = _json["excludeChats"]; |
3598 } | 3572 } |
3599 if (_json.containsKey("from")) { | 3573 if (_json.containsKey("from")) { |
3600 from = _json["from"]; | 3574 from = _json["from"]; |
(...skipping 15 matching lines...) Expand all Loading... |
3616 } | 3590 } |
3617 if (_json.containsKey("subject")) { | 3591 if (_json.containsKey("subject")) { |
3618 subject = _json["subject"]; | 3592 subject = _json["subject"]; |
3619 } | 3593 } |
3620 if (_json.containsKey("to")) { | 3594 if (_json.containsKey("to")) { |
3621 to = _json["to"]; | 3595 to = _json["to"]; |
3622 } | 3596 } |
3623 } | 3597 } |
3624 | 3598 |
3625 core.Map<core.String, core.Object> toJson() { | 3599 core.Map<core.String, core.Object> toJson() { |
3626 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3600 final core.Map<core.String, core.Object> _json = |
| 3601 new core.Map<core.String, core.Object>(); |
3627 if (excludeChats != null) { | 3602 if (excludeChats != null) { |
3628 _json["excludeChats"] = excludeChats; | 3603 _json["excludeChats"] = excludeChats; |
3629 } | 3604 } |
3630 if (from != null) { | 3605 if (from != null) { |
3631 _json["from"] = from; | 3606 _json["from"] = from; |
3632 } | 3607 } |
3633 if (hasAttachment != null) { | 3608 if (hasAttachment != null) { |
3634 _json["hasAttachment"] = hasAttachment; | 3609 _json["hasAttachment"] = hasAttachment; |
3635 } | 3610 } |
3636 if (negatedQuery != null) { | 3611 if (negatedQuery != null) { |
(...skipping 11 matching lines...) Expand all Loading... |
3648 if (subject != null) { | 3623 if (subject != null) { |
3649 _json["subject"] = subject; | 3624 _json["subject"] = subject; |
3650 } | 3625 } |
3651 if (to != null) { | 3626 if (to != null) { |
3652 _json["to"] = to; | 3627 _json["to"] = to; |
3653 } | 3628 } |
3654 return _json; | 3629 return _json; |
3655 } | 3630 } |
3656 } | 3631 } |
3657 | 3632 |
3658 /** Settings for a forwarding address. */ | 3633 /// Settings for a forwarding address. |
3659 class ForwardingAddress { | 3634 class ForwardingAddress { |
3660 /** An email address to which messages can be forwarded. */ | 3635 /// An email address to which messages can be forwarded. |
3661 core.String forwardingEmail; | 3636 core.String forwardingEmail; |
3662 /** | 3637 |
3663 * Indicates whether this address has been verified and is usable for | 3638 /// Indicates whether this address has been verified and is usable for |
3664 * forwarding. Read-only. | 3639 /// forwarding. Read-only. |
3665 * Possible string values are: | 3640 /// Possible string values are: |
3666 * - "accepted" | 3641 /// - "accepted" |
3667 * - "pending" | 3642 /// - "pending" |
3668 * - "verificationStatusUnspecified" | 3643 /// - "verificationStatusUnspecified" |
3669 */ | |
3670 core.String verificationStatus; | 3644 core.String verificationStatus; |
3671 | 3645 |
3672 ForwardingAddress(); | 3646 ForwardingAddress(); |
3673 | 3647 |
3674 ForwardingAddress.fromJson(core.Map _json) { | 3648 ForwardingAddress.fromJson(core.Map _json) { |
3675 if (_json.containsKey("forwardingEmail")) { | 3649 if (_json.containsKey("forwardingEmail")) { |
3676 forwardingEmail = _json["forwardingEmail"]; | 3650 forwardingEmail = _json["forwardingEmail"]; |
3677 } | 3651 } |
3678 if (_json.containsKey("verificationStatus")) { | 3652 if (_json.containsKey("verificationStatus")) { |
3679 verificationStatus = _json["verificationStatus"]; | 3653 verificationStatus = _json["verificationStatus"]; |
3680 } | 3654 } |
3681 } | 3655 } |
3682 | 3656 |
3683 core.Map<core.String, core.Object> toJson() { | 3657 core.Map<core.String, core.Object> toJson() { |
3684 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3658 final core.Map<core.String, core.Object> _json = |
| 3659 new core.Map<core.String, core.Object>(); |
3685 if (forwardingEmail != null) { | 3660 if (forwardingEmail != null) { |
3686 _json["forwardingEmail"] = forwardingEmail; | 3661 _json["forwardingEmail"] = forwardingEmail; |
3687 } | 3662 } |
3688 if (verificationStatus != null) { | 3663 if (verificationStatus != null) { |
3689 _json["verificationStatus"] = verificationStatus; | 3664 _json["verificationStatus"] = verificationStatus; |
3690 } | 3665 } |
3691 return _json; | 3666 return _json; |
3692 } | 3667 } |
3693 } | 3668 } |
3694 | 3669 |
3695 /** | 3670 /// A record of a change to the user's mailbox. Each history change may affect |
3696 * A record of a change to the user's mailbox. Each history change may affect | 3671 /// multiple messages in multiple ways. |
3697 * multiple messages in multiple ways. | |
3698 */ | |
3699 class History { | 3672 class History { |
3700 /** The mailbox sequence ID. */ | 3673 /// The mailbox sequence ID. |
3701 core.String id; | 3674 core.String id; |
3702 /** Labels added to messages in this history record. */ | 3675 |
| 3676 /// Labels added to messages in this history record. |
3703 core.List<HistoryLabelAdded> labelsAdded; | 3677 core.List<HistoryLabelAdded> labelsAdded; |
3704 /** Labels removed from messages in this history record. */ | 3678 |
| 3679 /// Labels removed from messages in this history record. |
3705 core.List<HistoryLabelRemoved> labelsRemoved; | 3680 core.List<HistoryLabelRemoved> labelsRemoved; |
3706 /** | 3681 |
3707 * List of messages changed in this history record. The fields for specific | 3682 /// List of messages changed in this history record. The fields for specific |
3708 * change types, such as messagesAdded may duplicate messages in this field. | 3683 /// change types, such as messagesAdded may duplicate messages in this field. |
3709 * We recommend using the specific change-type fields instead of this. | 3684 /// We recommend using the specific change-type fields instead of this. |
3710 */ | |
3711 core.List<Message> messages; | 3685 core.List<Message> messages; |
3712 /** Messages added to the mailbox in this history record. */ | 3686 |
| 3687 /// Messages added to the mailbox in this history record. |
3713 core.List<HistoryMessageAdded> messagesAdded; | 3688 core.List<HistoryMessageAdded> messagesAdded; |
3714 /** | 3689 |
3715 * Messages deleted (not Trashed) from the mailbox in this history record. | 3690 /// Messages deleted (not Trashed) from the mailbox in this history record. |
3716 */ | |
3717 core.List<HistoryMessageDeleted> messagesDeleted; | 3691 core.List<HistoryMessageDeleted> messagesDeleted; |
3718 | 3692 |
3719 History(); | 3693 History(); |
3720 | 3694 |
3721 History.fromJson(core.Map _json) { | 3695 History.fromJson(core.Map _json) { |
3722 if (_json.containsKey("id")) { | 3696 if (_json.containsKey("id")) { |
3723 id = _json["id"]; | 3697 id = _json["id"]; |
3724 } | 3698 } |
3725 if (_json.containsKey("labelsAdded")) { | 3699 if (_json.containsKey("labelsAdded")) { |
3726 labelsAdded = _json["labelsAdded"].map((value) => new HistoryLabelAdded.fr
omJson(value)).toList(); | 3700 labelsAdded = _json["labelsAdded"] |
| 3701 .map((value) => new HistoryLabelAdded.fromJson(value)) |
| 3702 .toList(); |
3727 } | 3703 } |
3728 if (_json.containsKey("labelsRemoved")) { | 3704 if (_json.containsKey("labelsRemoved")) { |
3729 labelsRemoved = _json["labelsRemoved"].map((value) => new HistoryLabelRemo
ved.fromJson(value)).toList(); | 3705 labelsRemoved = _json["labelsRemoved"] |
| 3706 .map((value) => new HistoryLabelRemoved.fromJson(value)) |
| 3707 .toList(); |
3730 } | 3708 } |
3731 if (_json.containsKey("messages")) { | 3709 if (_json.containsKey("messages")) { |
3732 messages = _json["messages"].map((value) => new Message.fromJson(value)).t
oList(); | 3710 messages = _json["messages"] |
| 3711 .map((value) => new Message.fromJson(value)) |
| 3712 .toList(); |
3733 } | 3713 } |
3734 if (_json.containsKey("messagesAdded")) { | 3714 if (_json.containsKey("messagesAdded")) { |
3735 messagesAdded = _json["messagesAdded"].map((value) => new HistoryMessageAd
ded.fromJson(value)).toList(); | 3715 messagesAdded = _json["messagesAdded"] |
| 3716 .map((value) => new HistoryMessageAdded.fromJson(value)) |
| 3717 .toList(); |
3736 } | 3718 } |
3737 if (_json.containsKey("messagesDeleted")) { | 3719 if (_json.containsKey("messagesDeleted")) { |
3738 messagesDeleted = _json["messagesDeleted"].map((value) => new HistoryMessa
geDeleted.fromJson(value)).toList(); | 3720 messagesDeleted = _json["messagesDeleted"] |
| 3721 .map((value) => new HistoryMessageDeleted.fromJson(value)) |
| 3722 .toList(); |
3739 } | 3723 } |
3740 } | 3724 } |
3741 | 3725 |
3742 core.Map<core.String, core.Object> toJson() { | 3726 core.Map<core.String, core.Object> toJson() { |
3743 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3727 final core.Map<core.String, core.Object> _json = |
| 3728 new core.Map<core.String, core.Object>(); |
3744 if (id != null) { | 3729 if (id != null) { |
3745 _json["id"] = id; | 3730 _json["id"] = id; |
3746 } | 3731 } |
3747 if (labelsAdded != null) { | 3732 if (labelsAdded != null) { |
3748 _json["labelsAdded"] = labelsAdded.map((value) => (value).toJson()).toList
(); | 3733 _json["labelsAdded"] = |
| 3734 labelsAdded.map((value) => (value).toJson()).toList(); |
3749 } | 3735 } |
3750 if (labelsRemoved != null) { | 3736 if (labelsRemoved != null) { |
3751 _json["labelsRemoved"] = labelsRemoved.map((value) => (value).toJson()).to
List(); | 3737 _json["labelsRemoved"] = |
| 3738 labelsRemoved.map((value) => (value).toJson()).toList(); |
3752 } | 3739 } |
3753 if (messages != null) { | 3740 if (messages != null) { |
3754 _json["messages"] = messages.map((value) => (value).toJson()).toList(); | 3741 _json["messages"] = messages.map((value) => (value).toJson()).toList(); |
3755 } | 3742 } |
3756 if (messagesAdded != null) { | 3743 if (messagesAdded != null) { |
3757 _json["messagesAdded"] = messagesAdded.map((value) => (value).toJson()).to
List(); | 3744 _json["messagesAdded"] = |
| 3745 messagesAdded.map((value) => (value).toJson()).toList(); |
3758 } | 3746 } |
3759 if (messagesDeleted != null) { | 3747 if (messagesDeleted != null) { |
3760 _json["messagesDeleted"] = messagesDeleted.map((value) => (value).toJson()
).toList(); | 3748 _json["messagesDeleted"] = |
| 3749 messagesDeleted.map((value) => (value).toJson()).toList(); |
3761 } | 3750 } |
3762 return _json; | 3751 return _json; |
3763 } | 3752 } |
3764 } | 3753 } |
3765 | 3754 |
3766 class HistoryLabelAdded { | 3755 class HistoryLabelAdded { |
3767 /** Label IDs added to the message. */ | 3756 /// Label IDs added to the message. |
3768 core.List<core.String> labelIds; | 3757 core.List<core.String> labelIds; |
3769 Message message; | 3758 Message message; |
3770 | 3759 |
3771 HistoryLabelAdded(); | 3760 HistoryLabelAdded(); |
3772 | 3761 |
3773 HistoryLabelAdded.fromJson(core.Map _json) { | 3762 HistoryLabelAdded.fromJson(core.Map _json) { |
3774 if (_json.containsKey("labelIds")) { | 3763 if (_json.containsKey("labelIds")) { |
3775 labelIds = _json["labelIds"]; | 3764 labelIds = _json["labelIds"]; |
3776 } | 3765 } |
3777 if (_json.containsKey("message")) { | 3766 if (_json.containsKey("message")) { |
3778 message = new Message.fromJson(_json["message"]); | 3767 message = new Message.fromJson(_json["message"]); |
3779 } | 3768 } |
3780 } | 3769 } |
3781 | 3770 |
3782 core.Map<core.String, core.Object> toJson() { | 3771 core.Map<core.String, core.Object> toJson() { |
3783 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3772 final core.Map<core.String, core.Object> _json = |
| 3773 new core.Map<core.String, core.Object>(); |
3784 if (labelIds != null) { | 3774 if (labelIds != null) { |
3785 _json["labelIds"] = labelIds; | 3775 _json["labelIds"] = labelIds; |
3786 } | 3776 } |
3787 if (message != null) { | 3777 if (message != null) { |
3788 _json["message"] = (message).toJson(); | 3778 _json["message"] = (message).toJson(); |
3789 } | 3779 } |
3790 return _json; | 3780 return _json; |
3791 } | 3781 } |
3792 } | 3782 } |
3793 | 3783 |
3794 class HistoryLabelRemoved { | 3784 class HistoryLabelRemoved { |
3795 /** Label IDs removed from the message. */ | 3785 /// Label IDs removed from the message. |
3796 core.List<core.String> labelIds; | 3786 core.List<core.String> labelIds; |
3797 Message message; | 3787 Message message; |
3798 | 3788 |
3799 HistoryLabelRemoved(); | 3789 HistoryLabelRemoved(); |
3800 | 3790 |
3801 HistoryLabelRemoved.fromJson(core.Map _json) { | 3791 HistoryLabelRemoved.fromJson(core.Map _json) { |
3802 if (_json.containsKey("labelIds")) { | 3792 if (_json.containsKey("labelIds")) { |
3803 labelIds = _json["labelIds"]; | 3793 labelIds = _json["labelIds"]; |
3804 } | 3794 } |
3805 if (_json.containsKey("message")) { | 3795 if (_json.containsKey("message")) { |
3806 message = new Message.fromJson(_json["message"]); | 3796 message = new Message.fromJson(_json["message"]); |
3807 } | 3797 } |
3808 } | 3798 } |
3809 | 3799 |
3810 core.Map<core.String, core.Object> toJson() { | 3800 core.Map<core.String, core.Object> toJson() { |
3811 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3801 final core.Map<core.String, core.Object> _json = |
| 3802 new core.Map<core.String, core.Object>(); |
3812 if (labelIds != null) { | 3803 if (labelIds != null) { |
3813 _json["labelIds"] = labelIds; | 3804 _json["labelIds"] = labelIds; |
3814 } | 3805 } |
3815 if (message != null) { | 3806 if (message != null) { |
3816 _json["message"] = (message).toJson(); | 3807 _json["message"] = (message).toJson(); |
3817 } | 3808 } |
3818 return _json; | 3809 return _json; |
3819 } | 3810 } |
3820 } | 3811 } |
3821 | 3812 |
3822 class HistoryMessageAdded { | 3813 class HistoryMessageAdded { |
3823 Message message; | 3814 Message message; |
3824 | 3815 |
3825 HistoryMessageAdded(); | 3816 HistoryMessageAdded(); |
3826 | 3817 |
3827 HistoryMessageAdded.fromJson(core.Map _json) { | 3818 HistoryMessageAdded.fromJson(core.Map _json) { |
3828 if (_json.containsKey("message")) { | 3819 if (_json.containsKey("message")) { |
3829 message = new Message.fromJson(_json["message"]); | 3820 message = new Message.fromJson(_json["message"]); |
3830 } | 3821 } |
3831 } | 3822 } |
3832 | 3823 |
3833 core.Map<core.String, core.Object> toJson() { | 3824 core.Map<core.String, core.Object> toJson() { |
3834 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3825 final core.Map<core.String, core.Object> _json = |
| 3826 new core.Map<core.String, core.Object>(); |
3835 if (message != null) { | 3827 if (message != null) { |
3836 _json["message"] = (message).toJson(); | 3828 _json["message"] = (message).toJson(); |
3837 } | 3829 } |
3838 return _json; | 3830 return _json; |
3839 } | 3831 } |
3840 } | 3832 } |
3841 | 3833 |
3842 class HistoryMessageDeleted { | 3834 class HistoryMessageDeleted { |
3843 Message message; | 3835 Message message; |
3844 | 3836 |
3845 HistoryMessageDeleted(); | 3837 HistoryMessageDeleted(); |
3846 | 3838 |
3847 HistoryMessageDeleted.fromJson(core.Map _json) { | 3839 HistoryMessageDeleted.fromJson(core.Map _json) { |
3848 if (_json.containsKey("message")) { | 3840 if (_json.containsKey("message")) { |
3849 message = new Message.fromJson(_json["message"]); | 3841 message = new Message.fromJson(_json["message"]); |
3850 } | 3842 } |
3851 } | 3843 } |
3852 | 3844 |
3853 core.Map<core.String, core.Object> toJson() { | 3845 core.Map<core.String, core.Object> toJson() { |
3854 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3846 final core.Map<core.String, core.Object> _json = |
| 3847 new core.Map<core.String, core.Object>(); |
3855 if (message != null) { | 3848 if (message != null) { |
3856 _json["message"] = (message).toJson(); | 3849 _json["message"] = (message).toJson(); |
3857 } | 3850 } |
3858 return _json; | 3851 return _json; |
3859 } | 3852 } |
3860 } | 3853 } |
3861 | 3854 |
3862 /** IMAP settings for an account. */ | 3855 /// IMAP settings for an account. |
3863 class ImapSettings { | 3856 class ImapSettings { |
3864 /** | 3857 /// If this value is true, Gmail will immediately expunge a message when it |
3865 * If this value is true, Gmail will immediately expunge a message when it is | 3858 /// is marked as deleted in IMAP. Otherwise, Gmail will wait for an update |
3866 * marked as deleted in IMAP. Otherwise, Gmail will wait for an update from | 3859 /// from the client before expunging messages marked as deleted. |
3867 * the client before expunging messages marked as deleted. | |
3868 */ | |
3869 core.bool autoExpunge; | 3860 core.bool autoExpunge; |
3870 /** Whether IMAP is enabled for the account. */ | 3861 |
| 3862 /// Whether IMAP is enabled for the account. |
3871 core.bool enabled; | 3863 core.bool enabled; |
3872 /** | 3864 |
3873 * The action that will be executed on a message when it is marked as deleted | 3865 /// The action that will be executed on a message when it is marked as |
3874 * and expunged from the last visible IMAP folder. | 3866 /// deleted and expunged from the last visible IMAP folder. |
3875 * Possible string values are: | 3867 /// Possible string values are: |
3876 * - "archive" | 3868 /// - "archive" |
3877 * - "deleteForever" | 3869 /// - "deleteForever" |
3878 * - "expungeBehaviorUnspecified" | 3870 /// - "expungeBehaviorUnspecified" |
3879 * - "trash" | 3871 /// - "trash" |
3880 */ | |
3881 core.String expungeBehavior; | 3872 core.String expungeBehavior; |
3882 /** | 3873 |
3883 * An optional limit on the number of messages that an IMAP folder may | 3874 /// An optional limit on the number of messages that an IMAP folder may |
3884 * contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is | 3875 /// contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero |
3885 * interpreted to mean that there is no limit. | 3876 /// is interpreted to mean that there is no limit. |
3886 */ | |
3887 core.int maxFolderSize; | 3877 core.int maxFolderSize; |
3888 | 3878 |
3889 ImapSettings(); | 3879 ImapSettings(); |
3890 | 3880 |
3891 ImapSettings.fromJson(core.Map _json) { | 3881 ImapSettings.fromJson(core.Map _json) { |
3892 if (_json.containsKey("autoExpunge")) { | 3882 if (_json.containsKey("autoExpunge")) { |
3893 autoExpunge = _json["autoExpunge"]; | 3883 autoExpunge = _json["autoExpunge"]; |
3894 } | 3884 } |
3895 if (_json.containsKey("enabled")) { | 3885 if (_json.containsKey("enabled")) { |
3896 enabled = _json["enabled"]; | 3886 enabled = _json["enabled"]; |
3897 } | 3887 } |
3898 if (_json.containsKey("expungeBehavior")) { | 3888 if (_json.containsKey("expungeBehavior")) { |
3899 expungeBehavior = _json["expungeBehavior"]; | 3889 expungeBehavior = _json["expungeBehavior"]; |
3900 } | 3890 } |
3901 if (_json.containsKey("maxFolderSize")) { | 3891 if (_json.containsKey("maxFolderSize")) { |
3902 maxFolderSize = _json["maxFolderSize"]; | 3892 maxFolderSize = _json["maxFolderSize"]; |
3903 } | 3893 } |
3904 } | 3894 } |
3905 | 3895 |
3906 core.Map<core.String, core.Object> toJson() { | 3896 core.Map<core.String, core.Object> toJson() { |
3907 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3897 final core.Map<core.String, core.Object> _json = |
| 3898 new core.Map<core.String, core.Object>(); |
3908 if (autoExpunge != null) { | 3899 if (autoExpunge != null) { |
3909 _json["autoExpunge"] = autoExpunge; | 3900 _json["autoExpunge"] = autoExpunge; |
3910 } | 3901 } |
3911 if (enabled != null) { | 3902 if (enabled != null) { |
3912 _json["enabled"] = enabled; | 3903 _json["enabled"] = enabled; |
3913 } | 3904 } |
3914 if (expungeBehavior != null) { | 3905 if (expungeBehavior != null) { |
3915 _json["expungeBehavior"] = expungeBehavior; | 3906 _json["expungeBehavior"] = expungeBehavior; |
3916 } | 3907 } |
3917 if (maxFolderSize != null) { | 3908 if (maxFolderSize != null) { |
3918 _json["maxFolderSize"] = maxFolderSize; | 3909 _json["maxFolderSize"] = maxFolderSize; |
3919 } | 3910 } |
3920 return _json; | 3911 return _json; |
3921 } | 3912 } |
3922 } | 3913 } |
3923 | 3914 |
3924 /** | 3915 /// Labels are used to categorize messages and threads within the user's |
3925 * Labels are used to categorize messages and threads within the user's mailbox. | 3916 /// mailbox. |
3926 */ | |
3927 class Label { | 3917 class Label { |
3928 /** The immutable ID of the label. */ | 3918 /// Color to assign to the label. This field is hidden behind an API server |
| 3919 /// mendel experiment and only available for user-defined labels. Will be |
| 3920 /// unset if the label doesn't have a color configured. |
| 3921 LabelColor color; |
| 3922 |
| 3923 /// The immutable ID of the label. |
3929 core.String id; | 3924 core.String id; |
3930 /** | 3925 |
3931 * The visibility of the label in the label list in the Gmail web interface. | 3926 /// The visibility of the label in the label list in the Gmail web interface. |
3932 * Possible string values are: | 3927 /// Possible string values are: |
3933 * - "labelHide" | 3928 /// - "labelHide" |
3934 * - "labelShow" | 3929 /// - "labelShow" |
3935 * - "labelShowIfUnread" | 3930 /// - "labelShowIfUnread" |
3936 */ | |
3937 core.String labelListVisibility; | 3931 core.String labelListVisibility; |
3938 /** | 3932 |
3939 * The visibility of the label in the message list in the Gmail web interface. | 3933 /// The visibility of the label in the message list in the Gmail web |
3940 * Possible string values are: | 3934 /// interface. |
3941 * - "hide" | 3935 /// Possible string values are: |
3942 * - "show" | 3936 /// - "hide" |
3943 */ | 3937 /// - "show" |
3944 core.String messageListVisibility; | 3938 core.String messageListVisibility; |
3945 /** The total number of messages with the label. */ | 3939 |
| 3940 /// The total number of messages with the label. |
3946 core.int messagesTotal; | 3941 core.int messagesTotal; |
3947 /** The number of unread messages with the label. */ | 3942 |
| 3943 /// The number of unread messages with the label. |
3948 core.int messagesUnread; | 3944 core.int messagesUnread; |
3949 /** The display name of the label. */ | 3945 |
| 3946 /// The display name of the label. |
3950 core.String name; | 3947 core.String name; |
3951 /** The total number of threads with the label. */ | 3948 |
| 3949 /// The total number of threads with the label. |
3952 core.int threadsTotal; | 3950 core.int threadsTotal; |
3953 /** The number of unread threads with the label. */ | 3951 |
| 3952 /// The number of unread threads with the label. |
3954 core.int threadsUnread; | 3953 core.int threadsUnread; |
3955 /** | 3954 |
3956 * The owner type for the label. User labels are created by the user and can | 3955 /// The owner type for the label. User labels are created by the user and can |
3957 * be modified and deleted by the user and can be applied to any message or | 3956 /// be modified and deleted by the user and can be applied to any message or |
3958 * thread. System labels are internally created and cannot be added, modified, | 3957 /// thread. System labels are internally created and cannot be added, |
3959 * or deleted. System labels may be able to be applied to or removed from | 3958 /// modified, or deleted. System labels may be able to be applied to or |
3960 * messages and threads under some circumstances but this is not guaranteed. | 3959 /// removed from messages and threads under some circumstances but this is |
3961 * For example, users can apply and remove the INBOX and UNREAD labels from | 3960 /// not guaranteed. For example, users can apply and remove the INBOX and |
3962 * messages and threads, but cannot apply or remove the DRAFTS or SENT labels | 3961 /// UNREAD labels from messages and threads, but cannot apply or remove the |
3963 * from messages or threads. | 3962 /// DRAFTS or SENT labels from messages or threads. |
3964 * Possible string values are: | 3963 /// Possible string values are: |
3965 * - "system" | 3964 /// - "system" |
3966 * - "user" | 3965 /// - "user" |
3967 */ | |
3968 core.String type; | 3966 core.String type; |
3969 | 3967 |
3970 Label(); | 3968 Label(); |
3971 | 3969 |
3972 Label.fromJson(core.Map _json) { | 3970 Label.fromJson(core.Map _json) { |
| 3971 if (_json.containsKey("color")) { |
| 3972 color = new LabelColor.fromJson(_json["color"]); |
| 3973 } |
3973 if (_json.containsKey("id")) { | 3974 if (_json.containsKey("id")) { |
3974 id = _json["id"]; | 3975 id = _json["id"]; |
3975 } | 3976 } |
3976 if (_json.containsKey("labelListVisibility")) { | 3977 if (_json.containsKey("labelListVisibility")) { |
3977 labelListVisibility = _json["labelListVisibility"]; | 3978 labelListVisibility = _json["labelListVisibility"]; |
3978 } | 3979 } |
3979 if (_json.containsKey("messageListVisibility")) { | 3980 if (_json.containsKey("messageListVisibility")) { |
3980 messageListVisibility = _json["messageListVisibility"]; | 3981 messageListVisibility = _json["messageListVisibility"]; |
3981 } | 3982 } |
3982 if (_json.containsKey("messagesTotal")) { | 3983 if (_json.containsKey("messagesTotal")) { |
(...skipping 10 matching lines...) Expand all Loading... |
3993 } | 3994 } |
3994 if (_json.containsKey("threadsUnread")) { | 3995 if (_json.containsKey("threadsUnread")) { |
3995 threadsUnread = _json["threadsUnread"]; | 3996 threadsUnread = _json["threadsUnread"]; |
3996 } | 3997 } |
3997 if (_json.containsKey("type")) { | 3998 if (_json.containsKey("type")) { |
3998 type = _json["type"]; | 3999 type = _json["type"]; |
3999 } | 4000 } |
4000 } | 4001 } |
4001 | 4002 |
4002 core.Map<core.String, core.Object> toJson() { | 4003 core.Map<core.String, core.Object> toJson() { |
4003 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4004 final core.Map<core.String, core.Object> _json = |
| 4005 new core.Map<core.String, core.Object>(); |
| 4006 if (color != null) { |
| 4007 _json["color"] = (color).toJson(); |
| 4008 } |
4004 if (id != null) { | 4009 if (id != null) { |
4005 _json["id"] = id; | 4010 _json["id"] = id; |
4006 } | 4011 } |
4007 if (labelListVisibility != null) { | 4012 if (labelListVisibility != null) { |
4008 _json["labelListVisibility"] = labelListVisibility; | 4013 _json["labelListVisibility"] = labelListVisibility; |
4009 } | 4014 } |
4010 if (messageListVisibility != null) { | 4015 if (messageListVisibility != null) { |
4011 _json["messageListVisibility"] = messageListVisibility; | 4016 _json["messageListVisibility"] = messageListVisibility; |
4012 } | 4017 } |
4013 if (messagesTotal != null) { | 4018 if (messagesTotal != null) { |
(...skipping 11 matching lines...) Expand all Loading... |
4025 if (threadsUnread != null) { | 4030 if (threadsUnread != null) { |
4026 _json["threadsUnread"] = threadsUnread; | 4031 _json["threadsUnread"] = threadsUnread; |
4027 } | 4032 } |
4028 if (type != null) { | 4033 if (type != null) { |
4029 _json["type"] = type; | 4034 _json["type"] = type; |
4030 } | 4035 } |
4031 return _json; | 4036 return _json; |
4032 } | 4037 } |
4033 } | 4038 } |
4034 | 4039 |
| 4040 class LabelColor { |
| 4041 /// Background color represented as hex string #RRGGBB (ex #000000). Only a |
| 4042 /// restricted predefined set of color values are allowed. See |
| 4043 /// (go/gmail-api-label-colors). |
| 4044 core.String backgroundColor; |
| 4045 |
| 4046 /// Text color represented as hex string #RRGGBB (ex #000000). Only a |
| 4047 /// restricted predefined set of color values are allowed. See |
| 4048 /// (go/gmail-api-label-colors). |
| 4049 core.String textColor; |
| 4050 |
| 4051 LabelColor(); |
| 4052 |
| 4053 LabelColor.fromJson(core.Map _json) { |
| 4054 if (_json.containsKey("backgroundColor")) { |
| 4055 backgroundColor = _json["backgroundColor"]; |
| 4056 } |
| 4057 if (_json.containsKey("textColor")) { |
| 4058 textColor = _json["textColor"]; |
| 4059 } |
| 4060 } |
| 4061 |
| 4062 core.Map<core.String, core.Object> toJson() { |
| 4063 final core.Map<core.String, core.Object> _json = |
| 4064 new core.Map<core.String, core.Object>(); |
| 4065 if (backgroundColor != null) { |
| 4066 _json["backgroundColor"] = backgroundColor; |
| 4067 } |
| 4068 if (textColor != null) { |
| 4069 _json["textColor"] = textColor; |
| 4070 } |
| 4071 return _json; |
| 4072 } |
| 4073 } |
| 4074 |
4035 class ListDraftsResponse { | 4075 class ListDraftsResponse { |
4036 /** List of drafts. */ | 4076 /// List of drafts. |
4037 core.List<Draft> drafts; | 4077 core.List<Draft> drafts; |
4038 /** Token to retrieve the next page of results in the list. */ | 4078 |
| 4079 /// Token to retrieve the next page of results in the list. |
4039 core.String nextPageToken; | 4080 core.String nextPageToken; |
4040 /** Estimated total number of results. */ | 4081 |
| 4082 /// Estimated total number of results. |
4041 core.int resultSizeEstimate; | 4083 core.int resultSizeEstimate; |
4042 | 4084 |
4043 ListDraftsResponse(); | 4085 ListDraftsResponse(); |
4044 | 4086 |
4045 ListDraftsResponse.fromJson(core.Map _json) { | 4087 ListDraftsResponse.fromJson(core.Map _json) { |
4046 if (_json.containsKey("drafts")) { | 4088 if (_json.containsKey("drafts")) { |
4047 drafts = _json["drafts"].map((value) => new Draft.fromJson(value)).toList(
); | 4089 drafts = |
| 4090 _json["drafts"].map((value) => new Draft.fromJson(value)).toList(); |
4048 } | 4091 } |
4049 if (_json.containsKey("nextPageToken")) { | 4092 if (_json.containsKey("nextPageToken")) { |
4050 nextPageToken = _json["nextPageToken"]; | 4093 nextPageToken = _json["nextPageToken"]; |
4051 } | 4094 } |
4052 if (_json.containsKey("resultSizeEstimate")) { | 4095 if (_json.containsKey("resultSizeEstimate")) { |
4053 resultSizeEstimate = _json["resultSizeEstimate"]; | 4096 resultSizeEstimate = _json["resultSizeEstimate"]; |
4054 } | 4097 } |
4055 } | 4098 } |
4056 | 4099 |
4057 core.Map<core.String, core.Object> toJson() { | 4100 core.Map<core.String, core.Object> toJson() { |
4058 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4101 final core.Map<core.String, core.Object> _json = |
| 4102 new core.Map<core.String, core.Object>(); |
4059 if (drafts != null) { | 4103 if (drafts != null) { |
4060 _json["drafts"] = drafts.map((value) => (value).toJson()).toList(); | 4104 _json["drafts"] = drafts.map((value) => (value).toJson()).toList(); |
4061 } | 4105 } |
4062 if (nextPageToken != null) { | 4106 if (nextPageToken != null) { |
4063 _json["nextPageToken"] = nextPageToken; | 4107 _json["nextPageToken"] = nextPageToken; |
4064 } | 4108 } |
4065 if (resultSizeEstimate != null) { | 4109 if (resultSizeEstimate != null) { |
4066 _json["resultSizeEstimate"] = resultSizeEstimate; | 4110 _json["resultSizeEstimate"] = resultSizeEstimate; |
4067 } | 4111 } |
4068 return _json; | 4112 return _json; |
4069 } | 4113 } |
4070 } | 4114 } |
4071 | 4115 |
4072 /** Response for the ListFilters method. */ | 4116 /// Response for the ListFilters method. |
4073 class ListFiltersResponse { | 4117 class ListFiltersResponse { |
4074 /** List of a user's filters. */ | 4118 /// List of a user's filters. |
4075 core.List<Filter> filter; | 4119 core.List<Filter> filter; |
4076 | 4120 |
4077 ListFiltersResponse(); | 4121 ListFiltersResponse(); |
4078 | 4122 |
4079 ListFiltersResponse.fromJson(core.Map _json) { | 4123 ListFiltersResponse.fromJson(core.Map _json) { |
4080 if (_json.containsKey("filter")) { | 4124 if (_json.containsKey("filter")) { |
4081 filter = _json["filter"].map((value) => new Filter.fromJson(value)).toList
(); | 4125 filter = |
| 4126 _json["filter"].map((value) => new Filter.fromJson(value)).toList(); |
4082 } | 4127 } |
4083 } | 4128 } |
4084 | 4129 |
4085 core.Map<core.String, core.Object> toJson() { | 4130 core.Map<core.String, core.Object> toJson() { |
4086 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4131 final core.Map<core.String, core.Object> _json = |
| 4132 new core.Map<core.String, core.Object>(); |
4087 if (filter != null) { | 4133 if (filter != null) { |
4088 _json["filter"] = filter.map((value) => (value).toJson()).toList(); | 4134 _json["filter"] = filter.map((value) => (value).toJson()).toList(); |
4089 } | 4135 } |
4090 return _json; | 4136 return _json; |
4091 } | 4137 } |
4092 } | 4138 } |
4093 | 4139 |
4094 /** Response for the ListForwardingAddresses method. */ | 4140 /// Response for the ListForwardingAddresses method. |
4095 class ListForwardingAddressesResponse { | 4141 class ListForwardingAddressesResponse { |
4096 /** List of addresses that may be used for forwarding. */ | 4142 /// List of addresses that may be used for forwarding. |
4097 core.List<ForwardingAddress> forwardingAddresses; | 4143 core.List<ForwardingAddress> forwardingAddresses; |
4098 | 4144 |
4099 ListForwardingAddressesResponse(); | 4145 ListForwardingAddressesResponse(); |
4100 | 4146 |
4101 ListForwardingAddressesResponse.fromJson(core.Map _json) { | 4147 ListForwardingAddressesResponse.fromJson(core.Map _json) { |
4102 if (_json.containsKey("forwardingAddresses")) { | 4148 if (_json.containsKey("forwardingAddresses")) { |
4103 forwardingAddresses = _json["forwardingAddresses"].map((value) => new Forw
ardingAddress.fromJson(value)).toList(); | 4149 forwardingAddresses = _json["forwardingAddresses"] |
| 4150 .map((value) => new ForwardingAddress.fromJson(value)) |
| 4151 .toList(); |
4104 } | 4152 } |
4105 } | 4153 } |
4106 | 4154 |
4107 core.Map<core.String, core.Object> toJson() { | 4155 core.Map<core.String, core.Object> toJson() { |
4108 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4156 final core.Map<core.String, core.Object> _json = |
| 4157 new core.Map<core.String, core.Object>(); |
4109 if (forwardingAddresses != null) { | 4158 if (forwardingAddresses != null) { |
4110 _json["forwardingAddresses"] = forwardingAddresses.map((value) => (value).
toJson()).toList(); | 4159 _json["forwardingAddresses"] = |
| 4160 forwardingAddresses.map((value) => (value).toJson()).toList(); |
4111 } | 4161 } |
4112 return _json; | 4162 return _json; |
4113 } | 4163 } |
4114 } | 4164 } |
4115 | 4165 |
4116 class ListHistoryResponse { | 4166 class ListHistoryResponse { |
4117 /** | 4167 /// List of history records. Any messages contained in the response will |
4118 * List of history records. Any messages contained in the response will | 4168 /// typically only have id and threadId fields populated. |
4119 * typically only have id and threadId fields populated. | |
4120 */ | |
4121 core.List<History> history; | 4169 core.List<History> history; |
4122 /** The ID of the mailbox's current history record. */ | 4170 |
| 4171 /// The ID of the mailbox's current history record. |
4123 core.String historyId; | 4172 core.String historyId; |
4124 /** Page token to retrieve the next page of results in the list. */ | 4173 |
| 4174 /// Page token to retrieve the next page of results in the list. |
4125 core.String nextPageToken; | 4175 core.String nextPageToken; |
4126 | 4176 |
4127 ListHistoryResponse(); | 4177 ListHistoryResponse(); |
4128 | 4178 |
4129 ListHistoryResponse.fromJson(core.Map _json) { | 4179 ListHistoryResponse.fromJson(core.Map _json) { |
4130 if (_json.containsKey("history")) { | 4180 if (_json.containsKey("history")) { |
4131 history = _json["history"].map((value) => new History.fromJson(value)).toL
ist(); | 4181 history = |
| 4182 _json["history"].map((value) => new History.fromJson(value)).toList(); |
4132 } | 4183 } |
4133 if (_json.containsKey("historyId")) { | 4184 if (_json.containsKey("historyId")) { |
4134 historyId = _json["historyId"]; | 4185 historyId = _json["historyId"]; |
4135 } | 4186 } |
4136 if (_json.containsKey("nextPageToken")) { | 4187 if (_json.containsKey("nextPageToken")) { |
4137 nextPageToken = _json["nextPageToken"]; | 4188 nextPageToken = _json["nextPageToken"]; |
4138 } | 4189 } |
4139 } | 4190 } |
4140 | 4191 |
4141 core.Map<core.String, core.Object> toJson() { | 4192 core.Map<core.String, core.Object> toJson() { |
4142 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4193 final core.Map<core.String, core.Object> _json = |
| 4194 new core.Map<core.String, core.Object>(); |
4143 if (history != null) { | 4195 if (history != null) { |
4144 _json["history"] = history.map((value) => (value).toJson()).toList(); | 4196 _json["history"] = history.map((value) => (value).toJson()).toList(); |
4145 } | 4197 } |
4146 if (historyId != null) { | 4198 if (historyId != null) { |
4147 _json["historyId"] = historyId; | 4199 _json["historyId"] = historyId; |
4148 } | 4200 } |
4149 if (nextPageToken != null) { | 4201 if (nextPageToken != null) { |
4150 _json["nextPageToken"] = nextPageToken; | 4202 _json["nextPageToken"] = nextPageToken; |
4151 } | 4203 } |
4152 return _json; | 4204 return _json; |
4153 } | 4205 } |
4154 } | 4206 } |
4155 | 4207 |
4156 class ListLabelsResponse { | 4208 class ListLabelsResponse { |
4157 /** List of labels. */ | 4209 /// List of labels. |
4158 core.List<Label> labels; | 4210 core.List<Label> labels; |
4159 | 4211 |
4160 ListLabelsResponse(); | 4212 ListLabelsResponse(); |
4161 | 4213 |
4162 ListLabelsResponse.fromJson(core.Map _json) { | 4214 ListLabelsResponse.fromJson(core.Map _json) { |
4163 if (_json.containsKey("labels")) { | 4215 if (_json.containsKey("labels")) { |
4164 labels = _json["labels"].map((value) => new Label.fromJson(value)).toList(
); | 4216 labels = |
| 4217 _json["labels"].map((value) => new Label.fromJson(value)).toList(); |
4165 } | 4218 } |
4166 } | 4219 } |
4167 | 4220 |
4168 core.Map<core.String, core.Object> toJson() { | 4221 core.Map<core.String, core.Object> toJson() { |
4169 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4222 final core.Map<core.String, core.Object> _json = |
| 4223 new core.Map<core.String, core.Object>(); |
4170 if (labels != null) { | 4224 if (labels != null) { |
4171 _json["labels"] = labels.map((value) => (value).toJson()).toList(); | 4225 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
4172 } | 4226 } |
4173 return _json; | 4227 return _json; |
4174 } | 4228 } |
4175 } | 4229 } |
4176 | 4230 |
4177 class ListMessagesResponse { | 4231 class ListMessagesResponse { |
4178 /** List of messages. */ | 4232 /// List of messages. |
4179 core.List<Message> messages; | 4233 core.List<Message> messages; |
4180 /** Token to retrieve the next page of results in the list. */ | 4234 |
| 4235 /// Token to retrieve the next page of results in the list. |
4181 core.String nextPageToken; | 4236 core.String nextPageToken; |
4182 /** Estimated total number of results. */ | 4237 |
| 4238 /// Estimated total number of results. |
4183 core.int resultSizeEstimate; | 4239 core.int resultSizeEstimate; |
4184 | 4240 |
4185 ListMessagesResponse(); | 4241 ListMessagesResponse(); |
4186 | 4242 |
4187 ListMessagesResponse.fromJson(core.Map _json) { | 4243 ListMessagesResponse.fromJson(core.Map _json) { |
4188 if (_json.containsKey("messages")) { | 4244 if (_json.containsKey("messages")) { |
4189 messages = _json["messages"].map((value) => new Message.fromJson(value)).t
oList(); | 4245 messages = _json["messages"] |
| 4246 .map((value) => new Message.fromJson(value)) |
| 4247 .toList(); |
4190 } | 4248 } |
4191 if (_json.containsKey("nextPageToken")) { | 4249 if (_json.containsKey("nextPageToken")) { |
4192 nextPageToken = _json["nextPageToken"]; | 4250 nextPageToken = _json["nextPageToken"]; |
4193 } | 4251 } |
4194 if (_json.containsKey("resultSizeEstimate")) { | 4252 if (_json.containsKey("resultSizeEstimate")) { |
4195 resultSizeEstimate = _json["resultSizeEstimate"]; | 4253 resultSizeEstimate = _json["resultSizeEstimate"]; |
4196 } | 4254 } |
4197 } | 4255 } |
4198 | 4256 |
4199 core.Map<core.String, core.Object> toJson() { | 4257 core.Map<core.String, core.Object> toJson() { |
4200 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4258 final core.Map<core.String, core.Object> _json = |
| 4259 new core.Map<core.String, core.Object>(); |
4201 if (messages != null) { | 4260 if (messages != null) { |
4202 _json["messages"] = messages.map((value) => (value).toJson()).toList(); | 4261 _json["messages"] = messages.map((value) => (value).toJson()).toList(); |
4203 } | 4262 } |
4204 if (nextPageToken != null) { | 4263 if (nextPageToken != null) { |
4205 _json["nextPageToken"] = nextPageToken; | 4264 _json["nextPageToken"] = nextPageToken; |
4206 } | 4265 } |
4207 if (resultSizeEstimate != null) { | 4266 if (resultSizeEstimate != null) { |
4208 _json["resultSizeEstimate"] = resultSizeEstimate; | 4267 _json["resultSizeEstimate"] = resultSizeEstimate; |
4209 } | 4268 } |
4210 return _json; | 4269 return _json; |
4211 } | 4270 } |
4212 } | 4271 } |
4213 | 4272 |
4214 /** Response for the ListSendAs method. */ | 4273 /// Response for the ListSendAs method. |
4215 class ListSendAsResponse { | 4274 class ListSendAsResponse { |
4216 /** List of send-as aliases. */ | 4275 /// List of send-as aliases. |
4217 core.List<SendAs> sendAs; | 4276 core.List<SendAs> sendAs; |
4218 | 4277 |
4219 ListSendAsResponse(); | 4278 ListSendAsResponse(); |
4220 | 4279 |
4221 ListSendAsResponse.fromJson(core.Map _json) { | 4280 ListSendAsResponse.fromJson(core.Map _json) { |
4222 if (_json.containsKey("sendAs")) { | 4281 if (_json.containsKey("sendAs")) { |
4223 sendAs = _json["sendAs"].map((value) => new SendAs.fromJson(value)).toList
(); | 4282 sendAs = |
| 4283 _json["sendAs"].map((value) => new SendAs.fromJson(value)).toList(); |
4224 } | 4284 } |
4225 } | 4285 } |
4226 | 4286 |
4227 core.Map<core.String, core.Object> toJson() { | 4287 core.Map<core.String, core.Object> toJson() { |
4228 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4288 final core.Map<core.String, core.Object> _json = |
| 4289 new core.Map<core.String, core.Object>(); |
4229 if (sendAs != null) { | 4290 if (sendAs != null) { |
4230 _json["sendAs"] = sendAs.map((value) => (value).toJson()).toList(); | 4291 _json["sendAs"] = sendAs.map((value) => (value).toJson()).toList(); |
4231 } | 4292 } |
4232 return _json; | 4293 return _json; |
4233 } | 4294 } |
4234 } | 4295 } |
4235 | 4296 |
4236 class ListSmimeInfoResponse { | 4297 class ListSmimeInfoResponse { |
4237 /** List of SmimeInfo. */ | 4298 /// List of SmimeInfo. |
4238 core.List<SmimeInfo> smimeInfo; | 4299 core.List<SmimeInfo> smimeInfo; |
4239 | 4300 |
4240 ListSmimeInfoResponse(); | 4301 ListSmimeInfoResponse(); |
4241 | 4302 |
4242 ListSmimeInfoResponse.fromJson(core.Map _json) { | 4303 ListSmimeInfoResponse.fromJson(core.Map _json) { |
4243 if (_json.containsKey("smimeInfo")) { | 4304 if (_json.containsKey("smimeInfo")) { |
4244 smimeInfo = _json["smimeInfo"].map((value) => new SmimeInfo.fromJson(value
)).toList(); | 4305 smimeInfo = _json["smimeInfo"] |
| 4306 .map((value) => new SmimeInfo.fromJson(value)) |
| 4307 .toList(); |
4245 } | 4308 } |
4246 } | 4309 } |
4247 | 4310 |
4248 core.Map<core.String, core.Object> toJson() { | 4311 core.Map<core.String, core.Object> toJson() { |
4249 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4312 final core.Map<core.String, core.Object> _json = |
| 4313 new core.Map<core.String, core.Object>(); |
4250 if (smimeInfo != null) { | 4314 if (smimeInfo != null) { |
4251 _json["smimeInfo"] = smimeInfo.map((value) => (value).toJson()).toList(); | 4315 _json["smimeInfo"] = smimeInfo.map((value) => (value).toJson()).toList(); |
4252 } | 4316 } |
4253 return _json; | 4317 return _json; |
4254 } | 4318 } |
4255 } | 4319 } |
4256 | 4320 |
4257 class ListThreadsResponse { | 4321 class ListThreadsResponse { |
4258 /** Page token to retrieve the next page of results in the list. */ | 4322 /// Page token to retrieve the next page of results in the list. |
4259 core.String nextPageToken; | 4323 core.String nextPageToken; |
4260 /** Estimated total number of results. */ | 4324 |
| 4325 /// Estimated total number of results. |
4261 core.int resultSizeEstimate; | 4326 core.int resultSizeEstimate; |
4262 /** List of threads. */ | 4327 |
| 4328 /// List of threads. |
4263 core.List<Thread> threads; | 4329 core.List<Thread> threads; |
4264 | 4330 |
4265 ListThreadsResponse(); | 4331 ListThreadsResponse(); |
4266 | 4332 |
4267 ListThreadsResponse.fromJson(core.Map _json) { | 4333 ListThreadsResponse.fromJson(core.Map _json) { |
4268 if (_json.containsKey("nextPageToken")) { | 4334 if (_json.containsKey("nextPageToken")) { |
4269 nextPageToken = _json["nextPageToken"]; | 4335 nextPageToken = _json["nextPageToken"]; |
4270 } | 4336 } |
4271 if (_json.containsKey("resultSizeEstimate")) { | 4337 if (_json.containsKey("resultSizeEstimate")) { |
4272 resultSizeEstimate = _json["resultSizeEstimate"]; | 4338 resultSizeEstimate = _json["resultSizeEstimate"]; |
4273 } | 4339 } |
4274 if (_json.containsKey("threads")) { | 4340 if (_json.containsKey("threads")) { |
4275 threads = _json["threads"].map((value) => new Thread.fromJson(value)).toLi
st(); | 4341 threads = |
| 4342 _json["threads"].map((value) => new Thread.fromJson(value)).toList(); |
4276 } | 4343 } |
4277 } | 4344 } |
4278 | 4345 |
4279 core.Map<core.String, core.Object> toJson() { | 4346 core.Map<core.String, core.Object> toJson() { |
4280 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4347 final core.Map<core.String, core.Object> _json = |
| 4348 new core.Map<core.String, core.Object>(); |
4281 if (nextPageToken != null) { | 4349 if (nextPageToken != null) { |
4282 _json["nextPageToken"] = nextPageToken; | 4350 _json["nextPageToken"] = nextPageToken; |
4283 } | 4351 } |
4284 if (resultSizeEstimate != null) { | 4352 if (resultSizeEstimate != null) { |
4285 _json["resultSizeEstimate"] = resultSizeEstimate; | 4353 _json["resultSizeEstimate"] = resultSizeEstimate; |
4286 } | 4354 } |
4287 if (threads != null) { | 4355 if (threads != null) { |
4288 _json["threads"] = threads.map((value) => (value).toJson()).toList(); | 4356 _json["threads"] = threads.map((value) => (value).toJson()).toList(); |
4289 } | 4357 } |
4290 return _json; | 4358 return _json; |
4291 } | 4359 } |
4292 } | 4360 } |
4293 | 4361 |
4294 /** An email message. */ | 4362 /// An email message. |
4295 class Message { | 4363 class Message { |
4296 /** The ID of the last history record that modified this message. */ | 4364 /// The ID of the last history record that modified this message. |
4297 core.String historyId; | 4365 core.String historyId; |
4298 /** The immutable ID of the message. */ | 4366 |
| 4367 /// The immutable ID of the message. |
4299 core.String id; | 4368 core.String id; |
4300 /** | 4369 |
4301 * The internal message creation timestamp (epoch ms), which determines | 4370 /// The internal message creation timestamp (epoch ms), which determines |
4302 * ordering in the inbox. For normal SMTP-received email, this represents the | 4371 /// ordering in the inbox. For normal SMTP-received email, this represents |
4303 * time the message was originally accepted by Google, which is more reliable | 4372 /// the time the message was originally accepted by Google, which is more |
4304 * than the Date header. However, for API-migrated mail, it can be configured | 4373 /// reliable than the Date header. However, for API-migrated mail, it can be |
4305 * by client to be based on the Date header. | 4374 /// configured by client to be based on the Date header. |
4306 */ | |
4307 core.String internalDate; | 4375 core.String internalDate; |
4308 /** List of IDs of labels applied to this message. */ | 4376 |
| 4377 /// List of IDs of labels applied to this message. |
4309 core.List<core.String> labelIds; | 4378 core.List<core.String> labelIds; |
4310 /** The parsed email structure in the message parts. */ | 4379 |
| 4380 /// The parsed email structure in the message parts. |
4311 MessagePart payload; | 4381 MessagePart payload; |
4312 /** | 4382 |
4313 * The entire email message in an RFC 2822 formatted and base64url encoded | 4383 /// The entire email message in an RFC 2822 formatted and base64url encoded |
4314 * string. Returned in messages.get and drafts.get responses when the | 4384 /// string. Returned in messages.get and drafts.get responses when the |
4315 * format=RAW parameter is supplied. | 4385 /// format=RAW parameter is supplied. |
4316 */ | |
4317 core.String raw; | 4386 core.String raw; |
4318 core.List<core.int> get rawAsBytes { | 4387 core.List<core.int> get rawAsBytes { |
4319 return convert.BASE64.decode(raw); | 4388 return convert.BASE64.decode(raw); |
4320 } | 4389 } |
4321 | 4390 |
4322 void set rawAsBytes(core.List<core.int> _bytes) { | 4391 void set rawAsBytes(core.List<core.int> _bytes) { |
4323 raw = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"
); | 4392 raw = |
| 4393 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
4324 } | 4394 } |
4325 /** Estimated size in bytes of the message. */ | 4395 |
| 4396 /// Estimated size in bytes of the message. |
4326 core.int sizeEstimate; | 4397 core.int sizeEstimate; |
4327 /** A short part of the message text. */ | 4398 |
| 4399 /// A short part of the message text. |
4328 core.String snippet; | 4400 core.String snippet; |
4329 /** | 4401 |
4330 * The ID of the thread the message belongs to. To add a message or draft to a | 4402 /// The ID of the thread the message belongs to. To add a message or draft to |
4331 * thread, the following criteria must be met: | 4403 /// a thread, the following criteria must be met: |
4332 * - The requested threadId must be specified on the Message or Draft.Message | 4404 /// - The requested threadId must be specified on the Message or |
4333 * you supply with your request. | 4405 /// Draft.Message you supply with your request. |
4334 * - The References and In-Reply-To headers must be set in compliance with the | 4406 /// - The References and In-Reply-To headers must be set in compliance with |
4335 * RFC 2822 standard. | 4407 /// the RFC 2822 standard. |
4336 * - The Subject headers must match. | 4408 /// - The Subject headers must match. |
4337 */ | |
4338 core.String threadId; | 4409 core.String threadId; |
4339 | 4410 |
4340 Message(); | 4411 Message(); |
4341 | 4412 |
4342 Message.fromJson(core.Map _json) { | 4413 Message.fromJson(core.Map _json) { |
4343 if (_json.containsKey("historyId")) { | 4414 if (_json.containsKey("historyId")) { |
4344 historyId = _json["historyId"]; | 4415 historyId = _json["historyId"]; |
4345 } | 4416 } |
4346 if (_json.containsKey("id")) { | 4417 if (_json.containsKey("id")) { |
4347 id = _json["id"]; | 4418 id = _json["id"]; |
(...skipping 15 matching lines...) Expand all Loading... |
4363 } | 4434 } |
4364 if (_json.containsKey("snippet")) { | 4435 if (_json.containsKey("snippet")) { |
4365 snippet = _json["snippet"]; | 4436 snippet = _json["snippet"]; |
4366 } | 4437 } |
4367 if (_json.containsKey("threadId")) { | 4438 if (_json.containsKey("threadId")) { |
4368 threadId = _json["threadId"]; | 4439 threadId = _json["threadId"]; |
4369 } | 4440 } |
4370 } | 4441 } |
4371 | 4442 |
4372 core.Map<core.String, core.Object> toJson() { | 4443 core.Map<core.String, core.Object> toJson() { |
4373 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4444 final core.Map<core.String, core.Object> _json = |
| 4445 new core.Map<core.String, core.Object>(); |
4374 if (historyId != null) { | 4446 if (historyId != null) { |
4375 _json["historyId"] = historyId; | 4447 _json["historyId"] = historyId; |
4376 } | 4448 } |
4377 if (id != null) { | 4449 if (id != null) { |
4378 _json["id"] = id; | 4450 _json["id"] = id; |
4379 } | 4451 } |
4380 if (internalDate != null) { | 4452 if (internalDate != null) { |
4381 _json["internalDate"] = internalDate; | 4453 _json["internalDate"] = internalDate; |
4382 } | 4454 } |
4383 if (labelIds != null) { | 4455 if (labelIds != null) { |
(...skipping 11 matching lines...) Expand all Loading... |
4395 if (snippet != null) { | 4467 if (snippet != null) { |
4396 _json["snippet"] = snippet; | 4468 _json["snippet"] = snippet; |
4397 } | 4469 } |
4398 if (threadId != null) { | 4470 if (threadId != null) { |
4399 _json["threadId"] = threadId; | 4471 _json["threadId"] = threadId; |
4400 } | 4472 } |
4401 return _json; | 4473 return _json; |
4402 } | 4474 } |
4403 } | 4475 } |
4404 | 4476 |
4405 /** A single MIME message part. */ | 4477 /// A single MIME message part. |
4406 class MessagePart { | 4478 class MessagePart { |
4407 /** | 4479 /// The message part body for this part, which may be empty for container |
4408 * The message part body for this part, which may be empty for container MIME | 4480 /// MIME message parts. |
4409 * message parts. | |
4410 */ | |
4411 MessagePartBody body; | 4481 MessagePartBody body; |
4412 /** | 4482 |
4413 * The filename of the attachment. Only present if this message part | 4483 /// The filename of the attachment. Only present if this message part |
4414 * represents an attachment. | 4484 /// represents an attachment. |
4415 */ | |
4416 core.String filename; | 4485 core.String filename; |
4417 /** | 4486 |
4418 * List of headers on this message part. For the top-level message part, | 4487 /// List of headers on this message part. For the top-level message part, |
4419 * representing the entire message payload, it will contain the standard RFC | 4488 /// representing the entire message payload, it will contain the standard RFC |
4420 * 2822 email headers such as To, From, and Subject. | 4489 /// 2822 email headers such as To, From, and Subject. |
4421 */ | |
4422 core.List<MessagePartHeader> headers; | 4490 core.List<MessagePartHeader> headers; |
4423 /** The MIME type of the message part. */ | 4491 |
| 4492 /// The MIME type of the message part. |
4424 core.String mimeType; | 4493 core.String mimeType; |
4425 /** The immutable ID of the message part. */ | 4494 |
| 4495 /// The immutable ID of the message part. |
4426 core.String partId; | 4496 core.String partId; |
4427 /** | 4497 |
4428 * The child MIME message parts of this part. This only applies to container | 4498 /// The child MIME message parts of this part. This only applies to container |
4429 * MIME message parts, for example multipart / * . For non- container MIME | 4499 /// MIME message parts, for example multipart / * . For non- container MIME |
4430 * message part types, such as text/plain, this field is empty. For more | 4500 /// message part types, such as text/plain, this field is empty. For more |
4431 * information, see RFC 1521. | 4501 /// information, see RFC 1521. |
4432 */ | |
4433 core.List<MessagePart> parts; | 4502 core.List<MessagePart> parts; |
4434 | 4503 |
4435 MessagePart(); | 4504 MessagePart(); |
4436 | 4505 |
4437 MessagePart.fromJson(core.Map _json) { | 4506 MessagePart.fromJson(core.Map _json) { |
4438 if (_json.containsKey("body")) { | 4507 if (_json.containsKey("body")) { |
4439 body = new MessagePartBody.fromJson(_json["body"]); | 4508 body = new MessagePartBody.fromJson(_json["body"]); |
4440 } | 4509 } |
4441 if (_json.containsKey("filename")) { | 4510 if (_json.containsKey("filename")) { |
4442 filename = _json["filename"]; | 4511 filename = _json["filename"]; |
4443 } | 4512 } |
4444 if (_json.containsKey("headers")) { | 4513 if (_json.containsKey("headers")) { |
4445 headers = _json["headers"].map((value) => new MessagePartHeader.fromJson(v
alue)).toList(); | 4514 headers = _json["headers"] |
| 4515 .map((value) => new MessagePartHeader.fromJson(value)) |
| 4516 .toList(); |
4446 } | 4517 } |
4447 if (_json.containsKey("mimeType")) { | 4518 if (_json.containsKey("mimeType")) { |
4448 mimeType = _json["mimeType"]; | 4519 mimeType = _json["mimeType"]; |
4449 } | 4520 } |
4450 if (_json.containsKey("partId")) { | 4521 if (_json.containsKey("partId")) { |
4451 partId = _json["partId"]; | 4522 partId = _json["partId"]; |
4452 } | 4523 } |
4453 if (_json.containsKey("parts")) { | 4524 if (_json.containsKey("parts")) { |
4454 parts = _json["parts"].map((value) => new MessagePart.fromJson(value)).toL
ist(); | 4525 parts = _json["parts"] |
| 4526 .map((value) => new MessagePart.fromJson(value)) |
| 4527 .toList(); |
4455 } | 4528 } |
4456 } | 4529 } |
4457 | 4530 |
4458 core.Map<core.String, core.Object> toJson() { | 4531 core.Map<core.String, core.Object> toJson() { |
4459 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4532 final core.Map<core.String, core.Object> _json = |
| 4533 new core.Map<core.String, core.Object>(); |
4460 if (body != null) { | 4534 if (body != null) { |
4461 _json["body"] = (body).toJson(); | 4535 _json["body"] = (body).toJson(); |
4462 } | 4536 } |
4463 if (filename != null) { | 4537 if (filename != null) { |
4464 _json["filename"] = filename; | 4538 _json["filename"] = filename; |
4465 } | 4539 } |
4466 if (headers != null) { | 4540 if (headers != null) { |
4467 _json["headers"] = headers.map((value) => (value).toJson()).toList(); | 4541 _json["headers"] = headers.map((value) => (value).toJson()).toList(); |
4468 } | 4542 } |
4469 if (mimeType != null) { | 4543 if (mimeType != null) { |
4470 _json["mimeType"] = mimeType; | 4544 _json["mimeType"] = mimeType; |
4471 } | 4545 } |
4472 if (partId != null) { | 4546 if (partId != null) { |
4473 _json["partId"] = partId; | 4547 _json["partId"] = partId; |
4474 } | 4548 } |
4475 if (parts != null) { | 4549 if (parts != null) { |
4476 _json["parts"] = parts.map((value) => (value).toJson()).toList(); | 4550 _json["parts"] = parts.map((value) => (value).toJson()).toList(); |
4477 } | 4551 } |
4478 return _json; | 4552 return _json; |
4479 } | 4553 } |
4480 } | 4554 } |
4481 | 4555 |
4482 /** The body of a single MIME message part. */ | 4556 /// The body of a single MIME message part. |
4483 class MessagePartBody { | 4557 class MessagePartBody { |
4484 /** | 4558 /// When present, contains the ID of an external attachment that can be |
4485 * When present, contains the ID of an external attachment that can be | 4559 /// retrieved in a separate messages.attachments.get request. When not |
4486 * retrieved in a separate messages.attachments.get request. When not present, | 4560 /// present, the entire content of the message part body is contained in the |
4487 * the entire content of the message part body is contained in the data field. | 4561 /// data field. |
4488 */ | |
4489 core.String attachmentId; | 4562 core.String attachmentId; |
4490 /** | 4563 |
4491 * The body data of a MIME message part as a base64url encoded string. May be | 4564 /// The body data of a MIME message part as a base64url encoded string. May |
4492 * empty for MIME container types that have no message body or when the body | 4565 /// be empty for MIME container types that have no message body or when the |
4493 * data is sent as a separate attachment. An attachment ID is present if the | 4566 /// body data is sent as a separate attachment. An attachment ID is present |
4494 * body data is contained in a separate attachment. | 4567 /// if the body data is contained in a separate attachment. |
4495 */ | |
4496 core.String data; | 4568 core.String data; |
4497 core.List<core.int> get dataAsBytes { | 4569 core.List<core.int> get dataAsBytes { |
4498 return convert.BASE64.decode(data); | 4570 return convert.BASE64.decode(data); |
4499 } | 4571 } |
4500 | 4572 |
4501 void set dataAsBytes(core.List<core.int> _bytes) { | 4573 void set dataAsBytes(core.List<core.int> _bytes) { |
4502 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 4574 data = |
| 4575 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
4503 } | 4576 } |
4504 /** Number of bytes for the message part data (encoding notwithstanding). */ | 4577 |
| 4578 /// Number of bytes for the message part data (encoding notwithstanding). |
4505 core.int size; | 4579 core.int size; |
4506 | 4580 |
4507 MessagePartBody(); | 4581 MessagePartBody(); |
4508 | 4582 |
4509 MessagePartBody.fromJson(core.Map _json) { | 4583 MessagePartBody.fromJson(core.Map _json) { |
4510 if (_json.containsKey("attachmentId")) { | 4584 if (_json.containsKey("attachmentId")) { |
4511 attachmentId = _json["attachmentId"]; | 4585 attachmentId = _json["attachmentId"]; |
4512 } | 4586 } |
4513 if (_json.containsKey("data")) { | 4587 if (_json.containsKey("data")) { |
4514 data = _json["data"]; | 4588 data = _json["data"]; |
4515 } | 4589 } |
4516 if (_json.containsKey("size")) { | 4590 if (_json.containsKey("size")) { |
4517 size = _json["size"]; | 4591 size = _json["size"]; |
4518 } | 4592 } |
4519 } | 4593 } |
4520 | 4594 |
4521 core.Map<core.String, core.Object> toJson() { | 4595 core.Map<core.String, core.Object> toJson() { |
4522 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4596 final core.Map<core.String, core.Object> _json = |
| 4597 new core.Map<core.String, core.Object>(); |
4523 if (attachmentId != null) { | 4598 if (attachmentId != null) { |
4524 _json["attachmentId"] = attachmentId; | 4599 _json["attachmentId"] = attachmentId; |
4525 } | 4600 } |
4526 if (data != null) { | 4601 if (data != null) { |
4527 _json["data"] = data; | 4602 _json["data"] = data; |
4528 } | 4603 } |
4529 if (size != null) { | 4604 if (size != null) { |
4530 _json["size"] = size; | 4605 _json["size"] = size; |
4531 } | 4606 } |
4532 return _json; | 4607 return _json; |
4533 } | 4608 } |
4534 } | 4609 } |
4535 | 4610 |
4536 class MessagePartHeader { | 4611 class MessagePartHeader { |
4537 /** The name of the header before the : separator. For example, To. */ | 4612 /// The name of the header before the : separator. For example, To. |
4538 core.String name; | 4613 core.String name; |
4539 /** | 4614 |
4540 * The value of the header after the : separator. For example, | 4615 /// The value of the header after the : separator. For example, |
4541 * someuser@example.com. | 4616 /// someuser@example.com. |
4542 */ | |
4543 core.String value; | 4617 core.String value; |
4544 | 4618 |
4545 MessagePartHeader(); | 4619 MessagePartHeader(); |
4546 | 4620 |
4547 MessagePartHeader.fromJson(core.Map _json) { | 4621 MessagePartHeader.fromJson(core.Map _json) { |
4548 if (_json.containsKey("name")) { | 4622 if (_json.containsKey("name")) { |
4549 name = _json["name"]; | 4623 name = _json["name"]; |
4550 } | 4624 } |
4551 if (_json.containsKey("value")) { | 4625 if (_json.containsKey("value")) { |
4552 value = _json["value"]; | 4626 value = _json["value"]; |
4553 } | 4627 } |
4554 } | 4628 } |
4555 | 4629 |
4556 core.Map<core.String, core.Object> toJson() { | 4630 core.Map<core.String, core.Object> toJson() { |
4557 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4631 final core.Map<core.String, core.Object> _json = |
| 4632 new core.Map<core.String, core.Object>(); |
4558 if (name != null) { | 4633 if (name != null) { |
4559 _json["name"] = name; | 4634 _json["name"] = name; |
4560 } | 4635 } |
4561 if (value != null) { | 4636 if (value != null) { |
4562 _json["value"] = value; | 4637 _json["value"] = value; |
4563 } | 4638 } |
4564 return _json; | 4639 return _json; |
4565 } | 4640 } |
4566 } | 4641 } |
4567 | 4642 |
4568 class ModifyMessageRequest { | 4643 class ModifyMessageRequest { |
4569 /** A list of IDs of labels to add to this message. */ | 4644 /// A list of IDs of labels to add to this message. |
4570 core.List<core.String> addLabelIds; | 4645 core.List<core.String> addLabelIds; |
4571 /** A list IDs of labels to remove from this message. */ | 4646 |
| 4647 /// A list IDs of labels to remove from this message. |
4572 core.List<core.String> removeLabelIds; | 4648 core.List<core.String> removeLabelIds; |
4573 | 4649 |
4574 ModifyMessageRequest(); | 4650 ModifyMessageRequest(); |
4575 | 4651 |
4576 ModifyMessageRequest.fromJson(core.Map _json) { | 4652 ModifyMessageRequest.fromJson(core.Map _json) { |
4577 if (_json.containsKey("addLabelIds")) { | 4653 if (_json.containsKey("addLabelIds")) { |
4578 addLabelIds = _json["addLabelIds"]; | 4654 addLabelIds = _json["addLabelIds"]; |
4579 } | 4655 } |
4580 if (_json.containsKey("removeLabelIds")) { | 4656 if (_json.containsKey("removeLabelIds")) { |
4581 removeLabelIds = _json["removeLabelIds"]; | 4657 removeLabelIds = _json["removeLabelIds"]; |
4582 } | 4658 } |
4583 } | 4659 } |
4584 | 4660 |
4585 core.Map<core.String, core.Object> toJson() { | 4661 core.Map<core.String, core.Object> toJson() { |
4586 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4662 final core.Map<core.String, core.Object> _json = |
| 4663 new core.Map<core.String, core.Object>(); |
4587 if (addLabelIds != null) { | 4664 if (addLabelIds != null) { |
4588 _json["addLabelIds"] = addLabelIds; | 4665 _json["addLabelIds"] = addLabelIds; |
4589 } | 4666 } |
4590 if (removeLabelIds != null) { | 4667 if (removeLabelIds != null) { |
4591 _json["removeLabelIds"] = removeLabelIds; | 4668 _json["removeLabelIds"] = removeLabelIds; |
4592 } | 4669 } |
4593 return _json; | 4670 return _json; |
4594 } | 4671 } |
4595 } | 4672 } |
4596 | 4673 |
4597 class ModifyThreadRequest { | 4674 class ModifyThreadRequest { |
4598 /** A list of IDs of labels to add to this thread. */ | 4675 /// A list of IDs of labels to add to this thread. |
4599 core.List<core.String> addLabelIds; | 4676 core.List<core.String> addLabelIds; |
4600 /** A list of IDs of labels to remove from this thread. */ | 4677 |
| 4678 /// A list of IDs of labels to remove from this thread. |
4601 core.List<core.String> removeLabelIds; | 4679 core.List<core.String> removeLabelIds; |
4602 | 4680 |
4603 ModifyThreadRequest(); | 4681 ModifyThreadRequest(); |
4604 | 4682 |
4605 ModifyThreadRequest.fromJson(core.Map _json) { | 4683 ModifyThreadRequest.fromJson(core.Map _json) { |
4606 if (_json.containsKey("addLabelIds")) { | 4684 if (_json.containsKey("addLabelIds")) { |
4607 addLabelIds = _json["addLabelIds"]; | 4685 addLabelIds = _json["addLabelIds"]; |
4608 } | 4686 } |
4609 if (_json.containsKey("removeLabelIds")) { | 4687 if (_json.containsKey("removeLabelIds")) { |
4610 removeLabelIds = _json["removeLabelIds"]; | 4688 removeLabelIds = _json["removeLabelIds"]; |
4611 } | 4689 } |
4612 } | 4690 } |
4613 | 4691 |
4614 core.Map<core.String, core.Object> toJson() { | 4692 core.Map<core.String, core.Object> toJson() { |
4615 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4693 final core.Map<core.String, core.Object> _json = |
| 4694 new core.Map<core.String, core.Object>(); |
4616 if (addLabelIds != null) { | 4695 if (addLabelIds != null) { |
4617 _json["addLabelIds"] = addLabelIds; | 4696 _json["addLabelIds"] = addLabelIds; |
4618 } | 4697 } |
4619 if (removeLabelIds != null) { | 4698 if (removeLabelIds != null) { |
4620 _json["removeLabelIds"] = removeLabelIds; | 4699 _json["removeLabelIds"] = removeLabelIds; |
4621 } | 4700 } |
4622 return _json; | 4701 return _json; |
4623 } | 4702 } |
4624 } | 4703 } |
4625 | 4704 |
4626 /** POP settings for an account. */ | 4705 /// POP settings for an account. |
4627 class PopSettings { | 4706 class PopSettings { |
4628 /** | 4707 /// The range of messages which are accessible via POP. |
4629 * The range of messages which are accessible via POP. | 4708 /// Possible string values are: |
4630 * Possible string values are: | 4709 /// - "accessWindowUnspecified" |
4631 * - "accessWindowUnspecified" | 4710 /// - "allMail" |
4632 * - "allMail" | 4711 /// - "disabled" |
4633 * - "disabled" | 4712 /// - "fromNowOn" |
4634 * - "fromNowOn" | |
4635 */ | |
4636 core.String accessWindow; | 4713 core.String accessWindow; |
4637 /** | 4714 |
4638 * The action that will be executed on a message after it has been fetched via | 4715 /// The action that will be executed on a message after it has been fetched |
4639 * POP. | 4716 /// via POP. |
4640 * Possible string values are: | 4717 /// Possible string values are: |
4641 * - "archive" | 4718 /// - "archive" |
4642 * - "dispositionUnspecified" | 4719 /// - "dispositionUnspecified" |
4643 * - "leaveInInbox" | 4720 /// - "leaveInInbox" |
4644 * - "markRead" | 4721 /// - "markRead" |
4645 * - "trash" | 4722 /// - "trash" |
4646 */ | |
4647 core.String disposition; | 4723 core.String disposition; |
4648 | 4724 |
4649 PopSettings(); | 4725 PopSettings(); |
4650 | 4726 |
4651 PopSettings.fromJson(core.Map _json) { | 4727 PopSettings.fromJson(core.Map _json) { |
4652 if (_json.containsKey("accessWindow")) { | 4728 if (_json.containsKey("accessWindow")) { |
4653 accessWindow = _json["accessWindow"]; | 4729 accessWindow = _json["accessWindow"]; |
4654 } | 4730 } |
4655 if (_json.containsKey("disposition")) { | 4731 if (_json.containsKey("disposition")) { |
4656 disposition = _json["disposition"]; | 4732 disposition = _json["disposition"]; |
4657 } | 4733 } |
4658 } | 4734 } |
4659 | 4735 |
4660 core.Map<core.String, core.Object> toJson() { | 4736 core.Map<core.String, core.Object> toJson() { |
4661 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4737 final core.Map<core.String, core.Object> _json = |
| 4738 new core.Map<core.String, core.Object>(); |
4662 if (accessWindow != null) { | 4739 if (accessWindow != null) { |
4663 _json["accessWindow"] = accessWindow; | 4740 _json["accessWindow"] = accessWindow; |
4664 } | 4741 } |
4665 if (disposition != null) { | 4742 if (disposition != null) { |
4666 _json["disposition"] = disposition; | 4743 _json["disposition"] = disposition; |
4667 } | 4744 } |
4668 return _json; | 4745 return _json; |
4669 } | 4746 } |
4670 } | 4747 } |
4671 | 4748 |
4672 /** Profile for a Gmail user. */ | 4749 /// Profile for a Gmail user. |
4673 class Profile { | 4750 class Profile { |
4674 /** The user's email address. */ | 4751 /// The user's email address. |
4675 core.String emailAddress; | 4752 core.String emailAddress; |
4676 /** The ID of the mailbox's current history record. */ | 4753 |
| 4754 /// The ID of the mailbox's current history record. |
4677 core.String historyId; | 4755 core.String historyId; |
4678 /** The total number of messages in the mailbox. */ | 4756 |
| 4757 /// The total number of messages in the mailbox. |
4679 core.int messagesTotal; | 4758 core.int messagesTotal; |
4680 /** The total number of threads in the mailbox. */ | 4759 |
| 4760 /// The total number of threads in the mailbox. |
4681 core.int threadsTotal; | 4761 core.int threadsTotal; |
4682 | 4762 |
4683 Profile(); | 4763 Profile(); |
4684 | 4764 |
4685 Profile.fromJson(core.Map _json) { | 4765 Profile.fromJson(core.Map _json) { |
4686 if (_json.containsKey("emailAddress")) { | 4766 if (_json.containsKey("emailAddress")) { |
4687 emailAddress = _json["emailAddress"]; | 4767 emailAddress = _json["emailAddress"]; |
4688 } | 4768 } |
4689 if (_json.containsKey("historyId")) { | 4769 if (_json.containsKey("historyId")) { |
4690 historyId = _json["historyId"]; | 4770 historyId = _json["historyId"]; |
4691 } | 4771 } |
4692 if (_json.containsKey("messagesTotal")) { | 4772 if (_json.containsKey("messagesTotal")) { |
4693 messagesTotal = _json["messagesTotal"]; | 4773 messagesTotal = _json["messagesTotal"]; |
4694 } | 4774 } |
4695 if (_json.containsKey("threadsTotal")) { | 4775 if (_json.containsKey("threadsTotal")) { |
4696 threadsTotal = _json["threadsTotal"]; | 4776 threadsTotal = _json["threadsTotal"]; |
4697 } | 4777 } |
4698 } | 4778 } |
4699 | 4779 |
4700 core.Map<core.String, core.Object> toJson() { | 4780 core.Map<core.String, core.Object> toJson() { |
4701 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4781 final core.Map<core.String, core.Object> _json = |
| 4782 new core.Map<core.String, core.Object>(); |
4702 if (emailAddress != null) { | 4783 if (emailAddress != null) { |
4703 _json["emailAddress"] = emailAddress; | 4784 _json["emailAddress"] = emailAddress; |
4704 } | 4785 } |
4705 if (historyId != null) { | 4786 if (historyId != null) { |
4706 _json["historyId"] = historyId; | 4787 _json["historyId"] = historyId; |
4707 } | 4788 } |
4708 if (messagesTotal != null) { | 4789 if (messagesTotal != null) { |
4709 _json["messagesTotal"] = messagesTotal; | 4790 _json["messagesTotal"] = messagesTotal; |
4710 } | 4791 } |
4711 if (threadsTotal != null) { | 4792 if (threadsTotal != null) { |
4712 _json["threadsTotal"] = threadsTotal; | 4793 _json["threadsTotal"] = threadsTotal; |
4713 } | 4794 } |
4714 return _json; | 4795 return _json; |
4715 } | 4796 } |
4716 } | 4797 } |
4717 | 4798 |
4718 /** | 4799 /// Settings associated with a send-as alias, which can be either the primary |
4719 * Settings associated with a send-as alias, which can be either the primary | 4800 /// login address associated with the account or a custom "from" address. |
4720 * login address associated with the account or a custom "from" address. Send-as | 4801 /// Send-as aliases correspond to the "Send Mail As" feature in the web |
4721 * aliases correspond to the "Send Mail As" feature in the web interface. | 4802 /// interface. |
4722 */ | |
4723 class SendAs { | 4803 class SendAs { |
4724 /** | 4804 /// A name that appears in the "From:" header for mail sent using this alias. |
4725 * A name that appears in the "From:" header for mail sent using this alias. | 4805 /// For custom "from" addresses, when this is empty, Gmail will populate the |
4726 * For custom "from" addresses, when this is empty, Gmail will populate the | 4806 /// "From:" header with the name that is used for the primary address |
4727 * "From:" header with the name that is used for the primary address | 4807 /// associated with the account. |
4728 * associated with the account. | |
4729 */ | |
4730 core.String displayName; | 4808 core.String displayName; |
4731 /** | 4809 |
4732 * Whether this address is selected as the default "From:" address in | 4810 /// Whether this address is selected as the default "From:" address in |
4733 * situations such as composing a new message or sending a vacation | 4811 /// situations such as composing a new message or sending a vacation |
4734 * auto-reply. Every Gmail account has exactly one default send-as address, so | 4812 /// auto-reply. Every Gmail account has exactly one default send-as address, |
4735 * the only legal value that clients may write to this field is true. Changing | 4813 /// so the only legal value that clients may write to this field is true. |
4736 * this from false to true for an address will result in this field becoming | 4814 /// Changing this from false to true for an address will result in this field |
4737 * false for the other previous default address. | 4815 /// becoming false for the other previous default address. |
4738 */ | |
4739 core.bool isDefault; | 4816 core.bool isDefault; |
4740 /** | 4817 |
4741 * Whether this address is the primary address used to login to the account. | 4818 /// Whether this address is the primary address used to login to the account. |
4742 * Every Gmail account has exactly one primary address, and it cannot be | 4819 /// Every Gmail account has exactly one primary address, and it cannot be |
4743 * deleted from the collection of send-as aliases. This field is read-only. | 4820 /// deleted from the collection of send-as aliases. This field is read-only. |
4744 */ | |
4745 core.bool isPrimary; | 4821 core.bool isPrimary; |
4746 /** | 4822 |
4747 * An optional email address that is included in a "Reply-To:" header for mail | 4823 /// An optional email address that is included in a "Reply-To:" header for |
4748 * sent using this alias. If this is empty, Gmail will not generate a | 4824 /// mail sent using this alias. If this is empty, Gmail will not generate a |
4749 * "Reply-To:" header. | 4825 /// "Reply-To:" header. |
4750 */ | |
4751 core.String replyToAddress; | 4826 core.String replyToAddress; |
4752 /** | 4827 |
4753 * The email address that appears in the "From:" header for mail sent using | 4828 /// The email address that appears in the "From:" header for mail sent using |
4754 * this alias. This is read-only for all operations except create. | 4829 /// this alias. This is read-only for all operations except create. |
4755 */ | |
4756 core.String sendAsEmail; | 4830 core.String sendAsEmail; |
4757 /** | 4831 |
4758 * An optional HTML signature that is included in messages composed with this | 4832 /// An optional HTML signature that is included in messages composed with |
4759 * alias in the Gmail web UI. | 4833 /// this alias in the Gmail web UI. |
4760 */ | |
4761 core.String signature; | 4834 core.String signature; |
4762 /** | 4835 |
4763 * An optional SMTP service that will be used as an outbound relay for mail | 4836 /// An optional SMTP service that will be used as an outbound relay for mail |
4764 * sent using this alias. If this is empty, outbound mail will be sent | 4837 /// sent using this alias. If this is empty, outbound mail will be sent |
4765 * directly from Gmail's servers to the destination SMTP service. This setting | 4838 /// directly from Gmail's servers to the destination SMTP service. This |
4766 * only applies to custom "from" aliases. | 4839 /// setting only applies to custom "from" aliases. |
4767 */ | |
4768 SmtpMsa smtpMsa; | 4840 SmtpMsa smtpMsa; |
4769 /** | 4841 |
4770 * Whether Gmail should treat this address as an alias for the user's primary | 4842 /// Whether Gmail should treat this address as an alias for the user's |
4771 * email address. This setting only applies to custom "from" aliases. | 4843 /// primary email address. This setting only applies to custom "from" |
4772 */ | 4844 /// aliases. |
4773 core.bool treatAsAlias; | 4845 core.bool treatAsAlias; |
4774 /** | 4846 |
4775 * Indicates whether this address has been verified for use as a send-as | 4847 /// Indicates whether this address has been verified for use as a send-as |
4776 * alias. Read-only. This setting only applies to custom "from" aliases. | 4848 /// alias. Read-only. This setting only applies to custom "from" aliases. |
4777 * Possible string values are: | 4849 /// Possible string values are: |
4778 * - "accepted" | 4850 /// - "accepted" |
4779 * - "pending" | 4851 /// - "pending" |
4780 * - "verificationStatusUnspecified" | 4852 /// - "verificationStatusUnspecified" |
4781 */ | |
4782 core.String verificationStatus; | 4853 core.String verificationStatus; |
4783 | 4854 |
4784 SendAs(); | 4855 SendAs(); |
4785 | 4856 |
4786 SendAs.fromJson(core.Map _json) { | 4857 SendAs.fromJson(core.Map _json) { |
4787 if (_json.containsKey("displayName")) { | 4858 if (_json.containsKey("displayName")) { |
4788 displayName = _json["displayName"]; | 4859 displayName = _json["displayName"]; |
4789 } | 4860 } |
4790 if (_json.containsKey("isDefault")) { | 4861 if (_json.containsKey("isDefault")) { |
4791 isDefault = _json["isDefault"]; | 4862 isDefault = _json["isDefault"]; |
(...skipping 15 matching lines...) Expand all Loading... |
4807 } | 4878 } |
4808 if (_json.containsKey("treatAsAlias")) { | 4879 if (_json.containsKey("treatAsAlias")) { |
4809 treatAsAlias = _json["treatAsAlias"]; | 4880 treatAsAlias = _json["treatAsAlias"]; |
4810 } | 4881 } |
4811 if (_json.containsKey("verificationStatus")) { | 4882 if (_json.containsKey("verificationStatus")) { |
4812 verificationStatus = _json["verificationStatus"]; | 4883 verificationStatus = _json["verificationStatus"]; |
4813 } | 4884 } |
4814 } | 4885 } |
4815 | 4886 |
4816 core.Map<core.String, core.Object> toJson() { | 4887 core.Map<core.String, core.Object> toJson() { |
4817 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4888 final core.Map<core.String, core.Object> _json = |
| 4889 new core.Map<core.String, core.Object>(); |
4818 if (displayName != null) { | 4890 if (displayName != null) { |
4819 _json["displayName"] = displayName; | 4891 _json["displayName"] = displayName; |
4820 } | 4892 } |
4821 if (isDefault != null) { | 4893 if (isDefault != null) { |
4822 _json["isDefault"] = isDefault; | 4894 _json["isDefault"] = isDefault; |
4823 } | 4895 } |
4824 if (isPrimary != null) { | 4896 if (isPrimary != null) { |
4825 _json["isPrimary"] = isPrimary; | 4897 _json["isPrimary"] = isPrimary; |
4826 } | 4898 } |
4827 if (replyToAddress != null) { | 4899 if (replyToAddress != null) { |
(...skipping 11 matching lines...) Expand all Loading... |
4839 if (treatAsAlias != null) { | 4911 if (treatAsAlias != null) { |
4840 _json["treatAsAlias"] = treatAsAlias; | 4912 _json["treatAsAlias"] = treatAsAlias; |
4841 } | 4913 } |
4842 if (verificationStatus != null) { | 4914 if (verificationStatus != null) { |
4843 _json["verificationStatus"] = verificationStatus; | 4915 _json["verificationStatus"] = verificationStatus; |
4844 } | 4916 } |
4845 return _json; | 4917 return _json; |
4846 } | 4918 } |
4847 } | 4919 } |
4848 | 4920 |
4849 /** An S/MIME email config. */ | 4921 /// An S/MIME email config. |
4850 class SmimeInfo { | 4922 class SmimeInfo { |
4851 /** Encrypted key password, when key is encrypted. */ | 4923 /// Encrypted key password, when key is encrypted. |
4852 core.String encryptedKeyPassword; | 4924 core.String encryptedKeyPassword; |
4853 /** When the certificate expires (in milliseconds since epoch). */ | 4925 |
| 4926 /// When the certificate expires (in milliseconds since epoch). |
4854 core.String expiration; | 4927 core.String expiration; |
4855 /** The immutable ID for the SmimeInfo. */ | 4928 |
| 4929 /// The immutable ID for the SmimeInfo. |
4856 core.String id; | 4930 core.String id; |
4857 /** | 4931 |
4858 * Whether this SmimeInfo is the default one for this user's send-as address. | 4932 /// Whether this SmimeInfo is the default one for this user's send-as |
4859 */ | 4933 /// address. |
4860 core.bool isDefault; | 4934 core.bool isDefault; |
4861 /** The S/MIME certificate issuer's common name. */ | 4935 |
| 4936 /// The S/MIME certificate issuer's common name. |
4862 core.String issuerCn; | 4937 core.String issuerCn; |
4863 /** | 4938 |
4864 * PEM formatted X509 concatenated certificate string (standard base64 | 4939 /// PEM formatted X509 concatenated certificate string (standard base64 |
4865 * encoding). Format used for returning key, which includes public key as well | 4940 /// encoding). Format used for returning key, which includes public key as |
4866 * as certificate chain (not private key). | 4941 /// well as certificate chain (not private key). |
4867 */ | |
4868 core.String pem; | 4942 core.String pem; |
4869 /** | 4943 |
4870 * PKCS#12 format containing a single private/public key pair and certificate | 4944 /// PKCS#12 format containing a single private/public key pair and |
4871 * chain. This format is only accepted from client for creating a new | 4945 /// certificate chain. This format is only accepted from client for creating |
4872 * SmimeInfo and is never returned, because the private key is not intended to | 4946 /// a new SmimeInfo and is never returned, because the private key is not |
4873 * be exported. PKCS#12 may be encrypted, in which case encryptedKeyPassword | 4947 /// intended to be exported. PKCS#12 may be encrypted, in which case |
4874 * should be set appropriately. | 4948 /// encryptedKeyPassword should be set appropriately. |
4875 */ | |
4876 core.String pkcs12; | 4949 core.String pkcs12; |
4877 core.List<core.int> get pkcs12AsBytes { | 4950 core.List<core.int> get pkcs12AsBytes { |
4878 return convert.BASE64.decode(pkcs12); | 4951 return convert.BASE64.decode(pkcs12); |
4879 } | 4952 } |
4880 | 4953 |
4881 void set pkcs12AsBytes(core.List<core.int> _bytes) { | 4954 void set pkcs12AsBytes(core.List<core.int> _bytes) { |
4882 pkcs12 = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); | 4955 pkcs12 = |
| 4956 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
4883 } | 4957 } |
4884 | 4958 |
4885 SmimeInfo(); | 4959 SmimeInfo(); |
4886 | 4960 |
4887 SmimeInfo.fromJson(core.Map _json) { | 4961 SmimeInfo.fromJson(core.Map _json) { |
4888 if (_json.containsKey("encryptedKeyPassword")) { | 4962 if (_json.containsKey("encryptedKeyPassword")) { |
4889 encryptedKeyPassword = _json["encryptedKeyPassword"]; | 4963 encryptedKeyPassword = _json["encryptedKeyPassword"]; |
4890 } | 4964 } |
4891 if (_json.containsKey("expiration")) { | 4965 if (_json.containsKey("expiration")) { |
4892 expiration = _json["expiration"]; | 4966 expiration = _json["expiration"]; |
4893 } | 4967 } |
4894 if (_json.containsKey("id")) { | 4968 if (_json.containsKey("id")) { |
4895 id = _json["id"]; | 4969 id = _json["id"]; |
4896 } | 4970 } |
4897 if (_json.containsKey("isDefault")) { | 4971 if (_json.containsKey("isDefault")) { |
4898 isDefault = _json["isDefault"]; | 4972 isDefault = _json["isDefault"]; |
4899 } | 4973 } |
4900 if (_json.containsKey("issuerCn")) { | 4974 if (_json.containsKey("issuerCn")) { |
4901 issuerCn = _json["issuerCn"]; | 4975 issuerCn = _json["issuerCn"]; |
4902 } | 4976 } |
4903 if (_json.containsKey("pem")) { | 4977 if (_json.containsKey("pem")) { |
4904 pem = _json["pem"]; | 4978 pem = _json["pem"]; |
4905 } | 4979 } |
4906 if (_json.containsKey("pkcs12")) { | 4980 if (_json.containsKey("pkcs12")) { |
4907 pkcs12 = _json["pkcs12"]; | 4981 pkcs12 = _json["pkcs12"]; |
4908 } | 4982 } |
4909 } | 4983 } |
4910 | 4984 |
4911 core.Map<core.String, core.Object> toJson() { | 4985 core.Map<core.String, core.Object> toJson() { |
4912 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4986 final core.Map<core.String, core.Object> _json = |
| 4987 new core.Map<core.String, core.Object>(); |
4913 if (encryptedKeyPassword != null) { | 4988 if (encryptedKeyPassword != null) { |
4914 _json["encryptedKeyPassword"] = encryptedKeyPassword; | 4989 _json["encryptedKeyPassword"] = encryptedKeyPassword; |
4915 } | 4990 } |
4916 if (expiration != null) { | 4991 if (expiration != null) { |
4917 _json["expiration"] = expiration; | 4992 _json["expiration"] = expiration; |
4918 } | 4993 } |
4919 if (id != null) { | 4994 if (id != null) { |
4920 _json["id"] = id; | 4995 _json["id"] = id; |
4921 } | 4996 } |
4922 if (isDefault != null) { | 4997 if (isDefault != null) { |
4923 _json["isDefault"] = isDefault; | 4998 _json["isDefault"] = isDefault; |
4924 } | 4999 } |
4925 if (issuerCn != null) { | 5000 if (issuerCn != null) { |
4926 _json["issuerCn"] = issuerCn; | 5001 _json["issuerCn"] = issuerCn; |
4927 } | 5002 } |
4928 if (pem != null) { | 5003 if (pem != null) { |
4929 _json["pem"] = pem; | 5004 _json["pem"] = pem; |
4930 } | 5005 } |
4931 if (pkcs12 != null) { | 5006 if (pkcs12 != null) { |
4932 _json["pkcs12"] = pkcs12; | 5007 _json["pkcs12"] = pkcs12; |
4933 } | 5008 } |
4934 return _json; | 5009 return _json; |
4935 } | 5010 } |
4936 } | 5011 } |
4937 | 5012 |
4938 /** Configuration for communication with an SMTP service. */ | 5013 /// Configuration for communication with an SMTP service. |
4939 class SmtpMsa { | 5014 class SmtpMsa { |
4940 /** The hostname of the SMTP service. Required. */ | 5015 /// The hostname of the SMTP service. Required. |
4941 core.String host; | 5016 core.String host; |
4942 /** | 5017 |
4943 * The password that will be used for authentication with the SMTP service. | 5018 /// The password that will be used for authentication with the SMTP service. |
4944 * This is a write-only field that can be specified in requests to create or | 5019 /// This is a write-only field that can be specified in requests to create or |
4945 * update SendAs settings; it is never populated in responses. | 5020 /// update SendAs settings; it is never populated in responses. |
4946 */ | |
4947 core.String password; | 5021 core.String password; |
4948 /** The port of the SMTP service. Required. */ | 5022 |
| 5023 /// The port of the SMTP service. Required. |
4949 core.int port; | 5024 core.int port; |
4950 /** | 5025 |
4951 * The protocol that will be used to secure communication with the SMTP | 5026 /// The protocol that will be used to secure communication with the SMTP |
4952 * service. Required. | 5027 /// service. Required. |
4953 * Possible string values are: | 5028 /// Possible string values are: |
4954 * - "none" | 5029 /// - "none" |
4955 * - "securityModeUnspecified" | 5030 /// - "securityModeUnspecified" |
4956 * - "ssl" | 5031 /// - "ssl" |
4957 * - "starttls" | 5032 /// - "starttls" |
4958 */ | |
4959 core.String securityMode; | 5033 core.String securityMode; |
4960 /** | 5034 |
4961 * The username that will be used for authentication with the SMTP service. | 5035 /// The username that will be used for authentication with the SMTP service. |
4962 * This is a write-only field that can be specified in requests to create or | 5036 /// This is a write-only field that can be specified in requests to create or |
4963 * update SendAs settings; it is never populated in responses. | 5037 /// update SendAs settings; it is never populated in responses. |
4964 */ | |
4965 core.String username; | 5038 core.String username; |
4966 | 5039 |
4967 SmtpMsa(); | 5040 SmtpMsa(); |
4968 | 5041 |
4969 SmtpMsa.fromJson(core.Map _json) { | 5042 SmtpMsa.fromJson(core.Map _json) { |
4970 if (_json.containsKey("host")) { | 5043 if (_json.containsKey("host")) { |
4971 host = _json["host"]; | 5044 host = _json["host"]; |
4972 } | 5045 } |
4973 if (_json.containsKey("password")) { | 5046 if (_json.containsKey("password")) { |
4974 password = _json["password"]; | 5047 password = _json["password"]; |
4975 } | 5048 } |
4976 if (_json.containsKey("port")) { | 5049 if (_json.containsKey("port")) { |
4977 port = _json["port"]; | 5050 port = _json["port"]; |
4978 } | 5051 } |
4979 if (_json.containsKey("securityMode")) { | 5052 if (_json.containsKey("securityMode")) { |
4980 securityMode = _json["securityMode"]; | 5053 securityMode = _json["securityMode"]; |
4981 } | 5054 } |
4982 if (_json.containsKey("username")) { | 5055 if (_json.containsKey("username")) { |
4983 username = _json["username"]; | 5056 username = _json["username"]; |
4984 } | 5057 } |
4985 } | 5058 } |
4986 | 5059 |
4987 core.Map<core.String, core.Object> toJson() { | 5060 core.Map<core.String, core.Object> toJson() { |
4988 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5061 final core.Map<core.String, core.Object> _json = |
| 5062 new core.Map<core.String, core.Object>(); |
4989 if (host != null) { | 5063 if (host != null) { |
4990 _json["host"] = host; | 5064 _json["host"] = host; |
4991 } | 5065 } |
4992 if (password != null) { | 5066 if (password != null) { |
4993 _json["password"] = password; | 5067 _json["password"] = password; |
4994 } | 5068 } |
4995 if (port != null) { | 5069 if (port != null) { |
4996 _json["port"] = port; | 5070 _json["port"] = port; |
4997 } | 5071 } |
4998 if (securityMode != null) { | 5072 if (securityMode != null) { |
4999 _json["securityMode"] = securityMode; | 5073 _json["securityMode"] = securityMode; |
5000 } | 5074 } |
5001 if (username != null) { | 5075 if (username != null) { |
5002 _json["username"] = username; | 5076 _json["username"] = username; |
5003 } | 5077 } |
5004 return _json; | 5078 return _json; |
5005 } | 5079 } |
5006 } | 5080 } |
5007 | 5081 |
5008 /** A collection of messages representing a conversation. */ | 5082 /// A collection of messages representing a conversation. |
5009 class Thread { | 5083 class Thread { |
5010 /** The ID of the last history record that modified this thread. */ | 5084 /// The ID of the last history record that modified this thread. |
5011 core.String historyId; | 5085 core.String historyId; |
5012 /** The unique ID of the thread. */ | 5086 |
| 5087 /// The unique ID of the thread. |
5013 core.String id; | 5088 core.String id; |
5014 /** The list of messages in the thread. */ | 5089 |
| 5090 /// The list of messages in the thread. |
5015 core.List<Message> messages; | 5091 core.List<Message> messages; |
5016 /** A short part of the message text. */ | 5092 |
| 5093 /// A short part of the message text. |
5017 core.String snippet; | 5094 core.String snippet; |
5018 | 5095 |
5019 Thread(); | 5096 Thread(); |
5020 | 5097 |
5021 Thread.fromJson(core.Map _json) { | 5098 Thread.fromJson(core.Map _json) { |
5022 if (_json.containsKey("historyId")) { | 5099 if (_json.containsKey("historyId")) { |
5023 historyId = _json["historyId"]; | 5100 historyId = _json["historyId"]; |
5024 } | 5101 } |
5025 if (_json.containsKey("id")) { | 5102 if (_json.containsKey("id")) { |
5026 id = _json["id"]; | 5103 id = _json["id"]; |
5027 } | 5104 } |
5028 if (_json.containsKey("messages")) { | 5105 if (_json.containsKey("messages")) { |
5029 messages = _json["messages"].map((value) => new Message.fromJson(value)).t
oList(); | 5106 messages = _json["messages"] |
| 5107 .map((value) => new Message.fromJson(value)) |
| 5108 .toList(); |
5030 } | 5109 } |
5031 if (_json.containsKey("snippet")) { | 5110 if (_json.containsKey("snippet")) { |
5032 snippet = _json["snippet"]; | 5111 snippet = _json["snippet"]; |
5033 } | 5112 } |
5034 } | 5113 } |
5035 | 5114 |
5036 core.Map<core.String, core.Object> toJson() { | 5115 core.Map<core.String, core.Object> toJson() { |
5037 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5116 final core.Map<core.String, core.Object> _json = |
| 5117 new core.Map<core.String, core.Object>(); |
5038 if (historyId != null) { | 5118 if (historyId != null) { |
5039 _json["historyId"] = historyId; | 5119 _json["historyId"] = historyId; |
5040 } | 5120 } |
5041 if (id != null) { | 5121 if (id != null) { |
5042 _json["id"] = id; | 5122 _json["id"] = id; |
5043 } | 5123 } |
5044 if (messages != null) { | 5124 if (messages != null) { |
5045 _json["messages"] = messages.map((value) => (value).toJson()).toList(); | 5125 _json["messages"] = messages.map((value) => (value).toJson()).toList(); |
5046 } | 5126 } |
5047 if (snippet != null) { | 5127 if (snippet != null) { |
5048 _json["snippet"] = snippet; | 5128 _json["snippet"] = snippet; |
5049 } | 5129 } |
5050 return _json; | 5130 return _json; |
5051 } | 5131 } |
5052 } | 5132 } |
5053 | 5133 |
5054 /** | 5134 /// Vacation auto-reply settings for an account. These settings correspond to |
5055 * Vacation auto-reply settings for an account. These settings correspond to the | 5135 /// the "Vacation responder" feature in the web interface. |
5056 * "Vacation responder" feature in the web interface. | |
5057 */ | |
5058 class VacationSettings { | 5136 class VacationSettings { |
5059 /** Flag that controls whether Gmail automatically replies to messages. */ | 5137 /// Flag that controls whether Gmail automatically replies to messages. |
5060 core.bool enableAutoReply; | 5138 core.bool enableAutoReply; |
5061 /** | 5139 |
5062 * An optional end time for sending auto-replies (epoch ms). When this is | 5140 /// An optional end time for sending auto-replies (epoch ms). When this is |
5063 * specified, Gmail will automatically reply only to messages that it receives | 5141 /// specified, Gmail will automatically reply only to messages that it |
5064 * before the end time. If both startTime and endTime are specified, startTime | 5142 /// receives before the end time. If both startTime and endTime are |
5065 * must precede endTime. | 5143 /// specified, startTime must precede endTime. |
5066 */ | |
5067 core.String endTime; | 5144 core.String endTime; |
5068 /** | 5145 |
5069 * Response body in HTML format. Gmail will sanitize the HTML before storing | 5146 /// Response body in HTML format. Gmail will sanitize the HTML before storing |
5070 * it. | 5147 /// it. |
5071 */ | |
5072 core.String responseBodyHtml; | 5148 core.String responseBodyHtml; |
5073 /** Response body in plain text format. */ | 5149 |
| 5150 /// Response body in plain text format. |
5074 core.String responseBodyPlainText; | 5151 core.String responseBodyPlainText; |
5075 /** | 5152 |
5076 * Optional text to prepend to the subject line in vacation responses. In | 5153 /// Optional text to prepend to the subject line in vacation responses. In |
5077 * order to enable auto-replies, either the response subject or the response | 5154 /// order to enable auto-replies, either the response subject or the response |
5078 * body must be nonempty. | 5155 /// body must be nonempty. |
5079 */ | |
5080 core.String responseSubject; | 5156 core.String responseSubject; |
5081 /** | 5157 |
5082 * Flag that determines whether responses are sent to recipients who are not | 5158 /// Flag that determines whether responses are sent to recipients who are not |
5083 * in the user's list of contacts. | 5159 /// in the user's list of contacts. |
5084 */ | |
5085 core.bool restrictToContacts; | 5160 core.bool restrictToContacts; |
5086 /** | 5161 |
5087 * Flag that determines whether responses are sent to recipients who are | 5162 /// Flag that determines whether responses are sent to recipients who are |
5088 * outside of the user's domain. This feature is only available for G Suite | 5163 /// outside of the user's domain. This feature is only available for G Suite |
5089 * users. | 5164 /// users. |
5090 */ | |
5091 core.bool restrictToDomain; | 5165 core.bool restrictToDomain; |
5092 /** | 5166 |
5093 * An optional start time for sending auto-replies (epoch ms). When this is | 5167 /// An optional start time for sending auto-replies (epoch ms). When this is |
5094 * specified, Gmail will automatically reply only to messages that it receives | 5168 /// specified, Gmail will automatically reply only to messages that it |
5095 * after the start time. If both startTime and endTime are specified, | 5169 /// receives after the start time. If both startTime and endTime are |
5096 * startTime must precede endTime. | 5170 /// specified, startTime must precede endTime. |
5097 */ | |
5098 core.String startTime; | 5171 core.String startTime; |
5099 | 5172 |
5100 VacationSettings(); | 5173 VacationSettings(); |
5101 | 5174 |
5102 VacationSettings.fromJson(core.Map _json) { | 5175 VacationSettings.fromJson(core.Map _json) { |
5103 if (_json.containsKey("enableAutoReply")) { | 5176 if (_json.containsKey("enableAutoReply")) { |
5104 enableAutoReply = _json["enableAutoReply"]; | 5177 enableAutoReply = _json["enableAutoReply"]; |
5105 } | 5178 } |
5106 if (_json.containsKey("endTime")) { | 5179 if (_json.containsKey("endTime")) { |
5107 endTime = _json["endTime"]; | 5180 endTime = _json["endTime"]; |
(...skipping 12 matching lines...) Expand all Loading... |
5120 } | 5193 } |
5121 if (_json.containsKey("restrictToDomain")) { | 5194 if (_json.containsKey("restrictToDomain")) { |
5122 restrictToDomain = _json["restrictToDomain"]; | 5195 restrictToDomain = _json["restrictToDomain"]; |
5123 } | 5196 } |
5124 if (_json.containsKey("startTime")) { | 5197 if (_json.containsKey("startTime")) { |
5125 startTime = _json["startTime"]; | 5198 startTime = _json["startTime"]; |
5126 } | 5199 } |
5127 } | 5200 } |
5128 | 5201 |
5129 core.Map<core.String, core.Object> toJson() { | 5202 core.Map<core.String, core.Object> toJson() { |
5130 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5203 final core.Map<core.String, core.Object> _json = |
| 5204 new core.Map<core.String, core.Object>(); |
5131 if (enableAutoReply != null) { | 5205 if (enableAutoReply != null) { |
5132 _json["enableAutoReply"] = enableAutoReply; | 5206 _json["enableAutoReply"] = enableAutoReply; |
5133 } | 5207 } |
5134 if (endTime != null) { | 5208 if (endTime != null) { |
5135 _json["endTime"] = endTime; | 5209 _json["endTime"] = endTime; |
5136 } | 5210 } |
5137 if (responseBodyHtml != null) { | 5211 if (responseBodyHtml != null) { |
5138 _json["responseBodyHtml"] = responseBodyHtml; | 5212 _json["responseBodyHtml"] = responseBodyHtml; |
5139 } | 5213 } |
5140 if (responseBodyPlainText != null) { | 5214 if (responseBodyPlainText != null) { |
5141 _json["responseBodyPlainText"] = responseBodyPlainText; | 5215 _json["responseBodyPlainText"] = responseBodyPlainText; |
5142 } | 5216 } |
5143 if (responseSubject != null) { | 5217 if (responseSubject != null) { |
5144 _json["responseSubject"] = responseSubject; | 5218 _json["responseSubject"] = responseSubject; |
5145 } | 5219 } |
5146 if (restrictToContacts != null) { | 5220 if (restrictToContacts != null) { |
5147 _json["restrictToContacts"] = restrictToContacts; | 5221 _json["restrictToContacts"] = restrictToContacts; |
5148 } | 5222 } |
5149 if (restrictToDomain != null) { | 5223 if (restrictToDomain != null) { |
5150 _json["restrictToDomain"] = restrictToDomain; | 5224 _json["restrictToDomain"] = restrictToDomain; |
5151 } | 5225 } |
5152 if (startTime != null) { | 5226 if (startTime != null) { |
5153 _json["startTime"] = startTime; | 5227 _json["startTime"] = startTime; |
5154 } | 5228 } |
5155 return _json; | 5229 return _json; |
5156 } | 5230 } |
5157 } | 5231 } |
5158 | 5232 |
5159 /** Set up or update a new push notification watch on this user's mailbox. */ | 5233 /// Set up or update a new push notification watch on this user's mailbox. |
5160 class WatchRequest { | 5234 class WatchRequest { |
5161 /** | 5235 /// Filtering behavior of labelIds list specified. |
5162 * Filtering behavior of labelIds list specified. | 5236 /// Possible string values are: |
5163 * Possible string values are: | 5237 /// - "exclude" |
5164 * - "exclude" | 5238 /// - "include" |
5165 * - "include" | |
5166 */ | |
5167 core.String labelFilterAction; | 5239 core.String labelFilterAction; |
5168 /** | 5240 |
5169 * List of label_ids to restrict notifications about. By default, if | 5241 /// List of label_ids to restrict notifications about. By default, if |
5170 * unspecified, all changes are pushed out. If specified then dictates which | 5242 /// unspecified, all changes are pushed out. If specified then dictates which |
5171 * labels are required for a push notification to be generated. | 5243 /// labels are required for a push notification to be generated. |
5172 */ | |
5173 core.List<core.String> labelIds; | 5244 core.List<core.String> labelIds; |
5174 /** | 5245 |
5175 * A fully qualified Google Cloud Pub/Sub API topic name to publish the events | 5246 /// A fully qualified Google Cloud Pub/Sub API topic name to publish the |
5176 * to. This topic name **must** already exist in Cloud Pub/Sub and you | 5247 /// events to. This topic name **must** already exist in Cloud Pub/Sub and |
5177 * **must** have already granted gmail "publish" permission on it. For | 5248 /// you **must** have already granted gmail "publish" permission on it. For |
5178 * example, "projects/my-project-identifier/topics/my-topic-name" (using the | 5249 /// example, "projects/my-project-identifier/topics/my-topic-name" (using the |
5179 * Cloud Pub/Sub "v1" topic naming format). | 5250 /// Cloud Pub/Sub "v1" topic naming format). |
5180 * | 5251 /// |
5181 * Note that the "my-project-identifier" portion must exactly match your | 5252 /// Note that the "my-project-identifier" portion must exactly match your |
5182 * Google developer project id (the one executing this watch request). | 5253 /// Google developer project id (the one executing this watch request). |
5183 */ | |
5184 core.String topicName; | 5254 core.String topicName; |
5185 | 5255 |
5186 WatchRequest(); | 5256 WatchRequest(); |
5187 | 5257 |
5188 WatchRequest.fromJson(core.Map _json) { | 5258 WatchRequest.fromJson(core.Map _json) { |
5189 if (_json.containsKey("labelFilterAction")) { | 5259 if (_json.containsKey("labelFilterAction")) { |
5190 labelFilterAction = _json["labelFilterAction"]; | 5260 labelFilterAction = _json["labelFilterAction"]; |
5191 } | 5261 } |
5192 if (_json.containsKey("labelIds")) { | 5262 if (_json.containsKey("labelIds")) { |
5193 labelIds = _json["labelIds"]; | 5263 labelIds = _json["labelIds"]; |
5194 } | 5264 } |
5195 if (_json.containsKey("topicName")) { | 5265 if (_json.containsKey("topicName")) { |
5196 topicName = _json["topicName"]; | 5266 topicName = _json["topicName"]; |
5197 } | 5267 } |
5198 } | 5268 } |
5199 | 5269 |
5200 core.Map<core.String, core.Object> toJson() { | 5270 core.Map<core.String, core.Object> toJson() { |
5201 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5271 final core.Map<core.String, core.Object> _json = |
| 5272 new core.Map<core.String, core.Object>(); |
5202 if (labelFilterAction != null) { | 5273 if (labelFilterAction != null) { |
5203 _json["labelFilterAction"] = labelFilterAction; | 5274 _json["labelFilterAction"] = labelFilterAction; |
5204 } | 5275 } |
5205 if (labelIds != null) { | 5276 if (labelIds != null) { |
5206 _json["labelIds"] = labelIds; | 5277 _json["labelIds"] = labelIds; |
5207 } | 5278 } |
5208 if (topicName != null) { | 5279 if (topicName != null) { |
5209 _json["topicName"] = topicName; | 5280 _json["topicName"] = topicName; |
5210 } | 5281 } |
5211 return _json; | 5282 return _json; |
5212 } | 5283 } |
5213 } | 5284 } |
5214 | 5285 |
5215 /** Push notification watch response. */ | 5286 /// Push notification watch response. |
5216 class WatchResponse { | 5287 class WatchResponse { |
5217 /** | 5288 /// When Gmail will stop sending notifications for mailbox updates (epoch |
5218 * When Gmail will stop sending notifications for mailbox updates (epoch | 5289 /// millis). Call watch again before this time to renew the watch. |
5219 * millis). Call watch again before this time to renew the watch. | |
5220 */ | |
5221 core.String expiration; | 5290 core.String expiration; |
5222 /** The ID of the mailbox's current history record. */ | 5291 |
| 5292 /// The ID of the mailbox's current history record. |
5223 core.String historyId; | 5293 core.String historyId; |
5224 | 5294 |
5225 WatchResponse(); | 5295 WatchResponse(); |
5226 | 5296 |
5227 WatchResponse.fromJson(core.Map _json) { | 5297 WatchResponse.fromJson(core.Map _json) { |
5228 if (_json.containsKey("expiration")) { | 5298 if (_json.containsKey("expiration")) { |
5229 expiration = _json["expiration"]; | 5299 expiration = _json["expiration"]; |
5230 } | 5300 } |
5231 if (_json.containsKey("historyId")) { | 5301 if (_json.containsKey("historyId")) { |
5232 historyId = _json["historyId"]; | 5302 historyId = _json["historyId"]; |
5233 } | 5303 } |
5234 } | 5304 } |
5235 | 5305 |
5236 core.Map<core.String, core.Object> toJson() { | 5306 core.Map<core.String, core.Object> toJson() { |
5237 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5307 final core.Map<core.String, core.Object> _json = |
| 5308 new core.Map<core.String, core.Object>(); |
5238 if (expiration != null) { | 5309 if (expiration != null) { |
5239 _json["expiration"] = expiration; | 5310 _json["expiration"] = expiration; |
5240 } | 5311 } |
5241 if (historyId != null) { | 5312 if (historyId != null) { |
5242 _json["historyId"] = historyId; | 5313 _json["historyId"] = historyId; |
5243 } | 5314 } |
5244 return _json; | 5315 return _json; |
5245 } | 5316 } |
5246 } | 5317 } |
OLD | NEW |