blob: e4913d257eaddf87fa4f7f3a383d99497044b242 [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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070092 <code><a href="#get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070095 <code><a href="#import_">import_(userId, body=None, deleted=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, x__xgafv=None, media_body=None, media_mime_type=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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070098 <code><a href="#insert">insert(userId, body=None, internalDateSource=None, deleted=None, x__xgafv=None, media_body=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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700101 <code><a href="#list">list(userId, maxResults=None, labelIds=None, includeSpamTrash=None, pageToken=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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700110 <code><a href="#send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700125 userId: string, The user&#x27;s email address. The special value `me`
126can be used to indicate the authenticated user. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700127 body: object, The request body.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700128 The object takes the form of:
129
130{
Bu Sun Kim65020912020-05-20 12:08:20 -0700131 &quot;ids&quot;: [ # The IDs of the messages to delete.
132 &quot;A String&quot;,
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700133 ],
134 }
135
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700148 userId: string, The user&#x27;s email address. The special value `me`
149can be used to indicate the authenticated user. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700150 body: object, The request body.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800151 The object takes the form of:
152
153{
Bu Sun Kim65020912020-05-20 12:08:20 -0700154 &quot;addLabelIds&quot;: [ # A list of label IDs to add to messages.
155 &quot;A String&quot;,
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800156 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700157 &quot;removeLabelIds&quot;: [ # A list of label IDs to remove from messages.
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 &quot;A String&quot;,
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800159 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700160 &quot;ids&quot;: [ # The IDs of the messages to modify. There is a limit of 1000 ids per
161 # request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700162 &quot;A String&quot;,
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800163 ],
164 }
165
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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 `messages.trash` instead.
Craig Citro065b5302014-08-14 00:47:23 -0700177
178Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700179 userId: string, The user&#x27;s email address. The special value `me`
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)
Bu Sun Kimd059ad82020-07-22 17:02:09 -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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700190 <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700191 <pre>Gets the specified message.
192
193Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700194 userId: string, The user&#x27;s email address. The special value `me`
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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700198 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700199 x__xgafv: string, V1 error format.
200 Allowed values
201 1 - v1 error format
202 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700203
204Returns:
205 An object of the form:
206
207 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700208 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
209 # a thread, the following criteria must be met:
210 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
211 # `Message` or `Draft.Message` you supply with your
212 # request.&lt;/li&gt;
213 # &lt;li&gt;The `References` and `In-Reply-To` headers must
214 # be set in compliance with the
215 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
216 # &lt;li&gt;The `Subject` headers must match.
217 # @mutable gmail.users.messages.insert gmail.users.messages.send
218 # @mutable gmail.users.drafts.create gmail.users.drafts.update
219 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
220 # ordering in the inbox. For normal SMTP-received email, this represents the
221 # time the message was originally accepted by Google, which is more reliable
222 # than the `Date` header. However, for API-migrated mail, it can
223 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700225 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700226 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700227 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700228 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
229 # MIME message parts, for example `multipart/*`. For non-
230 # container MIME message part types, such as `text/plain`, this
231 # field is empty. For more information, see
232 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700233 # Object with schema name: MessagePart
234 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700235 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
236 # representing the entire message payload, it will contain the standard
237 # RFC 2822 email headers such as `To`, `From`, and
238 # `Subject`.
239 {
240 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
241 # example, `To`.
242 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
243 # `someuser@example.com`.
244 },
245 ],
246 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
247 # represents an attachment.
248 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
249 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
250 # container MIME message parts.
251 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
252 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
253 # retrieved in a separate `messages.attachments.get` request.
254 # When not present, the entire content of the message part body is
255 # contained in the data field.
256 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
257 # May be empty for MIME container
258 # types that have no message body or when the body data is sent as a
259 # separate attachment. An attachment ID is present if the body data is
260 # contained in a separate attachment.
261 },
Craig Citro065b5302014-08-14 00:47:23 -0700262 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700263 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700264 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700265 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
266 # encoded string. Returned in `messages.get` and
267 # `drafts.get` responses when the `format=RAW`
268 # parameter is supplied.
269 # @mutable gmail.users.messages.insert gmail.users.messages.send
270 # @mutable gmail.users.drafts.create gmail.users.drafts.update
271 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
272 # @mutable gmail.users.messages.insert gmail.users.messages.modify
273 &quot;A String&quot;,
274 ],
Craig Citro065b5302014-08-14 00:47:23 -0700275 }</pre>
276</div>
277
278<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700279 <code class="details" id="import_">import_(userId, body=None, deleted=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
280 <pre>Imports a message into only this user&#x27;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:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700285 userId: string, The user&#x27;s email address. The special value `me`
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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700291 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
292 # a thread, the following criteria must be met:
293 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
294 # `Message` or `Draft.Message` you supply with your
295 # request.&lt;/li&gt;
296 # &lt;li&gt;The `References` and `In-Reply-To` headers must
297 # be set in compliance with the
298 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
299 # &lt;li&gt;The `Subject` headers must match.
300 # @mutable gmail.users.messages.insert gmail.users.messages.send
301 # @mutable gmail.users.drafts.create gmail.users.drafts.update
302 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
303 # ordering in the inbox. For normal SMTP-received email, this represents the
304 # time the message was originally accepted by Google, which is more reliable
305 # than the `Date` header. However, for API-migrated mail, it can
306 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700307 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700308 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700309 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700310 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700311 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
312 # MIME message parts, for example `multipart/*`. For non-
313 # container MIME message part types, such as `text/plain`, this
314 # field is empty. For more information, see
315 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700316 # Object with schema name: MessagePart
317 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700318 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
319 # representing the entire message payload, it will contain the standard
320 # RFC 2822 email headers such as `To`, `From`, and
321 # `Subject`.
322 {
323 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
324 # example, `To`.
325 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
326 # `someuser@example.com`.
327 },
328 ],
329 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
330 # represents an attachment.
331 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
332 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
333 # container MIME message parts.
334 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
335 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
336 # retrieved in a separate `messages.attachments.get` request.
337 # When not present, the entire content of the message part body is
338 # contained in the data field.
339 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
340 # May be empty for MIME container
341 # types that have no message body or when the body data is sent as a
342 # separate attachment. An attachment ID is present if the body data is
343 # contained in a separate attachment.
344 },
Craig Citro065b5302014-08-14 00:47:23 -0700345 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700346 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700347 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700348 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
349 # encoded string. Returned in `messages.get` and
350 # `drafts.get` responses when the `format=RAW`
351 # parameter is supplied.
352 # @mutable gmail.users.messages.insert gmail.users.messages.send
353 # @mutable gmail.users.drafts.create gmail.users.drafts.update
354 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
355 # @mutable gmail.users.messages.insert gmail.users.messages.modify
356 &quot;A String&quot;,
357 ],
Craig Citro065b5302014-08-14 00:47:23 -0700358}
359
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700360 deleted: boolean, Mark the email as permanently deleted (not TRASH) and
361only visible in
362&lt;a href=&quot;http://support.google.com/vault/&quot;&gt;Google Vault&lt;/a&gt; to
363a Vault administrator. Only used for G Suite accounts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700364 internalDateSource: string, Source for Gmail&#x27;s internal date of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700365 neverMarkSpam: boolean, Ignore the Gmail spam classifier decision and never mark
366this email as SPAM in the mailbox.
367 processForCalendar: boolean, Process calendar invites in the email and add any extracted
368meetings to the Google Calendar for this user.
369 x__xgafv: string, V1 error format.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700370 Allowed values
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700371 1 - v1 error format
372 2 - v2 error format
Dan O'Mearadd494642020-05-01 07:42:23 -0700373 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 -0800374 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 -0700375
376Returns:
377 An object of the form:
378
379 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700380 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
381 # a thread, the following criteria must be met:
382 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
383 # `Message` or `Draft.Message` you supply with your
384 # request.&lt;/li&gt;
385 # &lt;li&gt;The `References` and `In-Reply-To` headers must
386 # be set in compliance with the
387 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
388 # &lt;li&gt;The `Subject` headers must match.
389 # @mutable gmail.users.messages.insert gmail.users.messages.send
390 # @mutable gmail.users.drafts.create gmail.users.drafts.update
391 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
392 # ordering in the inbox. For normal SMTP-received email, this represents the
393 # time the message was originally accepted by Google, which is more reliable
394 # than the `Date` header. However, for API-migrated mail, it can
395 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700396 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700397 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700398 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700399 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700400 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
401 # MIME message parts, for example `multipart/*`. For non-
402 # container MIME message part types, such as `text/plain`, this
403 # field is empty. For more information, see
404 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700405 # Object with schema name: MessagePart
406 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700407 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
408 # representing the entire message payload, it will contain the standard
409 # RFC 2822 email headers such as `To`, `From`, and
410 # `Subject`.
411 {
412 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
413 # example, `To`.
414 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
415 # `someuser@example.com`.
416 },
417 ],
418 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
419 # represents an attachment.
420 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
421 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
422 # container MIME message parts.
423 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
424 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
425 # retrieved in a separate `messages.attachments.get` request.
426 # When not present, the entire content of the message part body is
427 # contained in the data field.
428 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
429 # May be empty for MIME container
430 # types that have no message body or when the body data is sent as a
431 # separate attachment. An attachment ID is present if the body data is
432 # contained in a separate attachment.
433 },
Craig Citro065b5302014-08-14 00:47:23 -0700434 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700435 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700436 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700437 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
438 # encoded string. Returned in `messages.get` and
439 # `drafts.get` responses when the `format=RAW`
440 # parameter is supplied.
441 # @mutable gmail.users.messages.insert gmail.users.messages.send
442 # @mutable gmail.users.drafts.create gmail.users.drafts.update
443 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
444 # @mutable gmail.users.messages.insert gmail.users.messages.modify
445 &quot;A String&quot;,
446 ],
Craig Citro065b5302014-08-14 00:47:23 -0700447 }</pre>
448</div>
449
450<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700451 <code class="details" id="insert">insert(userId, body=None, internalDateSource=None, deleted=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
452 <pre>Directly inserts a message into only this user&#x27;s mailbox similar to
453`IMAP APPEND`, bypassing most scanning and classification.
454Does not send a message.
Craig Citro065b5302014-08-14 00:47:23 -0700455
456Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700457 userId: string, The user&#x27;s email address. The special value `me`
458can be used to indicate the authenticated user. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700459 body: object, The request body.
460 The object takes the form of:
461
462{ # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700463 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
464 # a thread, the following criteria must be met:
465 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
466 # `Message` or `Draft.Message` you supply with your
467 # request.&lt;/li&gt;
468 # &lt;li&gt;The `References` and `In-Reply-To` headers must
469 # be set in compliance with the
470 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
471 # &lt;li&gt;The `Subject` headers must match.
472 # @mutable gmail.users.messages.insert gmail.users.messages.send
473 # @mutable gmail.users.drafts.create gmail.users.drafts.update
474 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
475 # ordering in the inbox. For normal SMTP-received email, this represents the
476 # time the message was originally accepted by Google, which is more reliable
477 # than the `Date` header. However, for API-migrated mail, it can
478 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700479 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700480 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700481 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700482 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700483 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
484 # MIME message parts, for example `multipart/*`. For non-
485 # container MIME message part types, such as `text/plain`, this
486 # field is empty. For more information, see
487 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700488 # Object with schema name: MessagePart
489 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700490 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
491 # representing the entire message payload, it will contain the standard
492 # RFC 2822 email headers such as `To`, `From`, and
493 # `Subject`.
494 {
495 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
496 # example, `To`.
497 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
498 # `someuser@example.com`.
499 },
500 ],
501 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
502 # represents an attachment.
503 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
504 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
505 # container MIME message parts.
506 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
507 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
508 # retrieved in a separate `messages.attachments.get` request.
509 # When not present, the entire content of the message part body is
510 # contained in the data field.
511 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
512 # May be empty for MIME container
513 # types that have no message body or when the body data is sent as a
514 # separate attachment. An attachment ID is present if the body data is
515 # contained in a separate attachment.
516 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700517 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700518 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700519 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700520 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
521 # encoded string. Returned in `messages.get` and
522 # `drafts.get` responses when the `format=RAW`
523 # parameter is supplied.
524 # @mutable gmail.users.messages.insert gmail.users.messages.send
525 # @mutable gmail.users.drafts.create gmail.users.drafts.update
526 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
527 # @mutable gmail.users.messages.insert gmail.users.messages.modify
528 &quot;A String&quot;,
529 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700530}
531
Bu Sun Kim65020912020-05-20 12:08:20 -0700532 internalDateSource: string, Source for Gmail&#x27;s internal date of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700533 deleted: boolean, Mark the email as permanently deleted (not TRASH) and
534only visible in
535&lt;a href=&quot;http://support.google.com/vault/&quot;&gt;Google Vault&lt;/a&gt; to
536a Vault administrator. Only used for G Suite accounts.
537 x__xgafv: string, V1 error format.
Bu Sun Kim65020912020-05-20 12:08:20 -0700538 Allowed values
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700539 1 - v1 error format
540 2 - v2 error format
Bu Sun Kim65020912020-05-20 12:08:20 -0700541 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
542 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
543
544Returns:
545 An object of the form:
546
547 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700548 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
549 # a thread, the following criteria must be met:
550 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
551 # `Message` or `Draft.Message` you supply with your
552 # request.&lt;/li&gt;
553 # &lt;li&gt;The `References` and `In-Reply-To` headers must
554 # be set in compliance with the
555 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
556 # &lt;li&gt;The `Subject` headers must match.
557 # @mutable gmail.users.messages.insert gmail.users.messages.send
558 # @mutable gmail.users.drafts.create gmail.users.drafts.update
559 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
560 # ordering in the inbox. For normal SMTP-received email, this represents the
561 # time the message was originally accepted by Google, which is more reliable
562 # than the `Date` header. However, for API-migrated mail, it can
563 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700564 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700565 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700566 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700567 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700568 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
569 # MIME message parts, for example `multipart/*`. For non-
570 # container MIME message part types, such as `text/plain`, this
571 # field is empty. For more information, see
572 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700573 # Object with schema name: MessagePart
574 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700575 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
576 # representing the entire message payload, it will contain the standard
577 # RFC 2822 email headers such as `To`, `From`, and
578 # `Subject`.
579 {
580 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
581 # example, `To`.
582 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
583 # `someuser@example.com`.
584 },
585 ],
586 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
587 # represents an attachment.
588 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
589 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
590 # container MIME message parts.
591 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
592 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
593 # retrieved in a separate `messages.attachments.get` request.
594 # When not present, the entire content of the message part body is
595 # contained in the data field.
596 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
597 # May be empty for MIME container
598 # types that have no message body or when the body data is sent as a
599 # separate attachment. An attachment ID is present if the body data is
600 # contained in a separate attachment.
601 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700602 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700603 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700604 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700605 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
606 # encoded string. Returned in `messages.get` and
607 # `drafts.get` responses when the `format=RAW`
608 # parameter is supplied.
609 # @mutable gmail.users.messages.insert gmail.users.messages.send
610 # @mutable gmail.users.drafts.create gmail.users.drafts.update
611 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
612 # @mutable gmail.users.messages.insert gmail.users.messages.modify
613 &quot;A String&quot;,
614 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700615 }</pre>
616</div>
617
618<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700619 <code class="details" id="list">list(userId, maxResults=None, labelIds=None, includeSpamTrash=None, pageToken=None, q=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700620 <pre>Lists the messages in the user&#x27;s mailbox.
621
622Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700623 userId: string, The user&#x27;s email address. The special value `me`
624can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700625 maxResults: integer, Maximum number of messages to return.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700626 labelIds: string, Only return messages with labels that match all of the specified label IDs. (repeated)
627 includeSpamTrash: boolean, Include messages from `SPAM` and `TRASH`
628in the results.
Bu Sun Kim65020912020-05-20 12:08:20 -0700629 pageToken: string, Page token to retrieve a specific page of results in the list.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700630 q: string, Only return messages matching the specified query. Supports the same
631query format as the Gmail search box. For example,
632`&quot;from:someuser@example.com rfc822msgid:&lt;somemsgid@example.com&gt;
633is:unread&quot;`. 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 {
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700644 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
645 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results in the list.
646 &quot;messages&quot;: [ # List of messages. Note that each message resource contains only an
647 # `id` and a `threadId`. Additional message details can
648 # be fetched using the
649 # &lt;a href=&quot;/gmail/api/v1/reference/users/messages/get&quot;&gt;messages.get&lt;/a&gt;
650 # method.
Craig Citro065b5302014-08-14 00:47:23 -0700651 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700652 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
653 # a thread, the following criteria must be met:
654 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
655 # `Message` or `Draft.Message` you supply with your
656 # request.&lt;/li&gt;
657 # &lt;li&gt;The `References` and `In-Reply-To` headers must
658 # be set in compliance with the
659 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
660 # &lt;li&gt;The `Subject` headers must match.
661 # @mutable gmail.users.messages.insert gmail.users.messages.send
662 # @mutable gmail.users.drafts.create gmail.users.drafts.update
663 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
664 # ordering in the inbox. For normal SMTP-received email, this represents the
665 # time the message was originally accepted by Google, which is more reliable
666 # than the `Date` header. However, for API-migrated mail, it can
667 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700668 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700669 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700670 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700671 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700672 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
673 # MIME message parts, for example `multipart/*`. For non-
674 # container MIME message part types, such as `text/plain`, this
675 # field is empty. For more information, see
676 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700677 # Object with schema name: MessagePart
678 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700679 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
680 # representing the entire message payload, it will contain the standard
681 # RFC 2822 email headers such as `To`, `From`, and
682 # `Subject`.
683 {
684 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
685 # example, `To`.
686 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
687 # `someuser@example.com`.
688 },
689 ],
690 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
691 # represents an attachment.
692 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
693 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
694 # container MIME message parts.
695 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
696 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
697 # retrieved in a separate `messages.attachments.get` request.
698 # When not present, the entire content of the message part body is
699 # contained in the data field.
700 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
701 # May be empty for MIME container
702 # types that have no message body or when the body data is sent as a
703 # separate attachment. An attachment ID is present if the body data is
704 # contained in a separate attachment.
705 },
Craig Citro065b5302014-08-14 00:47:23 -0700706 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700707 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700708 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700709 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
710 # encoded string. Returned in `messages.get` and
711 # `drafts.get` responses when the `format=RAW`
712 # parameter is supplied.
713 # @mutable gmail.users.messages.insert gmail.users.messages.send
714 # @mutable gmail.users.drafts.create gmail.users.drafts.update
715 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
716 # @mutable gmail.users.messages.insert gmail.users.messages.modify
717 &quot;A String&quot;,
718 ],
Craig Citro065b5302014-08-14 00:47:23 -0700719 },
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:
Bu Sun Kim65020912020-05-20 12:08:20 -0700733 A request object that you can call &#x27;execute()&#x27; on to request the next
Craig Citro065b5302014-08-14 00:47:23 -0700734 page. Returns None if there are no more items in the collection.
735 </pre>
736</div>
737
738<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700743 userId: string, The user&#x27;s email address. The special value `me`
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{
Bu Sun Kim65020912020-05-20 12:08:20 -0700750 &quot;addLabelIds&quot;: [ # A list of IDs of labels to add to this message.
751 &quot;A String&quot;,
Craig Citro065b5302014-08-14 00:47:23 -0700752 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700753 &quot;removeLabelIds&quot;: [ # A list IDs of labels to remove from this message.
754 &quot;A String&quot;,
Craig Citro065b5302014-08-14 00:47:23 -0700755 ],
756 }
757
Bu Sun Kimd059ad82020-07-22 17:02:09 -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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700767 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
768 # a thread, the following criteria must be met:
769 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
770 # `Message` or `Draft.Message` you supply with your
771 # request.&lt;/li&gt;
772 # &lt;li&gt;The `References` and `In-Reply-To` headers must
773 # be set in compliance with the
774 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
775 # &lt;li&gt;The `Subject` headers must match.
776 # @mutable gmail.users.messages.insert gmail.users.messages.send
777 # @mutable gmail.users.drafts.create gmail.users.drafts.update
778 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
779 # ordering in the inbox. For normal SMTP-received email, this represents the
780 # time the message was originally accepted by Google, which is more reliable
781 # than the `Date` header. However, for API-migrated mail, it can
782 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700783 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700784 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700785 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700786 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700787 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
788 # MIME message parts, for example `multipart/*`. For non-
789 # container MIME message part types, such as `text/plain`, this
790 # field is empty. For more information, see
791 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700792 # Object with schema name: MessagePart
793 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700794 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
795 # representing the entire message payload, it will contain the standard
796 # RFC 2822 email headers such as `To`, `From`, and
797 # `Subject`.
798 {
799 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
800 # example, `To`.
801 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
802 # `someuser@example.com`.
803 },
804 ],
805 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
806 # represents an attachment.
807 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
808 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
809 # container MIME message parts.
810 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
811 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
812 # retrieved in a separate `messages.attachments.get` request.
813 # When not present, the entire content of the message part body is
814 # contained in the data field.
815 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
816 # May be empty for MIME container
817 # types that have no message body or when the body data is sent as a
818 # separate attachment. An attachment ID is present if the body data is
819 # contained in a separate attachment.
820 },
Craig Citro065b5302014-08-14 00:47:23 -0700821 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700822 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700823 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700824 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
825 # encoded string. Returned in `messages.get` and
826 # `drafts.get` responses when the `format=RAW`
827 # parameter is supplied.
828 # @mutable gmail.users.messages.insert gmail.users.messages.send
829 # @mutable gmail.users.drafts.create gmail.users.drafts.update
830 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
831 # @mutable gmail.users.messages.insert gmail.users.messages.modify
832 &quot;A String&quot;,
833 ],
Craig Citro065b5302014-08-14 00:47:23 -0700834 }</pre>
835</div>
836
837<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700838 <code class="details" id="send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
839 <pre>Sends the specified message to the recipients in the
840`To`, `Cc`, and `Bcc` headers.
Craig Citro065b5302014-08-14 00:47:23 -0700841
842Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700843 userId: string, The user&#x27;s email address. The special value `me`
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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700849 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
850 # a thread, the following criteria must be met:
851 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
852 # `Message` or `Draft.Message` you supply with your
853 # request.&lt;/li&gt;
854 # &lt;li&gt;The `References` and `In-Reply-To` headers must
855 # be set in compliance with the
856 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
857 # &lt;li&gt;The `Subject` headers must match.
858 # @mutable gmail.users.messages.insert gmail.users.messages.send
859 # @mutable gmail.users.drafts.create gmail.users.drafts.update
860 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
861 # ordering in the inbox. For normal SMTP-received email, this represents the
862 # time the message was originally accepted by Google, which is more reliable
863 # than the `Date` header. However, for API-migrated mail, it can
864 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700865 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700866 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700867 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700868 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700869 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
870 # MIME message parts, for example `multipart/*`. For non-
871 # container MIME message part types, such as `text/plain`, this
872 # field is empty. For more information, see
873 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700874 # Object with schema name: MessagePart
875 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700876 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
877 # representing the entire message payload, it will contain the standard
878 # RFC 2822 email headers such as `To`, `From`, and
879 # `Subject`.
880 {
881 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
882 # example, `To`.
883 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
884 # `someuser@example.com`.
885 },
886 ],
887 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
888 # represents an attachment.
889 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
890 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
891 # container MIME message parts.
892 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
893 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
894 # retrieved in a separate `messages.attachments.get` request.
895 # When not present, the entire content of the message part body is
896 # contained in the data field.
897 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
898 # May be empty for MIME container
899 # types that have no message body or when the body data is sent as a
900 # separate attachment. An attachment ID is present if the body data is
901 # contained in a separate attachment.
902 },
Craig Citro065b5302014-08-14 00:47:23 -0700903 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700904 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700905 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700906 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
907 # encoded string. Returned in `messages.get` and
908 # `drafts.get` responses when the `format=RAW`
909 # parameter is supplied.
910 # @mutable gmail.users.messages.insert gmail.users.messages.send
911 # @mutable gmail.users.drafts.create gmail.users.drafts.update
912 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
913 # @mutable gmail.users.messages.insert gmail.users.messages.modify
914 &quot;A String&quot;,
915 ],
Craig Citro065b5302014-08-14 00:47:23 -0700916}
917
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700918 x__xgafv: string, V1 error format.
919 Allowed values
920 1 - v1 error format
921 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700922 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 -0800923 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 -0700924
925Returns:
926 An object of the form:
927
928 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700929 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
930 # a thread, the following criteria must be met:
931 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
932 # `Message` or `Draft.Message` you supply with your
933 # request.&lt;/li&gt;
934 # &lt;li&gt;The `References` and `In-Reply-To` headers must
935 # be set in compliance with the
936 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
937 # &lt;li&gt;The `Subject` headers must match.
938 # @mutable gmail.users.messages.insert gmail.users.messages.send
939 # @mutable gmail.users.drafts.create gmail.users.drafts.update
940 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
941 # ordering in the inbox. For normal SMTP-received email, this represents the
942 # time the message was originally accepted by Google, which is more reliable
943 # than the `Date` header. However, for API-migrated mail, it can
944 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700945 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700946 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700947 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700948 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700949 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
950 # MIME message parts, for example `multipart/*`. For non-
951 # container MIME message part types, such as `text/plain`, this
952 # field is empty. For more information, see
953 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700954 # Object with schema name: MessagePart
955 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700956 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
957 # representing the entire message payload, it will contain the standard
958 # RFC 2822 email headers such as `To`, `From`, and
959 # `Subject`.
960 {
961 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
962 # example, `To`.
963 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
964 # `someuser@example.com`.
965 },
966 ],
967 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
968 # represents an attachment.
969 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
970 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
971 # container MIME message parts.
972 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
973 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
974 # retrieved in a separate `messages.attachments.get` request.
975 # When not present, the entire content of the message part body is
976 # contained in the data field.
977 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
978 # May be empty for MIME container
979 # types that have no message body or when the body data is sent as a
980 # separate attachment. An attachment ID is present if the body data is
981 # contained in a separate attachment.
982 },
Craig Citro065b5302014-08-14 00:47:23 -0700983 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700984 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700985 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700986 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
987 # encoded string. Returned in `messages.get` and
988 # `drafts.get` responses when the `format=RAW`
989 # parameter is supplied.
990 # @mutable gmail.users.messages.insert gmail.users.messages.send
991 # @mutable gmail.users.drafts.create gmail.users.drafts.update
992 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
993 # @mutable gmail.users.messages.insert gmail.users.messages.modify
994 &quot;A String&quot;,
995 ],
Craig Citro065b5302014-08-14 00:47:23 -0700996 }</pre>
997</div>
998
999<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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:
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001004 userId: string, The user&#x27;s email address. The special value `me`
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)
Bu Sun Kimd059ad82020-07-22 17:02:09 -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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001016 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
1017 # a thread, the following criteria must be met:
1018 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
1019 # `Message` or `Draft.Message` you supply with your
1020 # request.&lt;/li&gt;
1021 # &lt;li&gt;The `References` and `In-Reply-To` headers must
1022 # be set in compliance with the
1023 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
1024 # &lt;li&gt;The `Subject` headers must match.
1025 # @mutable gmail.users.messages.insert gmail.users.messages.send
1026 # @mutable gmail.users.drafts.create gmail.users.drafts.update
1027 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
1028 # ordering in the inbox. For normal SMTP-received email, this represents the
1029 # time the message was originally accepted by Google, which is more reliable
1030 # than the `Date` header. However, for API-migrated mail, it can
1031 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -07001032 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001033 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001034 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -07001035 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001036 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
1037 # MIME message parts, for example `multipart/*`. For non-
1038 # container MIME message part types, such as `text/plain`, this
1039 # field is empty. For more information, see
1040 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001041 # Object with schema name: MessagePart
1042 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001043 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
1044 # representing the entire message payload, it will contain the standard
1045 # RFC 2822 email headers such as `To`, `From`, and
1046 # `Subject`.
1047 {
1048 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
1049 # example, `To`.
1050 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
1051 # `someuser@example.com`.
1052 },
1053 ],
1054 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
1055 # represents an attachment.
1056 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
1057 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
1058 # container MIME message parts.
1059 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
1060 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
1061 # retrieved in a separate `messages.attachments.get` request.
1062 # When not present, the entire content of the message part body is
1063 # contained in the data field.
1064 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
1065 # May be empty for MIME container
1066 # types that have no message body or when the body data is sent as a
1067 # separate attachment. An attachment ID is present if the body data is
1068 # contained in a separate attachment.
1069 },
Craig Citro065b5302014-08-14 00:47:23 -07001070 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001071 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001072 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001073 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
1074 # encoded string. Returned in `messages.get` and
1075 # `drafts.get` responses when the `format=RAW`
1076 # parameter is supplied.
1077 # @mutable gmail.users.messages.insert gmail.users.messages.send
1078 # @mutable gmail.users.drafts.create gmail.users.drafts.update
1079 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
1080 # @mutable gmail.users.messages.insert gmail.users.messages.modify
1081 &quot;A String&quot;,
1082 ],
Craig Citro065b5302014-08-14 00:47:23 -07001083 }</pre>
1084</div>
1085
1086<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -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:
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001091 userId: string, The user&#x27;s email address. The special value `me`
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)
Bu Sun Kimd059ad82020-07-22 17:02:09 -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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001103 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
1104 # a thread, the following criteria must be met:
1105 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
1106 # `Message` or `Draft.Message` you supply with your
1107 # request.&lt;/li&gt;
1108 # &lt;li&gt;The `References` and `In-Reply-To` headers must
1109 # be set in compliance with the
1110 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
1111 # &lt;li&gt;The `Subject` headers must match.
1112 # @mutable gmail.users.messages.insert gmail.users.messages.send
1113 # @mutable gmail.users.drafts.create gmail.users.drafts.update
1114 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
1115 # ordering in the inbox. For normal SMTP-received email, this represents the
1116 # time the message was originally accepted by Google, which is more reliable
1117 # than the `Date` header. However, for API-migrated mail, it can
1118 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -07001119 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001120 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001121 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -07001122 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001123 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
1124 # MIME message parts, for example `multipart/*`. For non-
1125 # container MIME message part types, such as `text/plain`, this
1126 # field is empty. For more information, see
1127 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -07001128 # Object with schema name: MessagePart
1129 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001130 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
1131 # representing the entire message payload, it will contain the standard
1132 # RFC 2822 email headers such as `To`, `From`, and
1133 # `Subject`.
1134 {
1135 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
1136 # example, `To`.
1137 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
1138 # `someuser@example.com`.
1139 },
1140 ],
1141 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
1142 # represents an attachment.
1143 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
1144 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
1145 # container MIME message parts.
1146 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
1147 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
1148 # retrieved in a separate `messages.attachments.get` request.
1149 # When not present, the entire content of the message part body is
1150 # contained in the data field.
1151 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
1152 # May be empty for MIME container
1153 # types that have no message body or when the body data is sent as a
1154 # separate attachment. An attachment ID is present if the body data is
1155 # contained in a separate attachment.
1156 },
Craig Citro065b5302014-08-14 00:47:23 -07001157 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001158 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001159 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001160 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
1161 # encoded string. Returned in `messages.get` and
1162 # `drafts.get` responses when the `format=RAW`
1163 # parameter is supplied.
1164 # @mutable gmail.users.messages.insert gmail.users.messages.send
1165 # @mutable gmail.users.drafts.create gmail.users.drafts.update
1166 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
1167 # @mutable gmail.users.messages.insert gmail.users.messages.modify
1168 &quot;A String&quot;,
1169 ],
Craig Citro065b5302014-08-14 00:47:23 -07001170 }</pre>
1171</div>
1172
1173</body></html>