blob: 56d1a508abe69418b5c5283b3e356310e865ecda [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.threads.html">threads</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070078 <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
79<p class="firstline">Immediately and permanently deletes the specified thread. This operation</p>
Craig Citro065b5302014-08-14 00:47:23 -070080<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070081 <code><a href="#get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070082<p class="firstline">Gets the specified thread.</p>
83<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070084 <code><a href="#list">list(userId, q=None, includeSpamTrash=None, pageToken=None, maxResults=None, labelIds=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070085<p class="firstline">Lists the threads in the user's mailbox.</p>
86<p class="toc_element">
87 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
88<p class="firstline">Retrieves the next page of results.</p>
89<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070090 <code><a href="#modify">modify(userId, id, body=None, x__xgafv=None)</a></code></p>
91<p class="firstline">Modifies the labels applied to the thread. This applies to all messages</p>
Craig Citro065b5302014-08-14 00:47:23 -070092<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070093 <code><a href="#trash">trash(userId, id, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070094<p class="firstline">Moves the specified thread to the trash.</p>
95<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070096 <code><a href="#untrash">untrash(userId, id, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070097<p class="firstline">Removes the specified thread from the trash.</p>
98<h3>Method Details</h3>
99<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700100 <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
101 <pre>Immediately and permanently deletes the specified thread. This operation
102cannot be undone. Prefer `threads.trash` instead.
Craig Citro065b5302014-08-14 00:47:23 -0700103
104Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700105 userId: string, The user&#x27;s email address. The special value `me`
106can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700107 id: string, ID of the Thread to delete. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700108 x__xgafv: string, V1 error format.
109 Allowed values
110 1 - v1 error format
111 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700112</pre>
113</div>
114
115<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700116 <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700117 <pre>Gets the specified thread.
118
119Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700120 userId: string, The user&#x27;s email address. The special value `me`
121can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700122 id: string, The ID of the thread to retrieve. (required)
Craig Citroe633be12015-03-02 13:40:36 -0800123 format: string, The format to return the messages in.
Craig Citroe633be12015-03-02 13:40:36 -0800124 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700125 x__xgafv: string, V1 error format.
126 Allowed values
127 1 - v1 error format
128 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700129
130Returns:
131 An object of the form:
132
133 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700134 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700135 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
136 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700137 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700138 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700139 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
140 # a thread, the following criteria must be met:
141 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
142 # `Message` or `Draft.Message` you supply with your
143 # request.&lt;/li&gt;
144 # &lt;li&gt;The `References` and `In-Reply-To` headers must
145 # be set in compliance with the
146 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
147 # &lt;li&gt;The `Subject` headers must match.
148 # @mutable gmail.users.messages.insert gmail.users.messages.send
149 # @mutable gmail.users.drafts.create gmail.users.drafts.update
150 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
151 # ordering in the inbox. For normal SMTP-received email, this represents the
152 # time the message was originally accepted by Google, which is more reliable
153 # than the `Date` header. However, for API-migrated mail, it can
154 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700155 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700156 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700157 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700159 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
160 # MIME message parts, for example `multipart/*`. For non-
161 # container MIME message part types, such as `text/plain`, this
162 # field is empty. For more information, see
163 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700164 # Object with schema name: MessagePart
165 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700166 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
167 # representing the entire message payload, it will contain the standard
168 # RFC 2822 email headers such as `To`, `From`, and
169 # `Subject`.
170 {
171 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
172 # example, `To`.
173 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
174 # `someuser@example.com`.
175 },
176 ],
177 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
178 # represents an attachment.
179 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
180 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
181 # container MIME message parts.
182 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
183 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
184 # retrieved in a separate `messages.attachments.get` request.
185 # When not present, the entire content of the message part body is
186 # contained in the data field.
187 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
188 # May be empty for MIME container
189 # types that have no message body or when the body data is sent as a
190 # separate attachment. An attachment ID is present if the body data is
191 # contained in a separate attachment.
192 },
Craig Citro065b5302014-08-14 00:47:23 -0700193 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700194 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700195 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700196 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
197 # encoded string. Returned in `messages.get` and
198 # `drafts.get` responses when the `format=RAW`
199 # parameter is supplied.
200 # @mutable gmail.users.messages.insert gmail.users.messages.send
201 # @mutable gmail.users.drafts.create gmail.users.drafts.update
202 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
203 # @mutable gmail.users.messages.insert gmail.users.messages.modify
204 &quot;A String&quot;,
205 ],
Craig Citro065b5302014-08-14 00:47:23 -0700206 },
207 ],
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="list">list(userId, q=None, includeSpamTrash=None, pageToken=None, maxResults=None, labelIds=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700213 <pre>Lists the threads in the user&#x27;s mailbox.
Craig Citro065b5302014-08-14 00:47:23 -0700214
215Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700216 userId: string, The user&#x27;s email address. The special value `me`
217can be used to indicate the authenticated user. (required)
218 q: string, Only return threads matching the specified query. Supports the same
219query format as the Gmail search box. For example,
220`&quot;from:someuser@example.com rfc822msgid:&lt;somemsgid@example.com&gt;
221is:unread&quot;`. Parameter cannot be used when accessing the api
222using the gmail.metadata scope.
223 includeSpamTrash: boolean, Include threads from `SPAM` and `TRASH`
224in the results.
Bu Sun Kim65020912020-05-20 12:08:20 -0700225 pageToken: string, Page token to retrieve a specific page of results in the list.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700226 maxResults: integer, Maximum number of threads to return.
227 labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated)
228 x__xgafv: string, V1 error format.
229 Allowed values
230 1 - v1 error format
231 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700232
233Returns:
234 An object of the form:
235
236 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700237 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700238 &quot;threads&quot;: [ # List of threads. Note that each thread resource does not contain a list of
239 # `messages`. The list of `messages` for a given thread
240 # can be fetched using the
241 # &lt;a href=&quot;/gmail/api/v1/reference/users/threads/get&quot;&gt;threads.get&lt;/a&gt; method.
Craig Citro065b5302014-08-14 00:47:23 -0700242 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700244 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
245 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700246 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700247 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700248 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
249 # a thread, the following criteria must be met:
250 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
251 # `Message` or `Draft.Message` you supply with your
252 # request.&lt;/li&gt;
253 # &lt;li&gt;The `References` and `In-Reply-To` headers must
254 # be set in compliance with the
255 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
256 # &lt;li&gt;The `Subject` headers must match.
257 # @mutable gmail.users.messages.insert gmail.users.messages.send
258 # @mutable gmail.users.drafts.create gmail.users.drafts.update
259 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
260 # ordering in the inbox. For normal SMTP-received email, this represents the
261 # time the message was originally accepted by Google, which is more reliable
262 # than the `Date` header. However, for API-migrated mail, it can
263 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700264 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700265 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700266 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700267 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700268 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
269 # MIME message parts, for example `multipart/*`. For non-
270 # container MIME message part types, such as `text/plain`, this
271 # field is empty. For more information, see
272 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700273 # Object with schema name: MessagePart
274 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700275 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
276 # representing the entire message payload, it will contain the standard
277 # RFC 2822 email headers such as `To`, `From`, and
278 # `Subject`.
279 {
280 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
281 # example, `To`.
282 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
283 # `someuser@example.com`.
284 },
285 ],
286 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
287 # represents an attachment.
288 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
289 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
290 # container MIME message parts.
291 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
292 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
293 # retrieved in a separate `messages.attachments.get` request.
294 # When not present, the entire content of the message part body is
295 # contained in the data field.
296 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
297 # May be empty for MIME container
298 # types that have no message body or when the body data is sent as a
299 # separate attachment. An attachment ID is present if the body data is
300 # contained in a separate attachment.
301 },
Craig Citro065b5302014-08-14 00:47:23 -0700302 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700303 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700304 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700305 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
306 # encoded string. Returned in `messages.get` and
307 # `drafts.get` responses when the `format=RAW`
308 # parameter is supplied.
309 # @mutable gmail.users.messages.insert gmail.users.messages.send
310 # @mutable gmail.users.drafts.create gmail.users.drafts.update
311 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
312 # @mutable gmail.users.messages.insert gmail.users.messages.modify
313 &quot;A String&quot;,
314 ],
Craig Citro065b5302014-08-14 00:47:23 -0700315 },
316 ],
Craig Citro065b5302014-08-14 00:47:23 -0700317 },
318 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700319 &quot;nextPageToken&quot;: &quot;A String&quot;, # Page token to retrieve the next page of results in the list.
Craig Citro065b5302014-08-14 00:47:23 -0700320 }</pre>
321</div>
322
323<div class="method">
324 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
325 <pre>Retrieves the next page of results.
326
327Args:
328 previous_request: The request for the previous page. (required)
329 previous_response: The response from the request for the previous page. (required)
330
331Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700332 A request object that you can call &#x27;execute()&#x27; on to request the next
Craig Citro065b5302014-08-14 00:47:23 -0700333 page. Returns None if there are no more items in the collection.
334 </pre>
335</div>
336
337<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700338 <code class="details" id="modify">modify(userId, id, body=None, x__xgafv=None)</code>
339 <pre>Modifies the labels applied to the thread. This applies to all messages
340in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700341
342Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700343 userId: string, The user&#x27;s email address. The special value `me`
344can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700345 id: string, The ID of the thread to modify. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700346 body: object, The request body.
Craig Citro065b5302014-08-14 00:47:23 -0700347 The object takes the form of:
348
349{
Bu Sun Kim65020912020-05-20 12:08:20 -0700350 &quot;addLabelIds&quot;: [ # A list of IDs of labels to add to this thread.
351 &quot;A String&quot;,
Craig Citro065b5302014-08-14 00:47:23 -0700352 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700353 &quot;removeLabelIds&quot;: [ # A list of IDs of labels to remove from this thread.
354 &quot;A String&quot;,
Craig Citro065b5302014-08-14 00:47:23 -0700355 ],
356 }
357
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700358 x__xgafv: string, V1 error format.
359 Allowed values
360 1 - v1 error format
361 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700362
363Returns:
364 An object of the form:
365
366 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700367 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700368 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
369 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700370 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700371 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700372 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
373 # a thread, the following criteria must be met:
374 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
375 # `Message` or `Draft.Message` you supply with your
376 # request.&lt;/li&gt;
377 # &lt;li&gt;The `References` and `In-Reply-To` headers must
378 # be set in compliance with the
379 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
380 # &lt;li&gt;The `Subject` headers must match.
381 # @mutable gmail.users.messages.insert gmail.users.messages.send
382 # @mutable gmail.users.drafts.create gmail.users.drafts.update
383 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
384 # ordering in the inbox. For normal SMTP-received email, this represents the
385 # time the message was originally accepted by Google, which is more reliable
386 # than the `Date` header. However, for API-migrated mail, it can
387 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700388 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700389 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700390 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700391 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700392 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
393 # MIME message parts, for example `multipart/*`. For non-
394 # container MIME message part types, such as `text/plain`, this
395 # field is empty. For more information, see
396 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700397 # Object with schema name: MessagePart
398 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700399 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
400 # representing the entire message payload, it will contain the standard
401 # RFC 2822 email headers such as `To`, `From`, and
402 # `Subject`.
403 {
404 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
405 # example, `To`.
406 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
407 # `someuser@example.com`.
408 },
409 ],
410 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
411 # represents an attachment.
412 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
413 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
414 # container MIME message parts.
415 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
416 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
417 # retrieved in a separate `messages.attachments.get` request.
418 # When not present, the entire content of the message part body is
419 # contained in the data field.
420 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
421 # May be empty for MIME container
422 # types that have no message body or when the body data is sent as a
423 # separate attachment. An attachment ID is present if the body data is
424 # contained in a separate attachment.
425 },
Craig Citro065b5302014-08-14 00:47:23 -0700426 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700427 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700428 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700429 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
430 # encoded string. Returned in `messages.get` and
431 # `drafts.get` responses when the `format=RAW`
432 # parameter is supplied.
433 # @mutable gmail.users.messages.insert gmail.users.messages.send
434 # @mutable gmail.users.drafts.create gmail.users.drafts.update
435 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
436 # @mutable gmail.users.messages.insert gmail.users.messages.modify
437 &quot;A String&quot;,
438 ],
Craig Citro065b5302014-08-14 00:47:23 -0700439 },
440 ],
Craig Citro065b5302014-08-14 00:47:23 -0700441 }</pre>
442</div>
443
444<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700445 <code class="details" id="trash">trash(userId, id, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700446 <pre>Moves the specified thread to the trash.
447
448Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700449 userId: string, The user&#x27;s email address. The special value `me`
450can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700451 id: string, The ID of the thread to Trash. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700452 x__xgafv: string, V1 error format.
453 Allowed values
454 1 - v1 error format
455 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700456
457Returns:
458 An object of the form:
459
460 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700461 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700462 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
463 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700464 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700465 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700466 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
467 # a thread, the following criteria must be met:
468 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
469 # `Message` or `Draft.Message` you supply with your
470 # request.&lt;/li&gt;
471 # &lt;li&gt;The `References` and `In-Reply-To` headers must
472 # be set in compliance with the
473 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
474 # &lt;li&gt;The `Subject` headers must match.
475 # @mutable gmail.users.messages.insert gmail.users.messages.send
476 # @mutable gmail.users.drafts.create gmail.users.drafts.update
477 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
478 # ordering in the inbox. For normal SMTP-received email, this represents the
479 # time the message was originally accepted by Google, which is more reliable
480 # than the `Date` header. However, for API-migrated mail, it can
481 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700482 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700483 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700484 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700485 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700486 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
487 # MIME message parts, for example `multipart/*`. For non-
488 # container MIME message part types, such as `text/plain`, this
489 # field is empty. For more information, see
490 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700491 # Object with schema name: MessagePart
492 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700493 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
494 # representing the entire message payload, it will contain the standard
495 # RFC 2822 email headers such as `To`, `From`, and
496 # `Subject`.
497 {
498 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
499 # example, `To`.
500 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
501 # `someuser@example.com`.
502 },
503 ],
504 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
505 # represents an attachment.
506 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
507 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
508 # container MIME message parts.
509 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
510 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
511 # retrieved in a separate `messages.attachments.get` request.
512 # When not present, the entire content of the message part body is
513 # contained in the data field.
514 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
515 # May be empty for MIME container
516 # types that have no message body or when the body data is sent as a
517 # separate attachment. An attachment ID is present if the body data is
518 # contained in a separate attachment.
519 },
Craig Citro065b5302014-08-14 00:47:23 -0700520 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700521 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700522 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700523 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
524 # encoded string. Returned in `messages.get` and
525 # `drafts.get` responses when the `format=RAW`
526 # parameter is supplied.
527 # @mutable gmail.users.messages.insert gmail.users.messages.send
528 # @mutable gmail.users.drafts.create gmail.users.drafts.update
529 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
530 # @mutable gmail.users.messages.insert gmail.users.messages.modify
531 &quot;A String&quot;,
532 ],
Craig Citro065b5302014-08-14 00:47:23 -0700533 },
534 ],
Craig Citro065b5302014-08-14 00:47:23 -0700535 }</pre>
536</div>
537
538<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700539 <code class="details" id="untrash">untrash(userId, id, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700540 <pre>Removes the specified thread from the trash.
541
542Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700543 userId: string, The user&#x27;s email address. The special value `me`
544can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700545 id: string, The ID of the thread to remove from Trash. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700546 x__xgafv: string, V1 error format.
547 Allowed values
548 1 - v1 error format
549 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700550
551Returns:
552 An object of the form:
553
554 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700555 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700556 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
557 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700558 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700559 { # An email message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700560 &quot;threadId&quot;: &quot;A String&quot;, # The ID of the thread the message belongs to. To add a message or draft to
561 # a thread, the following criteria must be met:
562 # &lt;ol&gt;&lt;li&gt;The requested `threadId` must be specified on the
563 # `Message` or `Draft.Message` you supply with your
564 # request.&lt;/li&gt;
565 # &lt;li&gt;The `References` and `In-Reply-To` headers must
566 # be set in compliance with the
567 # &lt;a href=&quot;https://tools.ietf.org/html/rfc2822&quot;&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
568 # &lt;li&gt;The `Subject` headers must match.
569 # @mutable gmail.users.messages.insert gmail.users.messages.send
570 # @mutable gmail.users.drafts.create gmail.users.drafts.update
571 &quot;internalDate&quot;: &quot;A String&quot;, # The internal message creation timestamp (epoch ms), which determines
572 # ordering in the inbox. For normal SMTP-received email, this represents the
573 # time the message was originally accepted by Google, which is more reliable
574 # than the `Date` header. However, for API-migrated mail, it can
575 # be configured by client to be based on the `Date` header.
Bu Sun Kim65020912020-05-20 12:08:20 -0700576 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700577 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700578 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim65020912020-05-20 12:08:20 -0700579 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700580 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container
581 # MIME message parts, for example `multipart/*`. For non-
582 # container MIME message part types, such as `text/plain`, this
583 # field is empty. For more information, see
584 # &lt;a href=&quot;http://www.ietf.org/rfc/rfc1521.txt&quot;&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700585 # Object with schema name: MessagePart
586 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700587 &quot;headers&quot;: [ # List of headers on this message part. For the top-level message part,
588 # representing the entire message payload, it will contain the standard
589 # RFC 2822 email headers such as `To`, `From`, and
590 # `Subject`.
591 {
592 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For
593 # example, `To`.
594 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example,
595 # `someuser@example.com`.
596 },
597 ],
598 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part
599 # represents an attachment.
600 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
601 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for
602 # container MIME message parts.
603 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
604 &quot;attachmentId&quot;: &quot;A String&quot;, # When present, contains the ID of an external attachment that can be
605 # retrieved in a separate `messages.attachments.get` request.
606 # When not present, the entire content of the message part body is
607 # contained in the data field.
608 &quot;data&quot;: &quot;A String&quot;, # The body data of a MIME message part as a base64url encoded string.
609 # May be empty for MIME container
610 # types that have no message body or when the body data is sent as a
611 # separate attachment. An attachment ID is present if the body data is
612 # contained in a separate attachment.
613 },
Craig Citro065b5302014-08-14 00:47:23 -0700614 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700615 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700616 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700617 &quot;raw&quot;: &quot;A String&quot;, # The entire email message in an RFC 2822 formatted and base64url
618 # encoded string. Returned in `messages.get` and
619 # `drafts.get` responses when the `format=RAW`
620 # parameter is supplied.
621 # @mutable gmail.users.messages.insert gmail.users.messages.send
622 # @mutable gmail.users.drafts.create gmail.users.drafts.update
623 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
624 # @mutable gmail.users.messages.insert gmail.users.messages.modify
625 &quot;A String&quot;,
626 ],
Craig Citro065b5302014-08-14 00:47:23 -0700627 },
628 ],
Craig Citro065b5302014-08-14 00:47:23 -0700629 }</pre>
630</div>
631
632</body></html>