blob: 960378e828bdf06ca164b264fb3c40b685f79462 [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">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -080081 <code><a href="#create">create(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</a></code></p>
Bu Sun Kimd059ad82020-07-22 17:02:09 -070082<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">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -080090 <code><a href="#list">list(userId, includeSpamTrash=None, maxResults=None, pageToken=None, q=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">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -080096 <code><a href="#send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=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">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -080099 <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 -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">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800108 <code class="details" id="create">create(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</code>
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700109 <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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800117 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
118 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800119 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
120 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
121 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800122 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
123 &quot;A String&quot;,
124 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800125 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800126 &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.
127 &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.
128 &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.
129 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
130 },
131 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800132 &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`.
133 {
134 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
135 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800136 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800137 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800138 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
139 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
140 &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.
141 # Object with schema name: MessagePart
142 ],
Craig Citro065b5302014-08-14 00:47:23 -0700143 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800144 &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;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800146 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800147 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800148 },
149}
Craig Citro065b5302014-08-14 00:47:23 -0700150
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800151 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
152 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700153 x__xgafv: string, V1 error format.
154 Allowed values
155 1 - v1 error format
156 2 - v2 error format
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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800162 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
163 &quot;message&quot;: { # An email message. # The message content of the draft.
164 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
165 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
166 &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.
167 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
168 &quot;A String&quot;,
169 ],
170 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
171 &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.
172 &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.
173 &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.
174 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700175 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800176 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
177 &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`.
178 {
179 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
180 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
181 },
182 ],
183 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
184 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
185 &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.
186 # Object with schema name: MessagePart
187 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800188 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800189 &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;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
191 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
192 &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.
193 },
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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800233 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
234 &quot;message&quot;: { # An email message. # The message content of the draft.
235 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
236 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
237 &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.
238 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
239 &quot;A String&quot;,
240 ],
241 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
242 &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.
243 &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.
244 &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.
245 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700246 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800247 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
248 &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`.
249 {
250 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
251 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
252 },
253 ],
254 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
255 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
256 &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.
257 # Object with schema name: MessagePart
258 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800259 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800260 &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;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
262 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
263 &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.
264 },
265}</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700266</div>
267
268<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800269 <code class="details" id="list">list(userId, includeSpamTrash=None, maxResults=None, pageToken=None, q=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)
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800274 includeSpamTrash: boolean, Include drafts from `SPAM` and `TRASH` in the results.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800275 maxResults: integer, Maximum number of drafts to return.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800276 pageToken: string, Page token to retrieve a specific page of results in the list.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800277 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 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 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800287 &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.
288 { # A draft email in the user&#x27;s mailbox.
289 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
290 &quot;message&quot;: { # An email message. # The message content of the draft.
291 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
292 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
293 &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.
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;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.
299 &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.
300 &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.
301 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700302 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800303 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
304 &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`.
305 {
306 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
307 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
308 },
309 ],
310 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
311 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
312 &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.
313 # Object with schema name: MessagePart
314 ],
Craig Citro065b5302014-08-14 00:47:23 -0700315 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800316 &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.
317 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
318 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
319 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800320 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800321 },
322 ],
323 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results in the list.
324 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
325}</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700326</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">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800343 <code class="details" id="send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800352 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
353 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800354 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
355 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
356 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800357 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
358 &quot;A String&quot;,
359 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800360 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800361 &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.
362 &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.
363 &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.
364 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
365 },
366 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800367 &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`.
368 {
369 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
370 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800371 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800372 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800373 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
374 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
375 &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.
376 # Object with schema name: MessagePart
377 ],
Craig Citro065b5302014-08-14 00:47:23 -0700378 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800379 &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;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800381 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800382 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800383 },
384}
Craig Citro065b5302014-08-14 00:47:23 -0700385
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800386 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
387 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700388 x__xgafv: string, V1 error format.
389 Allowed values
390 1 - v1 error format
391 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700392
393Returns:
394 An object of the form:
395
396 { # An email message.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800397 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
398 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
399 &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.
400 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
401 &quot;A String&quot;,
402 ],
403 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
404 &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.
405 &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.
406 &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.
407 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800408 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800409 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
410 &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`.
411 {
412 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
413 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
414 },
415 ],
416 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
417 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
418 &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.
419 # Object with schema name: MessagePart
420 ],
421 },
422 &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.
423 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
424 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
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.
426}</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700427</div>
428
429<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800430 <code class="details" id="update">update(userId, id, body=None, media_body=None, media_mime_type=None, x__xgafv=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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800440 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
441 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800442 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
443 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
444 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800445 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
446 &quot;A String&quot;,
447 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800448 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800449 &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.
450 &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.
451 &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.
452 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
453 },
454 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800455 &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`.
456 {
457 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
458 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800459 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800460 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800461 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
462 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
463 &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.
464 # Object with schema name: MessagePart
465 ],
Craig Citro065b5302014-08-14 00:47:23 -0700466 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800467 &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;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800469 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800470 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800471 },
472}
Craig Citro065b5302014-08-14 00:47:23 -0700473
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800474 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
475 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700476 x__xgafv: string, V1 error format.
477 Allowed values
478 1 - v1 error format
479 2 - v2 error format
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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800485 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
486 &quot;message&quot;: { # An email message. # The message content of the draft.
487 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
488 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
489 &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.
490 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
491 &quot;A String&quot;,
492 ],
493 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
494 &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.
495 &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.
496 &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.
497 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700498 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800499 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
500 &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`.
501 {
502 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
503 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
504 },
505 ],
506 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
507 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
508 &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.
509 # Object with schema name: MessagePart
510 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800511 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800512 &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;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
514 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
515 &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.
516 },
517}</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700518</div>
519
520</body></html>