blob: d03690355b6c13b59760d26ead8451ebd48ae1e2 [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">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#create">create(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Creates a new draft with the <code>DRAFT</code> label.</p>
Craig Citro065b5302014-08-14 00:47:23 -070080<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#list">list(userId, pageToken=None, includeSpamTrash=None, maxResults=None, q=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">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=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">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#update">update(userId, id, body=None, media_body=None, media_mime_type=None, x__xgafv=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">
Dan O'Mearadd494642020-05-01 07:42:23 -0700100 <code class="details" id="create">create(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</code>
101 <pre>Creates a new draft with the &lt;code&gt;DRAFT&lt;/code&gt; label.
Craig Citro065b5302014-08-14 00:47:23 -0700102
103Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700104 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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
109{ # A draft email in the user's mailbox.
110 "message": { # An email message. # The message content of the draft.
Dan O'Mearadd494642020-05-01 07:42:23 -0700111 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
112 # ordering in the inbox. For normal SMTP-received email, this represents the
113 # time the message was originally accepted by Google, which is more reliable
114 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
115 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700116 "historyId": "A String", # The ID of the last history record that modified this message.
117 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700118 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
119 # container MIME message parts.
120 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
121 # May be empty for MIME container
122 # types that have no message body or when the body data is sent as a
123 # separate attachment. An attachment ID is present if the body data is
124 # contained in a separate attachment.
125 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
126 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
127 # When not present, the entire content of the message part body is
128 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800129 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700130 },
131 "mimeType": "A String", # The MIME type of the message part.
132 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700133 "filename": "A String", # The filename of the attachment. Only present if this message part
134 # represents an attachment.
135 "headers": [ # List of headers on this message part. For the top-level message part,
136 # representing the entire message payload, it will contain the standard
137 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
138 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700139 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700140 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
141 # example, &lt;code&gt;To&lt;/code&gt;.
142 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
143 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700144 },
145 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700146 "parts": [ # The child MIME message parts of this part. This only applies to container
147 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
148 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
149 # field is empty. For more information, see
150 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700151 # Object with schema name: MessagePart
152 ],
153 },
154 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700155 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
156 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
157 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
158 # parameter is supplied.
159 # @mutable gmail.users.messages.insert gmail.users.messages.send
160 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700161 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700162 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
163 # a thread, the following criteria must be met:
164 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
165 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
166 # request.&lt;/li&gt;
167 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
168 # be set in compliance with the
169 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
170 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
171 # @mutable gmail.users.messages.insert gmail.users.messages.send
172 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700173 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700174 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700175 "A String",
176 ],
177 "id": "A String", # The immutable ID of the message.
178 },
179 "id": "A String", # The immutable ID of the draft.
180}
181
182 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 -0800183 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Dan O'Mearadd494642020-05-01 07:42:23 -0700184 x__xgafv: string, V1 error format.
185 Allowed values
186 1 - v1 error format
187 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700188
189Returns:
190 An object of the form:
191
192 { # A draft email in the user's mailbox.
193 "message": { # An email message. # The message content of the draft.
Dan O'Mearadd494642020-05-01 07:42:23 -0700194 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
195 # ordering in the inbox. For normal SMTP-received email, this represents the
196 # time the message was originally accepted by Google, which is more reliable
197 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
198 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700199 "historyId": "A String", # The ID of the last history record that modified this message.
200 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700201 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
202 # container MIME message parts.
203 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
204 # May be empty for MIME container
205 # types that have no message body or when the body data is sent as a
206 # separate attachment. An attachment ID is present if the body data is
207 # contained in a separate attachment.
208 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
209 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
210 # When not present, the entire content of the message part body is
211 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800212 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700213 },
214 "mimeType": "A String", # The MIME type of the message part.
215 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700216 "filename": "A String", # The filename of the attachment. Only present if this message part
217 # represents an attachment.
218 "headers": [ # List of headers on this message part. For the top-level message part,
219 # representing the entire message payload, it will contain the standard
220 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
221 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700222 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700223 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
224 # example, &lt;code&gt;To&lt;/code&gt;.
225 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
226 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700227 },
228 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700229 "parts": [ # The child MIME message parts of this part. This only applies to container
230 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
231 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
232 # field is empty. For more information, see
233 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700234 # Object with schema name: MessagePart
235 ],
236 },
237 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700238 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
239 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
240 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
241 # parameter is supplied.
242 # @mutable gmail.users.messages.insert gmail.users.messages.send
243 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700244 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700245 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
246 # a thread, the following criteria must be met:
247 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
248 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
249 # request.&lt;/li&gt;
250 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
251 # be set in compliance with the
252 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
253 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
254 # @mutable gmail.users.messages.insert gmail.users.messages.send
255 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700256 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700257 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700258 "A String",
259 ],
260 "id": "A String", # The immutable ID of the message.
261 },
262 "id": "A String", # The immutable ID of the draft.
263 }</pre>
264</div>
265
266<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -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:
Dan O'Mearadd494642020-05-01 07:42:23 -0700272 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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)
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -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:
Dan O'Mearadd494642020-05-01 07:42:23 -0700287 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700291 x__xgafv: string, V1 error format.
Craig Citro065b5302014-08-14 00:47:23 -0700292 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -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
299 { # A draft email in the user's mailbox.
300 "message": { # An email message. # The message content of the draft.
Dan O'Mearadd494642020-05-01 07:42:23 -0700301 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
302 # ordering in the inbox. For normal SMTP-received email, this represents the
303 # time the message was originally accepted by Google, which is more reliable
304 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
305 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700306 "historyId": "A String", # The ID of the last history record that modified this message.
307 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700308 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
309 # container MIME message parts.
310 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
311 # May be empty for MIME container
312 # types that have no message body or when the body data is sent as a
313 # separate attachment. An attachment ID is present if the body data is
314 # contained in a separate attachment.
315 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
316 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
317 # When not present, the entire content of the message part body is
318 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800319 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700320 },
321 "mimeType": "A String", # The MIME type of the message part.
322 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700323 "filename": "A String", # The filename of the attachment. Only present if this message part
324 # represents an attachment.
325 "headers": [ # List of headers on this message part. For the top-level message part,
326 # representing the entire message payload, it will contain the standard
327 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
328 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700329 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700330 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
331 # example, &lt;code&gt;To&lt;/code&gt;.
332 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
333 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700334 },
335 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700336 "parts": [ # The child MIME message parts of this part. This only applies to container
337 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
338 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
339 # field is empty. For more information, see
340 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700341 # Object with schema name: MessagePart
342 ],
343 },
344 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700345 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
346 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
347 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
348 # parameter is supplied.
349 # @mutable gmail.users.messages.insert gmail.users.messages.send
350 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700351 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700352 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
353 # a thread, the following criteria must be met:
354 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
355 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
356 # request.&lt;/li&gt;
357 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
358 # be set in compliance with the
359 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
360 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
361 # @mutable gmail.users.messages.insert gmail.users.messages.send
362 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700363 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700364 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700365 "A String",
366 ],
367 "id": "A String", # The immutable ID of the message.
368 },
369 "id": "A String", # The immutable ID of the draft.
370 }</pre>
371</div>
372
373<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700374 <code class="details" id="list">list(userId, pageToken=None, includeSpamTrash=None, maxResults=None, q=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700375 <pre>Lists the drafts in the user's mailbox.
376
377Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700378 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
379can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700380 pageToken: string, Page token to retrieve a specific page of results in the list.
Dan O'Mearadd494642020-05-01 07:42:23 -0700381 includeSpamTrash: boolean, Include drafts from &lt;code&gt;SPAM&lt;/code&gt; and &lt;code&gt;TRASH&lt;/code&gt;
382in the results.
Craig Citro065b5302014-08-14 00:47:23 -0700383 maxResults: integer, Maximum number of drafts to return.
Dan O'Mearadd494642020-05-01 07:42:23 -0700384 q: string, Only return draft messages matching the specified query. Supports the same
385query format as the Gmail search box. For example,
386&lt;code&gt;"from:someuser@example.com rfc822msgid:&lt;somemsgid@example.com&gt;
387is:unread"&lt;/code&gt;.
388 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 {
397 "nextPageToken": "A String", # Token to retrieve the next page of results in the list.
398 "resultSizeEstimate": 42, # Estimated total number of results.
Dan O'Mearadd494642020-05-01 07:42:23 -0700399 "drafts": [ # List of drafts. Note that the &lt;code&gt;Message&lt;/code&gt; property in each
400 # &lt;code&gt;Draft&lt;/code&gt; resource only contains an &lt;code&gt;id&lt;/code&gt; and a
401 # &lt;code&gt;threadId&lt;/code&gt;. The
402 # &lt;a href="/gmail/api/v1/reference/users/messages/get"&gt;messages.get&lt;/a&gt;
403 # method can fetch additional message details.
Craig Citro065b5302014-08-14 00:47:23 -0700404 { # A draft email in the user's mailbox.
405 "message": { # An email message. # The message content of the draft.
Dan O'Mearadd494642020-05-01 07:42:23 -0700406 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
407 # ordering in the inbox. For normal SMTP-received email, this represents the
408 # time the message was originally accepted by Google, which is more reliable
409 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
410 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700411 "historyId": "A String", # The ID of the last history record that modified this message.
412 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700413 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
414 # container MIME message parts.
415 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
416 # May be empty for MIME container
417 # types that have no message body or when the body data is sent as a
418 # separate attachment. An attachment ID is present if the body data is
419 # contained in a separate attachment.
420 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
421 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
422 # When not present, the entire content of the message part body is
423 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800424 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700425 },
426 "mimeType": "A String", # The MIME type of the message part.
427 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700428 "filename": "A String", # The filename of the attachment. Only present if this message part
429 # represents an attachment.
430 "headers": [ # List of headers on this message part. For the top-level message part,
431 # representing the entire message payload, it will contain the standard
432 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
433 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700434 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700435 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
436 # example, &lt;code&gt;To&lt;/code&gt;.
437 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
438 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700439 },
440 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700441 "parts": [ # The child MIME message parts of this part. This only applies to container
442 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
443 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
444 # field is empty. For more information, see
445 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700446 # Object with schema name: MessagePart
447 ],
448 },
449 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700450 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
451 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
452 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
453 # parameter is supplied.
454 # @mutable gmail.users.messages.insert gmail.users.messages.send
455 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700456 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700457 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
458 # a thread, the following criteria must be met:
459 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
460 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
461 # request.&lt;/li&gt;
462 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
463 # be set in compliance with the
464 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
465 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
466 # @mutable gmail.users.messages.insert gmail.users.messages.send
467 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700468 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700469 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700470 "A String",
471 ],
472 "id": "A String", # The immutable ID of the message.
473 },
474 "id": "A String", # The immutable ID of the draft.
475 },
476 ],
477 }</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:
489 A request object that you can call 'execute()' on to request the next
490 page. Returns None if there are no more items in the collection.
491 </pre>
492</div>
493
494<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700495 <code class="details" id="send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</code>
496 <pre>Sends the specified, existing draft to the recipients in the
497&lt;code&gt;To&lt;/code&gt;, &lt;code&gt;Cc&lt;/code&gt;, and &lt;code&gt;Bcc&lt;/code&gt; headers.
Craig Citro065b5302014-08-14 00:47:23 -0700498
499Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700500 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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
505{ # A draft email in the user's mailbox.
506 "message": { # An email message. # The message content of the draft.
Dan O'Mearadd494642020-05-01 07:42:23 -0700507 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
508 # ordering in the inbox. For normal SMTP-received email, this represents the
509 # time the message was originally accepted by Google, which is more reliable
510 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
511 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700512 "historyId": "A String", # The ID of the last history record that modified this message.
513 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700514 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
515 # container MIME message parts.
516 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
517 # May be empty for MIME container
518 # types that have no message body or when the body data is sent as a
519 # separate attachment. An attachment ID is present if the body data is
520 # contained in a separate attachment.
521 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
522 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
523 # When not present, the entire content of the message part body is
524 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800525 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700526 },
527 "mimeType": "A String", # The MIME type of the message part.
528 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700529 "filename": "A String", # The filename of the attachment. Only present if this message part
530 # represents an attachment.
531 "headers": [ # List of headers on this message part. For the top-level message part,
532 # representing the entire message payload, it will contain the standard
533 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
534 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700535 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700536 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
537 # example, &lt;code&gt;To&lt;/code&gt;.
538 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
539 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700540 },
541 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700542 "parts": [ # The child MIME message parts of this part. This only applies to container
543 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
544 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
545 # field is empty. For more information, see
546 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700547 # Object with schema name: MessagePart
548 ],
549 },
550 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700551 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
552 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
553 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
554 # parameter is supplied.
555 # @mutable gmail.users.messages.insert gmail.users.messages.send
556 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700557 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700558 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
559 # a thread, the following criteria must be met:
560 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
561 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
562 # request.&lt;/li&gt;
563 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
564 # be set in compliance with the
565 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
566 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
567 # @mutable gmail.users.messages.insert gmail.users.messages.send
568 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700569 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700570 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700571 "A String",
572 ],
573 "id": "A String", # The immutable ID of the message.
574 },
575 "id": "A String", # The immutable ID of the draft.
576}
577
578 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 -0800579 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Dan O'Mearadd494642020-05-01 07:42:23 -0700580 x__xgafv: string, V1 error format.
581 Allowed values
582 1 - v1 error format
583 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700584
585Returns:
586 An object of the form:
587
588 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700589 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
590 # ordering in the inbox. For normal SMTP-received email, this represents the
591 # time the message was originally accepted by Google, which is more reliable
592 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
593 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700594 "historyId": "A String", # The ID of the last history record that modified this message.
595 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700596 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
597 # container MIME message parts.
598 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
599 # May be empty for MIME container
600 # types that have no message body or when the body data is sent as a
601 # separate attachment. An attachment ID is present if the body data is
602 # contained in a separate attachment.
603 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
604 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
605 # When not present, the entire content of the message part body is
606 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800607 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700608 },
609 "mimeType": "A String", # The MIME type of the message part.
610 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700611 "filename": "A String", # The filename of the attachment. Only present if this message part
612 # represents an attachment.
613 "headers": [ # List of headers on this message part. For the top-level message part,
614 # representing the entire message payload, it will contain the standard
615 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
616 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700617 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700618 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
619 # example, &lt;code&gt;To&lt;/code&gt;.
620 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
621 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700622 },
623 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700624 "parts": [ # The child MIME message parts of this part. This only applies to container
625 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
626 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
627 # field is empty. For more information, see
628 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700629 # Object with schema name: MessagePart
630 ],
631 },
632 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700633 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
634 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
635 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
636 # parameter is supplied.
637 # @mutable gmail.users.messages.insert gmail.users.messages.send
638 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700639 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700640 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
641 # a thread, the following criteria must be met:
642 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
643 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
644 # request.&lt;/li&gt;
645 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
646 # be set in compliance with the
647 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
648 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
649 # @mutable gmail.users.messages.insert gmail.users.messages.send
650 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700651 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700652 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700653 "A String",
654 ],
655 "id": "A String", # The immutable ID of the message.
656 }</pre>
657</div>
658
659<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700660 <code class="details" id="update">update(userId, id, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700661 <pre>Replaces a draft's content.
662
663Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700664 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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
670{ # A draft email in the user's mailbox.
671 "message": { # An email message. # The message content of the draft.
Dan O'Mearadd494642020-05-01 07:42:23 -0700672 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
673 # ordering in the inbox. For normal SMTP-received email, this represents the
674 # time the message was originally accepted by Google, which is more reliable
675 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
676 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700677 "historyId": "A String", # The ID of the last history record that modified this message.
678 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700679 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
680 # container MIME message parts.
681 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
682 # May be empty for MIME container
683 # types that have no message body or when the body data is sent as a
684 # separate attachment. An attachment ID is present if the body data is
685 # contained in a separate attachment.
686 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
687 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
688 # When not present, the entire content of the message part body is
689 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800690 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700691 },
692 "mimeType": "A String", # The MIME type of the message part.
693 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700694 "filename": "A String", # The filename of the attachment. Only present if this message part
695 # represents an attachment.
696 "headers": [ # List of headers on this message part. For the top-level message part,
697 # representing the entire message payload, it will contain the standard
698 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
699 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700700 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700701 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
702 # example, &lt;code&gt;To&lt;/code&gt;.
703 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
704 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700705 },
706 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700707 "parts": [ # The child MIME message parts of this part. This only applies to container
708 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
709 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
710 # field is empty. For more information, see
711 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700712 # Object with schema name: MessagePart
713 ],
714 },
715 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700716 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
717 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
718 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
719 # parameter is supplied.
720 # @mutable gmail.users.messages.insert gmail.users.messages.send
721 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700722 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700723 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
724 # a thread, the following criteria must be met:
725 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
726 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
727 # request.&lt;/li&gt;
728 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
729 # be set in compliance with the
730 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
731 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
732 # @mutable gmail.users.messages.insert gmail.users.messages.send
733 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700734 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700735 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700736 "A String",
737 ],
738 "id": "A String", # The immutable ID of the message.
739 },
740 "id": "A String", # The immutable ID of the draft.
741}
742
743 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 -0800744 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Dan O'Mearadd494642020-05-01 07:42:23 -0700745 x__xgafv: string, V1 error format.
746 Allowed values
747 1 - v1 error format
748 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700749
750Returns:
751 An object of the form:
752
753 { # A draft email in the user's mailbox.
754 "message": { # An email message. # The message content of the draft.
Dan O'Mearadd494642020-05-01 07:42:23 -0700755 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
756 # ordering in the inbox. For normal SMTP-received email, this represents the
757 # time the message was originally accepted by Google, which is more reliable
758 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
759 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700760 "historyId": "A String", # The ID of the last history record that modified this message.
761 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700762 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
763 # container MIME message parts.
764 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
765 # May be empty for MIME container
766 # types that have no message body or when the body data is sent as a
767 # separate attachment. An attachment ID is present if the body data is
768 # contained in a separate attachment.
769 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
770 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
771 # When not present, the entire content of the message part body is
772 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800773 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700774 },
775 "mimeType": "A String", # The MIME type of the message part.
776 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700777 "filename": "A String", # The filename of the attachment. Only present if this message part
778 # represents an attachment.
779 "headers": [ # List of headers on this message part. For the top-level message part,
780 # representing the entire message payload, it will contain the standard
781 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
782 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700783 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700784 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
785 # example, &lt;code&gt;To&lt;/code&gt;.
786 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
787 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700788 },
789 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700790 "parts": [ # The child MIME message parts of this part. This only applies to container
791 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
792 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
793 # field is empty. For more information, see
794 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700795 # Object with schema name: MessagePart
796 ],
797 },
798 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700799 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
800 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
801 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
802 # parameter is supplied.
803 # @mutable gmail.users.messages.insert gmail.users.messages.send
804 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700805 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700806 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
807 # a thread, the following criteria must be met:
808 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
809 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
810 # request.&lt;/li&gt;
811 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
812 # be set in compliance with the
813 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
814 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
815 # @mutable gmail.users.messages.insert gmail.users.messages.send
816 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700817 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700818 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700819 "A String",
820 ],
821 "id": "A String", # The immutable ID of the message.
822 },
823 "id": "A String", # The immutable ID of the draft.
824 }</pre>
825</div>
826
827</body></html>