blob: abb2d219b5078e08e3d608eeacde6ee03c900816 [file] [log] [blame]
Craig Citro065b5302014-08-14 00:47:23 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="gmail_v1.html">Gmail API</a> . <a href="gmail_v1.users.html">users</a> . <a href="gmail_v1.users.messages.html">messages</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="gmail_v1.users.messages.attachments.html">attachments()</a></code>
79</p>
80<p class="firstline">Returns the attachments Resource.</p>
81
82<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070083 <code><a href="#batchDelete">batchDelete(userId, body=None, x__xgafv=None)</a></code></p>
84<p class="firstline">Deletes many messages by message ID. Provides no guarantees that messages</p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070085<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070086 <code><a href="#batchModify">batchModify(userId, body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080087<p class="firstline">Modifies the labels on the specified messages.</p>
88<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070089 <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
90<p class="firstline">Immediately and permanently deletes the specified message. This operation</p>
Craig Citro065b5302014-08-14 00:47:23 -070091<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070092 <code><a href="#get">get(userId, id, format=None, x__xgafv=None, metadataHeaders=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070093<p class="firstline">Gets the specified message.</p>
94<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070095 <code><a href="#import_">import_(userId, body=None, internalDateSource=None, neverMarkSpam=None, x__xgafv=None, media_body=None, deleted=None, media_mime_type=None, processForCalendar=None)</a></code></p>
96<p class="firstline">Imports a message into only this user's mailbox, with standard</p>
Craig Citro065b5302014-08-14 00:47:23 -070097<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070098 <code><a href="#insert">insert(userId, body=None, internalDateSource=None, media_body=None, deleted=None, x__xgafv=None, media_mime_type=None)</a></code></p>
99<p class="firstline">Directly inserts a message into only this user's mailbox similar to</p>
Craig Citro065b5302014-08-14 00:47:23 -0700100<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700101 <code><a href="#list">list(userId, labelIds=None, pageToken=None, includeSpamTrash=None, maxResults=None, q=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -0700102<p class="firstline">Lists the messages in the user's mailbox.</p>
103<p class="toc_element">
104 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
105<p class="firstline">Retrieves the next page of results.</p>
106<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700107 <code><a href="#modify">modify(userId, id, body=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -0700108<p class="firstline">Modifies the labels on the specified message.</p>
109<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700110 <code><a href="#send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</a></code></p>
111<p class="firstline">Sends the specified message to the recipients in the</p>
Craig Citro065b5302014-08-14 00:47:23 -0700112<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700113 <code><a href="#trash">trash(userId, id, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -0700114<p class="firstline">Moves the specified message to the trash.</p>
115<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700116 <code><a href="#untrash">untrash(userId, id, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -0700117<p class="firstline">Removes the specified message from the trash.</p>
118<h3>Method Details</h3>
119<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 <code class="details" id="batchDelete">batchDelete(userId, body=None, x__xgafv=None)</code>
121 <pre>Deletes many messages by message ID. Provides no guarantees that messages
122were not already deleted or even existed at all.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700123
124Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700125 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
126can be used to indicate the authenticated user. (required)
127 body: object, The request body.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700128 The object takes the form of:
129
130{
131 "ids": [ # The IDs of the messages to delete.
132 "A String",
133 ],
134 }
135
Dan O'Mearadd494642020-05-01 07:42:23 -0700136 x__xgafv: string, V1 error format.
137 Allowed values
138 1 - v1 error format
139 2 - v2 error format
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700140</pre>
141</div>
142
143<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700144 <code class="details" id="batchModify">batchModify(userId, body=None, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800145 <pre>Modifies the labels on the specified messages.
146
147Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700148 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
149can be used to indicate the authenticated user. (required)
150 body: object, The request body.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800151 The object takes the form of:
152
153{
154 "removeLabelIds": [ # A list of label IDs to remove from messages.
155 "A String",
156 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700157 "ids": [ # The IDs of the messages to modify. There is a limit of 1000 ids per
158 # request.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800159 "A String",
160 ],
161 "addLabelIds": [ # A list of label IDs to add to messages.
162 "A String",
163 ],
164 }
165
Dan O'Mearadd494642020-05-01 07:42:23 -0700166 x__xgafv: string, V1 error format.
167 Allowed values
168 1 - v1 error format
169 2 - v2 error format
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800170</pre>
171</div>
172
173<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700174 <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
175 <pre>Immediately and permanently deletes the specified message. This operation
176cannot be undone. Prefer &lt;code&gt;messages.trash&lt;/code&gt; instead.
Craig Citro065b5302014-08-14 00:47:23 -0700177
178Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700179 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
180can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700181 id: string, The ID of the message to delete. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700182 x__xgafv: string, V1 error format.
183 Allowed values
184 1 - v1 error format
185 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700186</pre>
187</div>
188
189<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700190 <code class="details" id="get">get(userId, id, format=None, x__xgafv=None, metadataHeaders=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700191 <pre>Gets the specified message.
192
193Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700194 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
195can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700196 id: string, The ID of the message to retrieve. (required)
197 format: string, The format to return the message in.
Dan O'Mearadd494642020-05-01 07:42:23 -0700198 x__xgafv: string, V1 error format.
Craig Citro065b5302014-08-14 00:47:23 -0700199 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -0700200 1 - v1 error format
201 2 - v2 error format
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700202 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700203
204Returns:
205 An object of the form:
206
207 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700208 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
209 # ordering in the inbox. For normal SMTP-received email, this represents the
210 # time the message was originally accepted by Google, which is more reliable
211 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
212 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700213 "historyId": "A String", # The ID of the last history record that modified this message.
214 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700215 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
216 # container MIME message parts.
217 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
218 # May be empty for MIME container
219 # types that have no message body or when the body data is sent as a
220 # separate attachment. An attachment ID is present if the body data is
221 # contained in a separate attachment.
222 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
223 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
224 # When not present, the entire content of the message part body is
225 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800226 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700227 },
228 "mimeType": "A String", # The MIME type of the message part.
229 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700230 "filename": "A String", # The filename of the attachment. Only present if this message part
231 # represents an attachment.
232 "headers": [ # List of headers on this message part. For the top-level message part,
233 # representing the entire message payload, it will contain the standard
234 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
235 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700236 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700237 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
238 # example, &lt;code&gt;To&lt;/code&gt;.
239 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
240 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700241 },
242 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700243 "parts": [ # The child MIME message parts of this part. This only applies to container
244 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
245 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
246 # field is empty. For more information, see
247 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700248 # Object with schema name: MessagePart
249 ],
250 },
251 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700252 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
253 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
254 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
255 # parameter is supplied.
256 # @mutable gmail.users.messages.insert gmail.users.messages.send
257 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700258 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700259 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
260 # a thread, the following criteria must be met:
261 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
262 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
263 # request.&lt;/li&gt;
264 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
265 # be set in compliance with the
266 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
267 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
268 # @mutable gmail.users.messages.insert gmail.users.messages.send
269 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700270 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700271 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700272 "A String",
273 ],
274 "id": "A String", # The immutable ID of the message.
275 }</pre>
276</div>
277
278<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700279 <code class="details" id="import_">import_(userId, body=None, internalDateSource=None, neverMarkSpam=None, x__xgafv=None, media_body=None, deleted=None, media_mime_type=None, processForCalendar=None)</code>
280 <pre>Imports a message into only this user's mailbox, with standard
281email delivery scanning and classification similar to receiving via SMTP.
282Does not send a message.
Craig Citro065b5302014-08-14 00:47:23 -0700283
284Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700285 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
286can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700287 body: object, The request body.
288 The object takes the form of:
289
290{ # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700291 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
292 # ordering in the inbox. For normal SMTP-received email, this represents the
293 # time the message was originally accepted by Google, which is more reliable
294 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
295 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700296 "historyId": "A String", # The ID of the last history record that modified this message.
297 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700298 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
299 # container MIME message parts.
300 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
301 # May be empty for MIME container
302 # types that have no message body or when the body data is sent as a
303 # separate attachment. An attachment ID is present if the body data is
304 # contained in a separate attachment.
305 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
306 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
307 # When not present, the entire content of the message part body is
308 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800309 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700310 },
311 "mimeType": "A String", # The MIME type of the message part.
312 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700313 "filename": "A String", # The filename of the attachment. Only present if this message part
314 # represents an attachment.
315 "headers": [ # List of headers on this message part. For the top-level message part,
316 # representing the entire message payload, it will contain the standard
317 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
318 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700319 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700320 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
321 # example, &lt;code&gt;To&lt;/code&gt;.
322 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
323 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700324 },
325 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700326 "parts": [ # The child MIME message parts of this part. This only applies to container
327 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
328 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
329 # field is empty. For more information, see
330 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700331 # Object with schema name: MessagePart
332 ],
333 },
334 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700335 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
336 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
337 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
338 # parameter is supplied.
339 # @mutable gmail.users.messages.insert gmail.users.messages.send
340 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700341 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700342 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
343 # a thread, the following criteria must be met:
344 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
345 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
346 # request.&lt;/li&gt;
347 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
348 # be set in compliance with the
349 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
350 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
351 # @mutable gmail.users.messages.insert gmail.users.messages.send
352 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700353 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700354 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700355 "A String",
356 ],
357 "id": "A String", # The immutable ID of the message.
358}
359
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700360 internalDateSource: string, Source for Gmail's internal date of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700361 neverMarkSpam: boolean, Ignore the Gmail spam classifier decision and never mark
362this email as SPAM in the mailbox.
363 x__xgafv: string, V1 error format.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700364 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -0700365 1 - v1 error format
366 2 - v2 error format
367 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
368 deleted: boolean, Mark the email as permanently deleted (not TRASH) and
369only visible in
370&lt;a href="http://support.google.com/vault/"&gt;Google Vault&lt;/a&gt; to
371a Vault administrator. Only used for G Suite accounts.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800372 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Dan O'Mearadd494642020-05-01 07:42:23 -0700373 processForCalendar: boolean, Process calendar invites in the email and add any extracted
374meetings to the Google Calendar for this user.
Craig Citro065b5302014-08-14 00:47:23 -0700375
376Returns:
377 An object of the form:
378
379 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700380 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
381 # ordering in the inbox. For normal SMTP-received email, this represents the
382 # time the message was originally accepted by Google, which is more reliable
383 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
384 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700385 "historyId": "A String", # The ID of the last history record that modified this message.
386 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700387 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
388 # container MIME message parts.
389 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
390 # May be empty for MIME container
391 # types that have no message body or when the body data is sent as a
392 # separate attachment. An attachment ID is present if the body data is
393 # contained in a separate attachment.
394 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
395 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
396 # When not present, the entire content of the message part body is
397 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800398 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700399 },
400 "mimeType": "A String", # The MIME type of the message part.
401 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700402 "filename": "A String", # The filename of the attachment. Only present if this message part
403 # represents an attachment.
404 "headers": [ # List of headers on this message part. For the top-level message part,
405 # representing the entire message payload, it will contain the standard
406 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
407 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700408 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700409 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
410 # example, &lt;code&gt;To&lt;/code&gt;.
411 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
412 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700413 },
414 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700415 "parts": [ # The child MIME message parts of this part. This only applies to container
416 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
417 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
418 # field is empty. For more information, see
419 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700420 # Object with schema name: MessagePart
421 ],
422 },
423 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700424 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
425 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
426 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
427 # parameter is supplied.
428 # @mutable gmail.users.messages.insert gmail.users.messages.send
429 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700430 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700431 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
432 # a thread, the following criteria must be met:
433 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
434 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
435 # request.&lt;/li&gt;
436 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
437 # be set in compliance with the
438 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
439 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
440 # @mutable gmail.users.messages.insert gmail.users.messages.send
441 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700442 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700443 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700444 "A String",
445 ],
446 "id": "A String", # The immutable ID of the message.
447 }</pre>
448</div>
449
450<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700451 <code class="details" id="insert">insert(userId, body=None, internalDateSource=None, media_body=None, deleted=None, x__xgafv=None, media_mime_type=None)</code>
452 <pre>Directly inserts a message into only this user's mailbox similar to
453&lt;code&gt;IMAP APPEND&lt;/code&gt;, bypassing most scanning and classification.
454Does not send a message.
Craig Citro065b5302014-08-14 00:47:23 -0700455
456Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700457 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
458can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700459 body: object, The request body.
460 The object takes the form of:
461
462{ # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700463 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
464 # ordering in the inbox. For normal SMTP-received email, this represents the
465 # time the message was originally accepted by Google, which is more reliable
466 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
467 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700468 "historyId": "A String", # The ID of the last history record that modified this message.
469 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700470 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
471 # container MIME message parts.
472 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
473 # May be empty for MIME container
474 # types that have no message body or when the body data is sent as a
475 # separate attachment. An attachment ID is present if the body data is
476 # contained in a separate attachment.
477 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
478 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
479 # When not present, the entire content of the message part body is
480 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800481 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700482 },
483 "mimeType": "A String", # The MIME type of the message part.
484 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700485 "filename": "A String", # The filename of the attachment. Only present if this message part
486 # represents an attachment.
487 "headers": [ # List of headers on this message part. For the top-level message part,
488 # representing the entire message payload, it will contain the standard
489 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
490 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700491 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700492 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
493 # example, &lt;code&gt;To&lt;/code&gt;.
494 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
495 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700496 },
497 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700498 "parts": [ # The child MIME message parts of this part. This only applies to container
499 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
500 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
501 # field is empty. For more information, see
502 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700503 # Object with schema name: MessagePart
504 ],
505 },
506 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700507 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
508 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
509 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
510 # parameter is supplied.
511 # @mutable gmail.users.messages.insert gmail.users.messages.send
512 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700513 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700514 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
515 # a thread, the following criteria must be met:
516 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
517 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
518 # request.&lt;/li&gt;
519 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
520 # be set in compliance with the
521 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
522 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
523 # @mutable gmail.users.messages.insert gmail.users.messages.send
524 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700525 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700526 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700527 "A String",
528 ],
529 "id": "A String", # The immutable ID of the message.
530}
531
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700532 internalDateSource: string, Source for Gmail's internal date of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700533 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
534 deleted: boolean, Mark the email as permanently deleted (not TRASH) and
535only visible in
536&lt;a href="http://support.google.com/vault/"&gt;Google Vault&lt;/a&gt; to
537a Vault administrator. Only used for G Suite accounts.
538 x__xgafv: string, V1 error format.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700539 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -0700540 1 - v1 error format
541 2 - v2 error format
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800542 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Craig Citro065b5302014-08-14 00:47:23 -0700543
544Returns:
545 An object of the form:
546
547 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700548 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
549 # ordering in the inbox. For normal SMTP-received email, this represents the
550 # time the message was originally accepted by Google, which is more reliable
551 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
552 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700553 "historyId": "A String", # The ID of the last history record that modified this message.
554 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700555 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
556 # container MIME message parts.
557 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
558 # May be empty for MIME container
559 # types that have no message body or when the body data is sent as a
560 # separate attachment. An attachment ID is present if the body data is
561 # contained in a separate attachment.
562 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
563 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
564 # When not present, the entire content of the message part body is
565 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800566 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700567 },
568 "mimeType": "A String", # The MIME type of the message part.
569 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700570 "filename": "A String", # The filename of the attachment. Only present if this message part
571 # represents an attachment.
572 "headers": [ # List of headers on this message part. For the top-level message part,
573 # representing the entire message payload, it will contain the standard
574 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
575 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700576 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700577 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
578 # example, &lt;code&gt;To&lt;/code&gt;.
579 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
580 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700581 },
582 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700583 "parts": [ # The child MIME message parts of this part. This only applies to container
584 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
585 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
586 # field is empty. For more information, see
587 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700588 # Object with schema name: MessagePart
589 ],
590 },
591 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700592 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
593 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
594 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
595 # parameter is supplied.
596 # @mutable gmail.users.messages.insert gmail.users.messages.send
597 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700598 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700599 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
600 # a thread, the following criteria must be met:
601 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
602 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
603 # request.&lt;/li&gt;
604 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
605 # be set in compliance with the
606 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
607 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
608 # @mutable gmail.users.messages.insert gmail.users.messages.send
609 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700610 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700611 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700612 "A String",
613 ],
614 "id": "A String", # The immutable ID of the message.
615 }</pre>
616</div>
617
618<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700619 <code class="details" id="list">list(userId, labelIds=None, pageToken=None, includeSpamTrash=None, maxResults=None, q=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700620 <pre>Lists the messages in the user's mailbox.
621
622Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700623 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
624can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700625 labelIds: string, Only return messages with labels that match all of the specified label IDs. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700626 pageToken: string, Page token to retrieve a specific page of results in the list.
Dan O'Mearadd494642020-05-01 07:42:23 -0700627 includeSpamTrash: boolean, Include messages from &lt;code&gt;SPAM&lt;/code&gt; and &lt;code&gt;TRASH&lt;/code&gt;
628in the results.
Craig Citro065b5302014-08-14 00:47:23 -0700629 maxResults: integer, Maximum number of messages to return.
Dan O'Mearadd494642020-05-01 07:42:23 -0700630 q: string, Only return messages matching the specified query. Supports the same
631query format as the Gmail search box. For example,
632&lt;code&gt;"from:someuser@example.com rfc822msgid:&amp;lt;somemsgid@example.com&amp;gt;
633is:unread"&lt;/code&gt;. Parameter cannot be used when accessing the api
634using the gmail.metadata scope.
635 x__xgafv: string, V1 error format.
636 Allowed values
637 1 - v1 error format
638 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700639
640Returns:
641 An object of the form:
642
643 {
644 "nextPageToken": "A String", # Token to retrieve the next page of results in the list.
645 "resultSizeEstimate": 42, # Estimated total number of results.
Dan O'Mearadd494642020-05-01 07:42:23 -0700646 "messages": [ # List of messages. Note that each message resource contains only an
647 # &lt;code&gt;id&lt;/code&gt; and a &lt;code&gt;threadId&lt;/code&gt;. Additional message details can
648 # be fetched using the
649 # &lt;a href="/gmail/api/v1/reference/users/messages/get"&gt;messages.get&lt;/a&gt;
650 # method.
Craig Citro065b5302014-08-14 00:47:23 -0700651 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700652 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
653 # ordering in the inbox. For normal SMTP-received email, this represents the
654 # time the message was originally accepted by Google, which is more reliable
655 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
656 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700657 "historyId": "A String", # The ID of the last history record that modified this message.
658 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700659 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
660 # container MIME message parts.
661 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
662 # May be empty for MIME container
663 # types that have no message body or when the body data is sent as a
664 # separate attachment. An attachment ID is present if the body data is
665 # contained in a separate attachment.
666 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
667 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
668 # When not present, the entire content of the message part body is
669 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800670 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700671 },
672 "mimeType": "A String", # The MIME type of the message part.
673 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700674 "filename": "A String", # The filename of the attachment. Only present if this message part
675 # represents an attachment.
676 "headers": [ # List of headers on this message part. For the top-level message part,
677 # representing the entire message payload, it will contain the standard
678 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
679 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700680 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700681 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
682 # example, &lt;code&gt;To&lt;/code&gt;.
683 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
684 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700685 },
686 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700687 "parts": [ # The child MIME message parts of this part. This only applies to container
688 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
689 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
690 # field is empty. For more information, see
691 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700692 # Object with schema name: MessagePart
693 ],
694 },
695 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700696 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
697 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
698 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
699 # parameter is supplied.
700 # @mutable gmail.users.messages.insert gmail.users.messages.send
701 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700702 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700703 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
704 # a thread, the following criteria must be met:
705 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
706 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
707 # request.&lt;/li&gt;
708 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
709 # be set in compliance with the
710 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
711 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
712 # @mutable gmail.users.messages.insert gmail.users.messages.send
713 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700714 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700715 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700716 "A String",
717 ],
718 "id": "A String", # The immutable ID of the message.
719 },
720 ],
721 }</pre>
722</div>
723
724<div class="method">
725 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
726 <pre>Retrieves the next page of results.
727
728Args:
729 previous_request: The request for the previous page. (required)
730 previous_response: The response from the request for the previous page. (required)
731
732Returns:
733 A request object that you can call 'execute()' on to request the next
734 page. Returns None if there are no more items in the collection.
735 </pre>
736</div>
737
738<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700739 <code class="details" id="modify">modify(userId, id, body=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700740 <pre>Modifies the labels on the specified message.
741
742Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700743 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
744can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700745 id: string, The ID of the message to modify. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700746 body: object, The request body.
Craig Citro065b5302014-08-14 00:47:23 -0700747 The object takes the form of:
748
749{
750 "removeLabelIds": [ # A list IDs of labels to remove from this message.
751 "A String",
752 ],
753 "addLabelIds": [ # A list of IDs of labels to add to this message.
754 "A String",
755 ],
756 }
757
Dan O'Mearadd494642020-05-01 07:42:23 -0700758 x__xgafv: string, V1 error format.
759 Allowed values
760 1 - v1 error format
761 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700762
763Returns:
764 An object of the form:
765
766 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700767 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
768 # ordering in the inbox. For normal SMTP-received email, this represents the
769 # time the message was originally accepted by Google, which is more reliable
770 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
771 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700772 "historyId": "A String", # The ID of the last history record that modified this message.
773 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700774 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
775 # container MIME message parts.
776 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
777 # May be empty for MIME container
778 # types that have no message body or when the body data is sent as a
779 # separate attachment. An attachment ID is present if the body data is
780 # contained in a separate attachment.
781 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
782 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
783 # When not present, the entire content of the message part body is
784 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800785 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700786 },
787 "mimeType": "A String", # The MIME type of the message part.
788 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700789 "filename": "A String", # The filename of the attachment. Only present if this message part
790 # represents an attachment.
791 "headers": [ # List of headers on this message part. For the top-level message part,
792 # representing the entire message payload, it will contain the standard
793 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
794 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700795 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700796 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
797 # example, &lt;code&gt;To&lt;/code&gt;.
798 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
799 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700800 },
801 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700802 "parts": [ # The child MIME message parts of this part. This only applies to container
803 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
804 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
805 # field is empty. For more information, see
806 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700807 # Object with schema name: MessagePart
808 ],
809 },
810 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700811 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
812 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
813 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
814 # parameter is supplied.
815 # @mutable gmail.users.messages.insert gmail.users.messages.send
816 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700817 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700818 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
819 # a thread, the following criteria must be met:
820 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
821 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
822 # request.&lt;/li&gt;
823 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
824 # be set in compliance with the
825 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
826 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
827 # @mutable gmail.users.messages.insert gmail.users.messages.send
828 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700829 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700830 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700831 "A String",
832 ],
833 "id": "A String", # The immutable ID of the message.
834 }</pre>
835</div>
836
837<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700838 <code class="details" id="send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</code>
839 <pre>Sends the specified message to the recipients in the
840&lt;code&gt;To&lt;/code&gt;, &lt;code&gt;Cc&lt;/code&gt;, and &lt;code&gt;Bcc&lt;/code&gt; headers.
Craig Citro065b5302014-08-14 00:47:23 -0700841
842Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700843 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
844can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700845 body: object, The request body.
846 The object takes the form of:
847
848{ # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700849 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
850 # ordering in the inbox. For normal SMTP-received email, this represents the
851 # time the message was originally accepted by Google, which is more reliable
852 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
853 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700854 "historyId": "A String", # The ID of the last history record that modified this message.
855 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700856 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
857 # container MIME message parts.
858 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
859 # May be empty for MIME container
860 # types that have no message body or when the body data is sent as a
861 # separate attachment. An attachment ID is present if the body data is
862 # contained in a separate attachment.
863 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
864 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
865 # When not present, the entire content of the message part body is
866 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800867 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700868 },
869 "mimeType": "A String", # The MIME type of the message part.
870 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700871 "filename": "A String", # The filename of the attachment. Only present if this message part
872 # represents an attachment.
873 "headers": [ # List of headers on this message part. For the top-level message part,
874 # representing the entire message payload, it will contain the standard
875 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
876 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700877 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700878 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
879 # example, &lt;code&gt;To&lt;/code&gt;.
880 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
881 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700882 },
883 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700884 "parts": [ # The child MIME message parts of this part. This only applies to container
885 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
886 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
887 # field is empty. For more information, see
888 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700889 # Object with schema name: MessagePart
890 ],
891 },
892 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700893 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
894 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
895 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
896 # parameter is supplied.
897 # @mutable gmail.users.messages.insert gmail.users.messages.send
898 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700899 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700900 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
901 # a thread, the following criteria must be met:
902 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
903 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
904 # request.&lt;/li&gt;
905 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
906 # be set in compliance with the
907 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
908 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
909 # @mutable gmail.users.messages.insert gmail.users.messages.send
910 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700911 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700912 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700913 "A String",
914 ],
915 "id": "A String", # The immutable ID of the message.
916}
917
918 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800919 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Dan O'Mearadd494642020-05-01 07:42:23 -0700920 x__xgafv: string, V1 error format.
921 Allowed values
922 1 - v1 error format
923 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700924
925Returns:
926 An object of the form:
927
928 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700929 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
930 # ordering in the inbox. For normal SMTP-received email, this represents the
931 # time the message was originally accepted by Google, which is more reliable
932 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
933 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700934 "historyId": "A String", # The ID of the last history record that modified this message.
935 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700936 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
937 # container MIME message parts.
938 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
939 # May be empty for MIME container
940 # types that have no message body or when the body data is sent as a
941 # separate attachment. An attachment ID is present if the body data is
942 # contained in a separate attachment.
943 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
944 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
945 # When not present, the entire content of the message part body is
946 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800947 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700948 },
949 "mimeType": "A String", # The MIME type of the message part.
950 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700951 "filename": "A String", # The filename of the attachment. Only present if this message part
952 # represents an attachment.
953 "headers": [ # List of headers on this message part. For the top-level message part,
954 # representing the entire message payload, it will contain the standard
955 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
956 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700957 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700958 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
959 # example, &lt;code&gt;To&lt;/code&gt;.
960 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
961 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700962 },
963 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700964 "parts": [ # The child MIME message parts of this part. This only applies to container
965 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
966 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
967 # field is empty. For more information, see
968 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700969 # Object with schema name: MessagePart
970 ],
971 },
972 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700973 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
974 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
975 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
976 # parameter is supplied.
977 # @mutable gmail.users.messages.insert gmail.users.messages.send
978 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700979 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700980 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
981 # a thread, the following criteria must be met:
982 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
983 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
984 # request.&lt;/li&gt;
985 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
986 # be set in compliance with the
987 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
988 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
989 # @mutable gmail.users.messages.insert gmail.users.messages.send
990 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700991 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700992 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700993 "A String",
994 ],
995 "id": "A String", # The immutable ID of the message.
996 }</pre>
997</div>
998
999<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001000 <code class="details" id="trash">trash(userId, id, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -07001001 <pre>Moves the specified message to the trash.
1002
1003Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001004 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
1005can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -07001006 id: string, The ID of the message to Trash. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001007 x__xgafv: string, V1 error format.
1008 Allowed values
1009 1 - v1 error format
1010 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -07001011
1012Returns:
1013 An object of the form:
1014
1015 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -07001016 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
1017 # ordering in the inbox. For normal SMTP-received email, this represents the
1018 # time the message was originally accepted by Google, which is more reliable
1019 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
1020 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -07001021 "historyId": "A String", # The ID of the last history record that modified this message.
1022 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -07001023 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
1024 # container MIME message parts.
1025 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
1026 # May be empty for MIME container
1027 # types that have no message body or when the body data is sent as a
1028 # separate attachment. An attachment ID is present if the body data is
1029 # contained in a separate attachment.
1030 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
1031 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
1032 # When not present, the entire content of the message part body is
1033 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001034 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -07001035 },
1036 "mimeType": "A String", # The MIME type of the message part.
1037 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -07001038 "filename": "A String", # The filename of the attachment. Only present if this message part
1039 # represents an attachment.
1040 "headers": [ # List of headers on this message part. For the top-level message part,
1041 # representing the entire message payload, it will contain the standard
1042 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
1043 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001044 {
Dan O'Mearadd494642020-05-01 07:42:23 -07001045 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
1046 # example, &lt;code&gt;To&lt;/code&gt;.
1047 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
1048 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001049 },
1050 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001051 "parts": [ # The child MIME message parts of this part. This only applies to container
1052 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
1053 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
1054 # field is empty. For more information, see
1055 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001056 # Object with schema name: MessagePart
1057 ],
1058 },
1059 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -07001060 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
1061 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
1062 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
1063 # parameter is supplied.
1064 # @mutable gmail.users.messages.insert gmail.users.messages.send
1065 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -07001066 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -07001067 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
1068 # a thread, the following criteria must be met:
1069 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
1070 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
1071 # request.&lt;/li&gt;
1072 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
1073 # be set in compliance with the
1074 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
1075 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
1076 # @mutable gmail.users.messages.insert gmail.users.messages.send
1077 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -07001078 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -07001079 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -07001080 "A String",
1081 ],
1082 "id": "A String", # The immutable ID of the message.
1083 }</pre>
1084</div>
1085
1086<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001087 <code class="details" id="untrash">untrash(userId, id, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -07001088 <pre>Removes the specified message from the trash.
1089
1090Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001091 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
1092can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -07001093 id: string, The ID of the message to remove from Trash. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001094 x__xgafv: string, V1 error format.
1095 Allowed values
1096 1 - v1 error format
1097 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -07001098
1099Returns:
1100 An object of the form:
1101
1102 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -07001103 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
1104 # ordering in the inbox. For normal SMTP-received email, this represents the
1105 # time the message was originally accepted by Google, which is more reliable
1106 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
1107 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -07001108 "historyId": "A String", # The ID of the last history record that modified this message.
1109 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -07001110 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
1111 # container MIME message parts.
1112 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
1113 # May be empty for MIME container
1114 # types that have no message body or when the body data is sent as a
1115 # separate attachment. An attachment ID is present if the body data is
1116 # contained in a separate attachment.
1117 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
1118 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
1119 # When not present, the entire content of the message part body is
1120 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001121 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -07001122 },
1123 "mimeType": "A String", # The MIME type of the message part.
1124 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -07001125 "filename": "A String", # The filename of the attachment. Only present if this message part
1126 # represents an attachment.
1127 "headers": [ # List of headers on this message part. For the top-level message part,
1128 # representing the entire message payload, it will contain the standard
1129 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
1130 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001131 {
Dan O'Mearadd494642020-05-01 07:42:23 -07001132 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
1133 # example, &lt;code&gt;To&lt;/code&gt;.
1134 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
1135 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001136 },
1137 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001138 "parts": [ # The child MIME message parts of this part. This only applies to container
1139 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
1140 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
1141 # field is empty. For more information, see
1142 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001143 # Object with schema name: MessagePart
1144 ],
1145 },
1146 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -07001147 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
1148 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
1149 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
1150 # parameter is supplied.
1151 # @mutable gmail.users.messages.insert gmail.users.messages.send
1152 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -07001153 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -07001154 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
1155 # a thread, the following criteria must be met:
1156 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
1157 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
1158 # request.&lt;/li&gt;
1159 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
1160 # be set in compliance with the
1161 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
1162 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
1163 # @mutable gmail.users.messages.insert gmail.users.messages.send
1164 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -07001165 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -07001166 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -07001167 "A String",
1168 ],
1169 "id": "A String", # The immutable ID of the message.
1170 }</pre>
1171</div>
1172
1173</body></html>