blob: b3136be8312b9e87bb743b20d63745a2f5b64809 [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.drafts.html">drafts</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070078 <code><a href="#create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
79<p class="firstline">Creates a new draft with the `DRAFT` label.</p>
Craig Citro065b5302014-08-14 00:47:23 -070080<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070081 <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
82<p class="firstline">Immediately and permanently deletes the specified draft.</p>
Craig Citro065b5302014-08-14 00:47:23 -070083<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070084 <code><a href="#get">get(userId, id, format=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070085<p class="firstline">Gets the specified draft.</p>
86<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070087 <code><a href="#list">list(userId, maxResults=None, q=None, includeSpamTrash=None, pageToken=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070088<p class="firstline">Lists the drafts in the user's mailbox.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070093 <code><a href="#send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
94<p class="firstline">Sends the specified, existing draft to the recipients in the</p>
Craig Citro065b5302014-08-14 00:47:23 -070095<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070096 <code><a href="#update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070097<p class="firstline">Replaces a draft's content.</p>
98<h3>Method Details</h3>
99<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700100 <code class="details" id="create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
101 <pre>Creates a new draft with the `DRAFT` label.
Craig Citro065b5302014-08-14 00:47:23 -0700102
103Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700104 userId: string, The user&#x27;s email address. The special value `me`
105can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700106 body: object, The request body.
107 The object takes the form of:
108
Bu Sun Kim65020912020-05-20 12:08:20 -0700109{ # A draft email in the user&#x27;s mailbox.
110 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
111 &quot;message&quot;: { # An email message. # The message content of the draft.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700112 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
113 # a thread, the following criteria must be met:
114 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
115 # `Message` or `Draft.Message` you supply with your
116 # request.&lt;/li&gt;
117 # &lt;li&gt;The `References` and `In-Reply-To` headers must
118 # be set in compliance with the
119 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
120 # &lt;li&gt;The `Subject` headers must match.
121 # @mutable gmail.users.messages.insert gmail.users.messages.send
122 # @mutable gmail.users.drafts.create gmail.users.drafts.update
123 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
124 # ordering in the inbox. For normal SMTP-received email, this represents the
125 # time the message was originally accepted by Google, which is more reliable
126 # than the `Date` header. However, for API-migrated mail, it can
127 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700128 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700129 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700130 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700131 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700132 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
133 # MIME message parts, for example `multipart/*`. For non-
134 # container MIME message part types, such as `text/plain`, this
135 # field is empty. For more information, see
136 # &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 -0700137 # Object with schema name: MessagePart
138 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700139 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
140 # representing the entire message payload, it will contain the standard
141 # RFC 2822 email headers such as `To`, `From`, and
142 # `Subject`.
143 {
144 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
145 # example, `To`.
146 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
147 # `someuser@example.com`.
148 },
149 ],
150 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
151 # represents an attachment.
152 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
153 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
154 # container MIME message parts.
155 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
156 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
157 # retrieved in a separate `messages.attachments.get` request.
158 # When not present, the entire content of the message part body is
159 # contained in the data field.
160 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
161 # May be empty for MIME container
162 # types that have no message body or when the body data is sent as a
163 # separate attachment. An attachment ID is present if the body data is
164 # contained in a separate attachment.
165 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700166 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700167 &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 -0700168 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700169 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
170 # encoded string. Returned in `messages.get` and
171 # `drafts.get` responses when the `format=RAW`
172 # parameter is supplied.
173 # @mutable gmail.users.messages.insert gmail.users.messages.send
174 # @mutable gmail.users.drafts.create gmail.users.drafts.update
175 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
176 # @mutable gmail.users.messages.insert gmail.users.messages.modify
177 &quot;A String&quot;,
178 ],
Craig Citro065b5302014-08-14 00:47:23 -0700179 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700180 }
Craig Citro065b5302014-08-14 00:47:23 -0700181
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 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 -0800187 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 -0700188
189Returns:
190 An object of the form:
191
Bu Sun Kim65020912020-05-20 12:08:20 -0700192 { # A draft email in the user&#x27;s mailbox.
193 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
194 &quot;message&quot;: { # An email message. # The message content of the draft.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700195 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
196 # a thread, the following criteria must be met:
197 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
198 # `Message` or `Draft.Message` you supply with your
199 # request.&lt;/li&gt;
200 # &lt;li&gt;The `References` and `In-Reply-To` headers must
201 # be set in compliance with the
202 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
203 # &lt;li&gt;The `Subject` headers must match.
204 # @mutable gmail.users.messages.insert gmail.users.messages.send
205 # @mutable gmail.users.drafts.create gmail.users.drafts.update
206 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
207 # ordering in the inbox. For normal SMTP-received email, this represents the
208 # time the message was originally accepted by Google, which is more reliable
209 # than the `Date` header. However, for API-migrated mail, it can
210 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700211 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700212 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700213 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700214 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700215 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
216 # MIME message parts, for example `multipart/*`. For non-
217 # container MIME message part types, such as `text/plain`, this
218 # field is empty. For more information, see
219 # &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 -0700220 # Object with schema name: MessagePart
221 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700222 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
223 # representing the entire message payload, it will contain the standard
224 # RFC 2822 email headers such as `To`, `From`, and
225 # `Subject`.
226 {
227 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
228 # example, `To`.
229 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
230 # `someuser@example.com`.
231 },
232 ],
233 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
234 # represents an attachment.
235 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
236 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
237 # container MIME message parts.
238 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
239 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
240 # retrieved in a separate `messages.attachments.get` request.
241 # When not present, the entire content of the message part body is
242 # contained in the data field.
243 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
244 # May be empty for MIME container
245 # types that have no message body or when the body data is sent as a
246 # separate attachment. An attachment ID is present if the body data is
247 # contained in a separate attachment.
248 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700249 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700250 &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 -0700251 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700252 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
253 # encoded string. Returned in `messages.get` and
254 # `drafts.get` responses when the `format=RAW`
255 # parameter is supplied.
256 # @mutable gmail.users.messages.insert gmail.users.messages.send
257 # @mutable gmail.users.drafts.create gmail.users.drafts.update
258 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
259 # @mutable gmail.users.messages.insert gmail.users.messages.modify
260 &quot;A String&quot;,
261 ],
Craig Citro065b5302014-08-14 00:47:23 -0700262 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700264</div>
265
266<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700267 <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
268 <pre>Immediately and permanently deletes the specified draft.
269Does not simply trash it.
Craig Citro065b5302014-08-14 00:47:23 -0700270
271Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700272 userId: string, The user&#x27;s email address. The special value `me`
273can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700274 id: string, The ID of the draft to delete. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700275 x__xgafv: string, V1 error format.
276 Allowed values
277 1 - v1 error format
278 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700279</pre>
280</div>
281
282<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700283 <code class="details" id="get">get(userId, id, format=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700284 <pre>Gets the specified draft.
285
286Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700287 userId: string, The user&#x27;s email address. The special value `me`
288can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700289 id: string, The ID of the draft to retrieve. (required)
290 format: string, The format to return the draft in.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700291 x__xgafv: string, V1 error format.
Craig Citro065b5302014-08-14 00:47:23 -0700292 Allowed values
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700293 1 - v1 error format
294 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700295
296Returns:
297 An object of the form:
298
Bu Sun Kim65020912020-05-20 12:08:20 -0700299 { # A draft email in the user&#x27;s mailbox.
300 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
301 &quot;message&quot;: { # An email message. # The message content of the draft.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700302 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
303 # a thread, the following criteria must be met:
304 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
305 # `Message` or `Draft.Message` you supply with your
306 # request.&lt;/li&gt;
307 # &lt;li&gt;The `References` and `In-Reply-To` headers must
308 # be set in compliance with the
309 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
310 # &lt;li&gt;The `Subject` headers must match.
311 # @mutable gmail.users.messages.insert gmail.users.messages.send
312 # @mutable gmail.users.drafts.create gmail.users.drafts.update
313 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
314 # ordering in the inbox. For normal SMTP-received email, this represents the
315 # time the message was originally accepted by Google, which is more reliable
316 # than the `Date` header. However, for API-migrated mail, it can
317 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700318 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700319 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700320 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700321 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700322 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
323 # MIME message parts, for example `multipart/*`. For non-
324 # container MIME message part types, such as `text/plain`, this
325 # field is empty. For more information, see
326 # &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 -0700327 # Object with schema name: MessagePart
328 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700329 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
330 # representing the entire message payload, it will contain the standard
331 # RFC 2822 email headers such as `To`, `From`, and
332 # `Subject`.
333 {
334 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
335 # example, `To`.
336 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
337 # `someuser@example.com`.
338 },
339 ],
340 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
341 # represents an attachment.
342 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
343 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
344 # container MIME message parts.
345 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
346 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
347 # retrieved in a separate `messages.attachments.get` request.
348 # When not present, the entire content of the message part body is
349 # contained in the data field.
350 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
351 # May be empty for MIME container
352 # types that have no message body or when the body data is sent as a
353 # separate attachment. An attachment ID is present if the body data is
354 # contained in a separate attachment.
355 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700356 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700357 &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 -0700358 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700359 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
360 # encoded string. Returned in `messages.get` and
361 # `drafts.get` responses when the `format=RAW`
362 # parameter is supplied.
363 # @mutable gmail.users.messages.insert gmail.users.messages.send
364 # @mutable gmail.users.drafts.create gmail.users.drafts.update
365 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
366 # @mutable gmail.users.messages.insert gmail.users.messages.modify
367 &quot;A String&quot;,
368 ],
Craig Citro065b5302014-08-14 00:47:23 -0700369 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700370 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700371</div>
372
373<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700374 <code class="details" id="list">list(userId, maxResults=None, q=None, includeSpamTrash=None, pageToken=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 <pre>Lists the drafts in the user&#x27;s mailbox.
Craig Citro065b5302014-08-14 00:47:23 -0700376
377Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700378 userId: string, The user&#x27;s email address. The special value `me`
379can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700380 maxResults: integer, Maximum number of drafts to return.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700381 q: string, Only return draft messages matching the specified query. Supports the same
382query format as the Gmail search box. For example,
383`&quot;from:someuser@example.com rfc822msgid:&lt;somemsgid@example.com&gt;
384is:unread&quot;`.
385 includeSpamTrash: boolean, Include drafts from `SPAM` and `TRASH`
386in the results.
Bu Sun Kim65020912020-05-20 12:08:20 -0700387 pageToken: string, Page token to retrieve a specific page of results in the list.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700388 x__xgafv: string, V1 error format.
389 Allowed values
390 1 - v1 error format
391 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700392
393Returns:
394 An object of the form:
395
396 {
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700397 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results in the list.
398 &quot;drafts&quot;: [ # List of drafts. Note that the `Message` property in each
399 # `Draft` resource only contains an `id` and a
400 # `threadId`. The
401 # &lt;a href=&quot;/gmail/api/v1/reference/users/messages/get&quot;&gt;messages.get&lt;/a&gt;
402 # method can fetch additional message details.
Bu Sun Kim65020912020-05-20 12:08:20 -0700403 { # A draft email in the user&#x27;s mailbox.
404 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
405 &quot;message&quot;: { # An email message. # The message content of the draft.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700406 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
407 # a thread, the following criteria must be met:
408 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
409 # `Message` or `Draft.Message` you supply with your
410 # request.&lt;/li&gt;
411 # &lt;li&gt;The `References` and `In-Reply-To` headers must
412 # be set in compliance with the
413 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
414 # &lt;li&gt;The `Subject` headers must match.
415 # @mutable gmail.users.messages.insert gmail.users.messages.send
416 # @mutable gmail.users.drafts.create gmail.users.drafts.update
417 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
418 # ordering in the inbox. For normal SMTP-received email, this represents the
419 # time the message was originally accepted by Google, which is more reliable
420 # than the `Date` header. However, for API-migrated mail, it can
421 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700422 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700423 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700424 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700425 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700426 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
427 # MIME message parts, for example `multipart/*`. For non-
428 # container MIME message part types, such as `text/plain`, this
429 # field is empty. For more information, see
430 # &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 -0700431 # Object with schema name: MessagePart
432 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700433 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
434 # representing the entire message payload, it will contain the standard
435 # RFC 2822 email headers such as `To`, `From`, and
436 # `Subject`.
437 {
438 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
439 # example, `To`.
440 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
441 # `someuser@example.com`.
442 },
443 ],
444 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
445 # represents an attachment.
446 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
447 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
448 # container MIME message parts.
449 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
450 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
451 # retrieved in a separate `messages.attachments.get` request.
452 # When not present, the entire content of the message part body is
453 # contained in the data field.
454 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
455 # May be empty for MIME container
456 # types that have no message body or when the body data is sent as a
457 # separate attachment. An attachment ID is present if the body data is
458 # contained in a separate attachment.
459 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700460 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700461 &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 -0700462 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700463 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
464 # encoded string. Returned in `messages.get` and
465 # `drafts.get` responses when the `format=RAW`
466 # parameter is supplied.
467 # @mutable gmail.users.messages.insert gmail.users.messages.send
468 # @mutable gmail.users.drafts.create gmail.users.drafts.update
469 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
470 # @mutable gmail.users.messages.insert gmail.users.messages.modify
471 &quot;A String&quot;,
472 ],
Craig Citro065b5302014-08-14 00:47:23 -0700473 },
Craig Citro065b5302014-08-14 00:47:23 -0700474 },
Craig Citro065b5302014-08-14 00:47:23 -0700475 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700476 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
Craig Citro065b5302014-08-14 00:47:23 -0700477 }</pre>
478</div>
479
480<div class="method">
481 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
482 <pre>Retrieves the next page of results.
483
484Args:
485 previous_request: The request for the previous page. (required)
486 previous_response: The response from the request for the previous page. (required)
487
488Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700489 A request object that you can call &#x27;execute()&#x27; on to request the next
Craig Citro065b5302014-08-14 00:47:23 -0700490 page. Returns None if there are no more items in the collection.
491 </pre>
492</div>
493
494<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700495 <code class="details" id="send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
496 <pre>Sends the specified, existing draft to the recipients in the
497`To`, `Cc`, and `Bcc` headers.
Craig Citro065b5302014-08-14 00:47:23 -0700498
499Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700500 userId: string, The user&#x27;s email address. The special value `me`
501can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700502 body: object, The request body.
503 The object takes the form of:
504
Bu Sun Kim65020912020-05-20 12:08:20 -0700505{ # A draft email in the user&#x27;s mailbox.
506 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
507 &quot;message&quot;: { # An email message. # The message content of the draft.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700508 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
509 # a thread, the following criteria must be met:
510 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
511 # `Message` or `Draft.Message` you supply with your
512 # request.&lt;/li&gt;
513 # &lt;li&gt;The `References` and `In-Reply-To` headers must
514 # be set in compliance with the
515 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
516 # &lt;li&gt;The `Subject` headers must match.
517 # @mutable gmail.users.messages.insert gmail.users.messages.send
518 # @mutable gmail.users.drafts.create gmail.users.drafts.update
519 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
520 # ordering in the inbox. For normal SMTP-received email, this represents the
521 # time the message was originally accepted by Google, which is more reliable
522 # than the `Date` header. However, for API-migrated mail, it can
523 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700524 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700525 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700526 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700527 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700528 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
529 # MIME message parts, for example `multipart/*`. For non-
530 # container MIME message part types, such as `text/plain`, this
531 # field is empty. For more information, see
532 # &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 -0700533 # Object with schema name: MessagePart
534 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700535 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
536 # representing the entire message payload, it will contain the standard
537 # RFC 2822 email headers such as `To`, `From`, and
538 # `Subject`.
539 {
540 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
541 # example, `To`.
542 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
543 # `someuser@example.com`.
544 },
545 ],
546 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
547 # represents an attachment.
548 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
549 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
550 # container MIME message parts.
551 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
552 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
553 # retrieved in a separate `messages.attachments.get` request.
554 # When not present, the entire content of the message part body is
555 # contained in the data field.
556 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
557 # May be empty for MIME container
558 # types that have no message body or when the body data is sent as a
559 # separate attachment. An attachment ID is present if the body data is
560 # contained in a separate attachment.
561 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700562 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700563 &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 -0700564 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700565 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
566 # encoded string. Returned in `messages.get` and
567 # `drafts.get` responses when the `format=RAW`
568 # parameter is supplied.
569 # @mutable gmail.users.messages.insert gmail.users.messages.send
570 # @mutable gmail.users.drafts.create gmail.users.drafts.update
571 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
572 # @mutable gmail.users.messages.insert gmail.users.messages.modify
573 &quot;A String&quot;,
574 ],
Craig Citro065b5302014-08-14 00:47:23 -0700575 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700576 }
Craig Citro065b5302014-08-14 00:47:23 -0700577
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700578 x__xgafv: string, V1 error format.
579 Allowed values
580 1 - v1 error format
581 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700582 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 -0800583 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 -0700584
585Returns:
586 An object of the form:
587
588 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700589 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
590 # a thread, the following criteria must be met:
591 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
592 # `Message` or `Draft.Message` you supply with your
593 # request.&lt;/li&gt;
594 # &lt;li&gt;The `References` and `In-Reply-To` headers must
595 # be set in compliance with the
596 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
597 # &lt;li&gt;The `Subject` headers must match.
598 # @mutable gmail.users.messages.insert gmail.users.messages.send
599 # @mutable gmail.users.drafts.create gmail.users.drafts.update
600 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
601 # ordering in the inbox. For normal SMTP-received email, this represents the
602 # time the message was originally accepted by Google, which is more reliable
603 # than the `Date` header. However, for API-migrated mail, it can
604 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700605 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700606 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700607 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700608 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700609 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
610 # MIME message parts, for example `multipart/*`. For non-
611 # container MIME message part types, such as `text/plain`, this
612 # field is empty. For more information, see
613 # &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 -0700614 # Object with schema name: MessagePart
615 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700616 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
617 # representing the entire message payload, it will contain the standard
618 # RFC 2822 email headers such as `To`, `From`, and
619 # `Subject`.
620 {
621 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
622 # example, `To`.
623 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
624 # `someuser@example.com`.
625 },
626 ],
627 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
628 # represents an attachment.
629 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
630 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
631 # container MIME message parts.
632 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
633 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
634 # retrieved in a separate `messages.attachments.get` request.
635 # When not present, the entire content of the message part body is
636 # contained in the data field.
637 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
638 # May be empty for MIME container
639 # types that have no message body or when the body data is sent as a
640 # separate attachment. An attachment ID is present if the body data is
641 # contained in a separate attachment.
642 },
Craig Citro065b5302014-08-14 00:47:23 -0700643 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700644 &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 -0700645 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700646 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
647 # encoded string. Returned in `messages.get` and
648 # `drafts.get` responses when the `format=RAW`
649 # parameter is supplied.
650 # @mutable gmail.users.messages.insert gmail.users.messages.send
651 # @mutable gmail.users.drafts.create gmail.users.drafts.update
652 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
653 # @mutable gmail.users.messages.insert gmail.users.messages.modify
654 &quot;A String&quot;,
655 ],
Craig Citro065b5302014-08-14 00:47:23 -0700656 }</pre>
657</div>
658
659<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700660 <code class="details" id="update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700661 <pre>Replaces a draft&#x27;s content.
Craig Citro065b5302014-08-14 00:47:23 -0700662
663Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700664 userId: string, The user&#x27;s email address. The special value `me`
665can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700666 id: string, The ID of the draft to update. (required)
667 body: object, The request body.
668 The object takes the form of:
669
Bu Sun Kim65020912020-05-20 12:08:20 -0700670{ # A draft email in the user&#x27;s mailbox.
671 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
672 &quot;message&quot;: { # An email message. # The message content of the draft.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700673 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
674 # a thread, the following criteria must be met:
675 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
676 # `Message` or `Draft.Message` you supply with your
677 # request.&lt;/li&gt;
678 # &lt;li&gt;The `References` and `In-Reply-To` headers must
679 # be set in compliance with the
680 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
681 # &lt;li&gt;The `Subject` headers must match.
682 # @mutable gmail.users.messages.insert gmail.users.messages.send
683 # @mutable gmail.users.drafts.create gmail.users.drafts.update
684 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
685 # ordering in the inbox. For normal SMTP-received email, this represents the
686 # time the message was originally accepted by Google, which is more reliable
687 # than the `Date` header. However, for API-migrated mail, it can
688 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700689 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700690 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700691 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700692 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700693 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
694 # MIME message parts, for example `multipart/*`. For non-
695 # container MIME message part types, such as `text/plain`, this
696 # field is empty. For more information, see
697 # &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 -0700698 # Object with schema name: MessagePart
699 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700700 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
701 # representing the entire message payload, it will contain the standard
702 # RFC 2822 email headers such as `To`, `From`, and
703 # `Subject`.
704 {
705 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
706 # example, `To`.
707 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
708 # `someuser@example.com`.
709 },
710 ],
711 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
712 # represents an attachment.
713 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
714 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
715 # container MIME message parts.
716 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
717 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
718 # retrieved in a separate `messages.attachments.get` request.
719 # When not present, the entire content of the message part body is
720 # contained in the data field.
721 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
722 # May be empty for MIME container
723 # types that have no message body or when the body data is sent as a
724 # separate attachment. An attachment ID is present if the body data is
725 # contained in a separate attachment.
726 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700727 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700728 &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 -0700729 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700730 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
731 # encoded string. Returned in `messages.get` and
732 # `drafts.get` responses when the `format=RAW`
733 # parameter is supplied.
734 # @mutable gmail.users.messages.insert gmail.users.messages.send
735 # @mutable gmail.users.drafts.create gmail.users.drafts.update
736 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
737 # @mutable gmail.users.messages.insert gmail.users.messages.modify
738 &quot;A String&quot;,
739 ],
Craig Citro065b5302014-08-14 00:47:23 -0700740 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700741 }
Craig Citro065b5302014-08-14 00:47:23 -0700742
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700743 x__xgafv: string, V1 error format.
744 Allowed values
745 1 - v1 error format
746 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700747 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 -0800748 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 -0700749
750Returns:
751 An object of the form:
752
Bu Sun Kim65020912020-05-20 12:08:20 -0700753 { # A draft email in the user&#x27;s mailbox.
754 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
755 &quot;message&quot;: { # An email message. # The message content of the draft.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700756 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
757 # a thread, the following criteria must be met:
758 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
759 # `Message` or `Draft.Message` you supply with your
760 # request.&lt;/li&gt;
761 # &lt;li&gt;The `References` and `In-Reply-To` headers must
762 # be set in compliance with the
763 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
764 # &lt;li&gt;The `Subject` headers must match.
765 # @mutable gmail.users.messages.insert gmail.users.messages.send
766 # @mutable gmail.users.drafts.create gmail.users.drafts.update
767 &quot;internalDate&quot;: &quot;A String&quot;, # 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 `Date` header. However, for API-migrated mail, it can
771 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700772 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700773 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700774 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700775 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700776 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
777 # MIME message parts, for example `multipart/*`. For non-
778 # container MIME message part types, such as `text/plain`, this
779 # field is empty. For more information, see
780 # &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 -0700781 # Object with schema name: MessagePart
782 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700783 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
784 # representing the entire message payload, it will contain the standard
785 # RFC 2822 email headers such as `To`, `From`, and
786 # `Subject`.
787 {
788 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
789 # example, `To`.
790 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
791 # `someuser@example.com`.
792 },
793 ],
794 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
795 # represents an attachment.
796 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
797 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
798 # container MIME message parts.
799 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
800 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
801 # retrieved in a separate `messages.attachments.get` request.
802 # When not present, the entire content of the message part body is
803 # contained in the data field.
804 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
805 # May be empty for MIME container
806 # types that have no message body or when the body data is sent as a
807 # separate attachment. An attachment ID is present if the body data is
808 # contained in a separate attachment.
809 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700810 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700811 &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 -0700812 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700813 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
814 # encoded string. Returned in `messages.get` and
815 # `drafts.get` responses when the `format=RAW`
816 # parameter is supplied.
817 # @mutable gmail.users.messages.insert gmail.users.messages.send
818 # @mutable gmail.users.drafts.create gmail.users.drafts.update
819 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
820 # @mutable gmail.users.messages.insert gmail.users.messages.modify
821 &quot;A String&quot;,
822 ],
Craig Citro065b5302014-08-14 00:47:23 -0700823 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700824 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700825</div>
826
827</body></html>