blob: d16eb8d05ec39282e1ef4f43789d06c6d5b4c63f [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">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070081 <code><a href="#create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
82<p class="firstline">Creates a new draft with the `DRAFT` label.</p>
Craig Citro065b5302014-08-14 00:47:23 -070083<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070084 <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085<p class="firstline">Immediately and permanently deletes the specified draft. Does not simply trash it.</p>
Craig Citro065b5302014-08-14 00:47:23 -070086<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070087 <code><a href="#get">get(userId, id, format=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070088<p class="firstline">Gets the specified draft.</p>
89<p class="toc_element">
Bu Sun Kim673ec5c2020-11-16 11:05:03 -070090 <code><a href="#list">list(userId, q=None, pageToken=None, maxResults=None, includeSpamTrash=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070091<p class="firstline">Lists the drafts in the user's mailbox.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070096 <code><a href="#send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070097<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 -070098<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070099 <code><a href="#update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -0700100<p class="firstline">Replaces a draft's content.</p>
101<h3>Method Details</h3>
102<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700103 <code class="details" id="close">close()</code>
104 <pre>Close httplib2 connections.</pre>
105</div>
106
107<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700108 <code class="details" id="create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
109 <pre>Creates a new draft with the `DRAFT` label.
Craig Citro065b5302014-08-14 00:47:23 -0700110
111Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700112 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 -0700113 body: object, The request body.
114 The object takes the form of:
115
Bu Sun Kim65020912020-05-20 12:08:20 -0700116{ # A draft email in the user&#x27;s mailbox.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700117 &quot;message&quot;: { # An email message. # The message content of the draft.
118 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
119 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
120 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
121 &quot;A String&quot;,
122 ],
123 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
124 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
125 &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.
126 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700127 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700128 &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`.
129 {
130 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
131 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700132 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700133 ],
134 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
135 &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.
136 &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.
137 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
138 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700139 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700140 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Craig Citro065b5302014-08-14 00:47:23 -0700141 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700142 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
143 &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.
144 &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.
145 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
146 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
147 },
148 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
149}
Craig Citro065b5302014-08-14 00:47:23 -0700150
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700151 x__xgafv: string, V1 error format.
152 Allowed values
153 1 - v1 error format
154 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700155 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 -0800156 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 -0700157
158Returns:
159 An object of the form:
160
Bu Sun Kim65020912020-05-20 12:08:20 -0700161 { # A draft email in the user&#x27;s mailbox.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700162 &quot;message&quot;: { # An email message. # The message content of the draft.
163 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
164 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
165 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
166 &quot;A String&quot;,
167 ],
168 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
169 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
170 &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.
171 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700172 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700173 &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`.
174 {
175 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
176 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700177 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700178 ],
179 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
180 &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.
181 &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.
182 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
183 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700184 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700185 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Craig Citro065b5302014-08-14 00:47:23 -0700186 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700187 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
188 &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.
189 &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.
190 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
191 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
192 },
193 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
194 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700195</div>
196
197<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700198 <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700199 <pre>Immediately and permanently deletes the specified draft. Does not simply trash it.
Craig Citro065b5302014-08-14 00:47:23 -0700200
201Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700202 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 -0700203 id: string, The ID of the draft to delete. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700204 x__xgafv: string, V1 error format.
205 Allowed values
206 1 - v1 error format
207 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700208</pre>
209</div>
210
211<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700212 <code class="details" id="get">get(userId, id, format=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700213 <pre>Gets the specified draft.
214
215Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700216 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 -0700217 id: string, The ID of the draft to retrieve. (required)
218 format: string, The format to return the draft in.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700219 Allowed values
220 minimal - Returns only email message ID and labels; does not return the email headers, body, or payload.
221 full - Returns the full email message data with body content parsed in the `payload` field; the `raw` field is not used. Format cannot be used when accessing the api using the gmail.metadata scope.
222 raw - Returns the full email message data with body content in the `raw` field as a base64url encoded string; the `payload` field is not used. Format cannot be used when accessing the api using the gmail.metadata scope.
223 metadata - Returns only email message ID, labels, and email headers.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700224 x__xgafv: string, V1 error format.
Craig Citro065b5302014-08-14 00:47:23 -0700225 Allowed values
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700226 1 - v1 error format
227 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700228
229Returns:
230 An object of the form:
231
Bu Sun Kim65020912020-05-20 12:08:20 -0700232 { # A draft email in the user&#x27;s mailbox.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700233 &quot;message&quot;: { # An email message. # The message content of the draft.
234 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
235 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
236 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
237 &quot;A String&quot;,
238 ],
239 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
240 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
241 &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.
242 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700243 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700244 &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`.
245 {
246 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
247 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700248 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700249 ],
250 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
251 &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.
252 &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.
253 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
254 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700255 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700256 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Craig Citro065b5302014-08-14 00:47:23 -0700257 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700258 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
259 &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.
260 &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.
261 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
262 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
263 },
264 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
265 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700266</div>
267
268<div class="method">
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700269 <code class="details" id="list">list(userId, q=None, pageToken=None, maxResults=None, includeSpamTrash=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700270 <pre>Lists the drafts in the user&#x27;s mailbox.
Craig Citro065b5302014-08-14 00:47:23 -0700271
272Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700273 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
274 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;`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700275 pageToken: string, Page token to retrieve a specific page of results in the list.
Craig Citro065b5302014-08-14 00:47:23 -0700276 maxResults: integer, Maximum number of drafts to return.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700277 includeSpamTrash: boolean, Include drafts from `SPAM` and `TRASH` in the results.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700278 x__xgafv: string, V1 error format.
279 Allowed values
280 1 - v1 error format
281 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700282
283Returns:
284 An object of the form:
285
286 {
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700287 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700288 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results in the list.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700289 &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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700290 { # A draft email in the user&#x27;s mailbox.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700291 &quot;message&quot;: { # An email message. # The message content of the draft.
292 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
293 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
294 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
295 &quot;A String&quot;,
296 ],
297 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
298 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
299 &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.
300 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700301 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700302 &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`.
303 {
304 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
305 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700306 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700307 ],
308 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
309 &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.
310 &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.
311 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
312 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700313 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700314 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Craig Citro065b5302014-08-14 00:47:23 -0700315 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700316 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
317 &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.
318 &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.
319 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
320 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700321 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700322 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
323 },
Craig Citro065b5302014-08-14 00:47:23 -0700324 ],
325 }</pre>
326</div>
327
328<div class="method">
329 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
330 <pre>Retrieves the next page of results.
331
332Args:
333 previous_request: The request for the previous page. (required)
334 previous_response: The response from the request for the previous page. (required)
335
336Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700337 A request object that you can call &#x27;execute()&#x27; on to request the next
Craig Citro065b5302014-08-14 00:47:23 -0700338 page. Returns None if there are no more items in the collection.
339 </pre>
340</div>
341
342<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700343 <code class="details" id="send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700344 <pre>Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.
Craig Citro065b5302014-08-14 00:47:23 -0700345
346Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700347 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 -0700348 body: object, The request body.
349 The object takes the form of:
350
Bu Sun Kim65020912020-05-20 12:08:20 -0700351{ # A draft email in the user&#x27;s mailbox.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700352 &quot;message&quot;: { # An email message. # The message content of the draft.
353 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
354 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
355 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
356 &quot;A String&quot;,
357 ],
358 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
359 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
360 &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.
361 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700362 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700363 &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`.
364 {
365 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
366 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700367 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700368 ],
369 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
370 &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.
371 &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.
372 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
373 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700374 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700375 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Craig Citro065b5302014-08-14 00:47:23 -0700376 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700377 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
378 &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.
379 &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.
380 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
381 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
382 },
383 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
384}
Craig Citro065b5302014-08-14 00:47:23 -0700385
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700386 x__xgafv: string, V1 error format.
387 Allowed values
388 1 - v1 error format
389 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700390 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 -0800391 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 -0700392
393Returns:
394 An object of the form:
395
396 { # An email message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700397 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700398 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700399 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700400 &quot;A String&quot;,
401 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700402 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700403 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
404 &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.
405 # Object with schema name: MessagePart
406 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700407 &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`.
408 {
409 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
410 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
411 },
412 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700413 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
414 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700415 &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.
416 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700417 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700418 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700419 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700420 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700421 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700422 &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.
423 &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.
424 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
425 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700426 }</pre>
427</div>
428
429<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700430 <code class="details" id="update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700431 <pre>Replaces a draft&#x27;s content.
Craig Citro065b5302014-08-14 00:47:23 -0700432
433Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700434 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 -0700435 id: string, The ID of the draft to update. (required)
436 body: object, The request body.
437 The object takes the form of:
438
Bu Sun Kim65020912020-05-20 12:08:20 -0700439{ # A draft email in the user&#x27;s mailbox.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700440 &quot;message&quot;: { # An email message. # The message content of the draft.
441 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
442 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
443 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
444 &quot;A String&quot;,
445 ],
446 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
447 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
448 &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.
449 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700450 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700451 &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`.
452 {
453 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
454 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700455 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700456 ],
457 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
458 &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.
459 &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.
460 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
461 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700462 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700463 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Craig Citro065b5302014-08-14 00:47:23 -0700464 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700465 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
466 &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.
467 &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.
468 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
469 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
470 },
471 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
472}
Craig Citro065b5302014-08-14 00:47:23 -0700473
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700474 x__xgafv: string, V1 error format.
475 Allowed values
476 1 - v1 error format
477 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700478 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 -0800479 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 -0700480
481Returns:
482 An object of the form:
483
Bu Sun Kim65020912020-05-20 12:08:20 -0700484 { # A draft email in the user&#x27;s mailbox.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700485 &quot;message&quot;: { # An email message. # The message content of the draft.
486 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
487 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
488 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
489 &quot;A String&quot;,
490 ],
491 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
492 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
493 &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.
494 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700495 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700496 &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`.
497 {
498 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
499 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700500 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700501 ],
502 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
503 &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.
504 &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.
505 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
506 &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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700507 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700508 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
Craig Citro065b5302014-08-14 00:47:23 -0700509 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700510 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
511 &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.
512 &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.
513 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
514 &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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.
515 },
516 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
517 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700518</div>
519
520</body></html>