blob: 2b7374e8a3fb1ed0cd9f6b18a10814631525f845 [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 Kim65020912020-05-20 12:08:20 -070078 <code><a href="#create">create(userId, body=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 Kim65020912020-05-20 12:08:20 -070081 <code><a href="#delete">delete(userId, id)</a></code></p>
82<p class="firstline">Immediately and permanently deletes the specified draft. Does not simply trash it.</p>
Craig Citro065b5302014-08-14 00:47:23 -070083<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070084 <code><a href="#get">get(userId, id, format=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 Kim65020912020-05-20 12:08:20 -070087 <code><a href="#list">list(userId, includeSpamTrash=None, maxResults=None, pageToken=None, q=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 Kim65020912020-05-20 12:08:20 -070093 <code><a href="#send">send(userId, body=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 To, Cc, and Bcc headers.</p>
Craig Citro065b5302014-08-14 00:47:23 -070095<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070096 <code><a href="#update">update(userId, id, body=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 Kim65020912020-05-20 12:08:20 -0700100 <code class="details" id="create">create(userId, body=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 Kim65020912020-05-20 12:08:20 -0700104 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700105 body: object, The request body.
106 The object takes the form of:
107
Bu Sun Kim65020912020-05-20 12:08:20 -0700108{ # A draft email in the user&#x27;s mailbox.
109 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
110 &quot;message&quot;: { # An email message. # The message content of the draft.
111 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
112 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
113 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
114 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
115 &quot;A String&quot;,
116 ],
117 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
118 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
119 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
120 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
121 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700122 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700123 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
124 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
125 {
126 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
127 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
128 },
129 ],
130 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
131 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
132 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
133 # Object with schema name: MessagePart
134 ],
135 },
136 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
137 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
138 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
139 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
140 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
141 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
142 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700143 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700144 }
Craig Citro065b5302014-08-14 00:47:23 -0700145
146 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 -0800147 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 -0700148
149Returns:
150 An object of the form:
151
Bu Sun Kim65020912020-05-20 12:08:20 -0700152 { # A draft email in the user&#x27;s mailbox.
153 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
154 &quot;message&quot;: { # An email message. # The message content of the draft.
155 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
156 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
157 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
158 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
159 &quot;A String&quot;,
160 ],
161 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
162 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
163 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
164 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
165 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700166 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
168 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
169 {
170 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
171 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
172 },
173 ],
174 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
175 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
176 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
177 # Object with schema name: MessagePart
178 ],
179 },
180 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
181 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
182 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
183 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
184 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
185 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
186 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700187 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700188 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700189</div>
190
191<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700192 <code class="details" id="delete">delete(userId, id)</code>
193 <pre>Immediately and permanently deletes the specified draft. Does not simply trash it.
Craig Citro065b5302014-08-14 00:47:23 -0700194
195Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700196 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700197 id: string, The ID of the draft to delete. (required)
198</pre>
199</div>
200
201<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700202 <code class="details" id="get">get(userId, id, format=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700203 <pre>Gets the specified draft.
204
205Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700206 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700207 id: string, The ID of the draft to retrieve. (required)
208 format: string, The format to return the draft in.
209 Allowed values
Bu Sun Kim65020912020-05-20 12:08:20 -0700210 full -
211 metadata -
212 minimal -
213 raw -
Craig Citro065b5302014-08-14 00:47:23 -0700214
215Returns:
216 An object of the form:
217
Bu Sun Kim65020912020-05-20 12:08:20 -0700218 { # A draft email in the user&#x27;s mailbox.
219 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
220 &quot;message&quot;: { # An email message. # The message content of the draft.
221 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
222 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
223 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
224 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
225 &quot;A String&quot;,
226 ],
227 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
228 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
229 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
230 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
231 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700232 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700233 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
234 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
235 {
236 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
237 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
238 },
239 ],
240 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
241 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
242 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
243 # Object with schema name: MessagePart
244 ],
245 },
246 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
247 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
248 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
249 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
250 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
251 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
252 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700253 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700254 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700255</div>
256
257<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700258 <code class="details" id="list">list(userId, includeSpamTrash=None, maxResults=None, pageToken=None, q=None)</code>
259 <pre>Lists the drafts in the user&#x27;s mailbox.
Craig Citro065b5302014-08-14 00:47:23 -0700260
261Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700262 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
263 includeSpamTrash: boolean, Include drafts from SPAM and TRASH in the results.
Craig Citro065b5302014-08-14 00:47:23 -0700264 maxResults: integer, Maximum number of drafts to return.
Bu Sun Kim65020912020-05-20 12:08:20 -0700265 pageToken: string, Page token to retrieve a specific page of results in the list.
266 q: string, Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, &quot;from:someuser@example.com rfc822msgid: is:unread&quot;.
Craig Citro065b5302014-08-14 00:47:23 -0700267
268Returns:
269 An object of the form:
270
271 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700272 &quot;drafts&quot;: [ # List of drafts. Note that the Message property in each Draft resource only contains an id and a threadId. The messages.get method can fetch additional message details.
273 { # A draft email in the user&#x27;s mailbox.
274 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
275 &quot;message&quot;: { # An email message. # The message content of the draft.
276 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
277 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
278 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
279 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
280 &quot;A String&quot;,
281 ],
282 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
283 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
284 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
285 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
286 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700287 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700288 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
289 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
290 {
291 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
292 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
293 },
294 ],
295 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
296 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
297 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
298 # Object with schema name: MessagePart
299 ],
300 },
301 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
302 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
303 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
304 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
305 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
306 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
307 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700308 },
Craig Citro065b5302014-08-14 00:47:23 -0700309 },
Craig Citro065b5302014-08-14 00:47:23 -0700310 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700311 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results in the list.
312 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
Craig Citro065b5302014-08-14 00:47:23 -0700313 }</pre>
314</div>
315
316<div class="method">
317 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
318 <pre>Retrieves the next page of results.
319
320Args:
321 previous_request: The request for the previous page. (required)
322 previous_response: The response from the request for the previous page. (required)
323
324Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700325 A request object that you can call &#x27;execute()&#x27; on to request the next
Craig Citro065b5302014-08-14 00:47:23 -0700326 page. Returns None if there are no more items in the collection.
327 </pre>
328</div>
329
330<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700331 <code class="details" id="send">send(userId, body=None, media_body=None, media_mime_type=None)</code>
332 <pre>Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
Craig Citro065b5302014-08-14 00:47:23 -0700333
334Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700335 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700336 body: object, The request body.
337 The object takes the form of:
338
Bu Sun Kim65020912020-05-20 12:08:20 -0700339{ # A draft email in the user&#x27;s mailbox.
340 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
341 &quot;message&quot;: { # An email message. # The message content of the draft.
342 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
343 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
344 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
345 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
346 &quot;A String&quot;,
347 ],
348 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
349 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
350 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
351 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
352 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700353 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700354 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
355 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
356 {
357 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
358 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
359 },
360 ],
361 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
362 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
363 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
364 # Object with schema name: MessagePart
365 ],
366 },
367 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
368 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
369 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
370 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
371 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
372 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
373 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700374 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 }
Craig Citro065b5302014-08-14 00:47:23 -0700376
377 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 -0800378 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 -0700379
380Returns:
381 An object of the form:
382
383 { # An email message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700384 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
385 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
386 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
387 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
388 &quot;A String&quot;,
389 ],
390 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
391 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
392 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
393 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
394 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700395 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700396 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
397 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
Craig Citro065b5302014-08-14 00:47:23 -0700398 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700399 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
400 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
Craig Citro065b5302014-08-14 00:47:23 -0700401 },
402 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700403 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
404 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
405 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
Craig Citro065b5302014-08-14 00:47:23 -0700406 # Object with schema name: MessagePart
407 ],
408 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700409 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
410 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
411 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
412 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
413 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
414 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
415 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700416 }</pre>
417</div>
418
419<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700420 <code class="details" id="update">update(userId, id, body=None, media_body=None, media_mime_type=None)</code>
421 <pre>Replaces a draft&#x27;s content.
Craig Citro065b5302014-08-14 00:47:23 -0700422
423Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700424 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700425 id: string, The ID of the draft to update. (required)
426 body: object, The request body.
427 The object takes the form of:
428
Bu Sun Kim65020912020-05-20 12:08:20 -0700429{ # A draft email in the user&#x27;s mailbox.
430 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
431 &quot;message&quot;: { # An email message. # The message content of the draft.
432 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
433 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
434 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
435 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
436 &quot;A String&quot;,
437 ],
438 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
439 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
440 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
441 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
442 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700443 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700444 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
445 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
446 {
447 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
448 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
449 },
450 ],
451 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
452 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
453 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
454 # Object with schema name: MessagePart
455 ],
456 },
457 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
458 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
459 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
460 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
461 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
462 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
463 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700464 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700465 }
Craig Citro065b5302014-08-14 00:47:23 -0700466
467 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 -0800468 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 -0700469
470Returns:
471 An object of the form:
472
Bu Sun Kim65020912020-05-20 12:08:20 -0700473 { # A draft email in the user&#x27;s mailbox.
474 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
475 &quot;message&quot;: { # An email message. # The message content of the draft.
476 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
477 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
478 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.
479 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
480 &quot;A String&quot;,
481 ],
482 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
483 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
484 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field.
485 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.
486 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700487 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700488 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
489 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
490 {
491 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
492 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
493 },
494 ],
495 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
496 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
497 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
498 # Object with schema name: MessagePart
499 ],
500 },
501 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
502 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
503 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
504 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
505 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
506 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
507 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700508 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700509 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700510</div>
511
512</body></html>