blob: 465ad26ce50c154b88188694de3992864683c93d [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">
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#get">get(userId, id, format=None, x__xgafv=None, metadataHeaders=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">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#list">list(userId, labelIds=None, pageToken=None, includeSpamTrash=None, maxResults=None, q=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">
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -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 &lt;code&gt;threads.trash&lt;/code&gt; instead.
Craig Citro065b5302014-08-14 00:47:23 -0700103
104Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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)
Dan O'Mearadd494642020-05-01 07:42:23 -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">
Dan O'Mearadd494642020-05-01 07:42:23 -0700116 <code class="details" id="get">get(userId, id, format=None, x__xgafv=None, metadataHeaders=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700117 <pre>Gets the specified thread.
118
119Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 x__xgafv: string, V1 error format.
Craig Citroe633be12015-03-02 13:40:36 -0800125 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -0700126 1 - v1 error format
127 2 - v2 error format
Craig Citroe633be12015-03-02 13:40:36 -0800128 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700129
130Returns:
131 An object of the form:
132
133 { # A collection of messages representing a conversation.
134 "snippet": "A String", # A short part of the message text.
135 "messages": [ # The list of messages in the thread.
136 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700137 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
138 # ordering in the inbox. For normal SMTP-received email, this represents the
139 # time the message was originally accepted by Google, which is more reliable
140 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
141 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700142 "historyId": "A String", # The ID of the last history record that modified this message.
143 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700144 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
145 # container MIME message parts.
146 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
147 # May be empty for MIME container
148 # types that have no message body or when the body data is sent as a
149 # separate attachment. An attachment ID is present if the body data is
150 # contained in a separate attachment.
151 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
152 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
153 # When not present, the entire content of the message part body is
154 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800155 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700156 },
157 "mimeType": "A String", # The MIME type of the message part.
158 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700159 "filename": "A String", # The filename of the attachment. Only present if this message part
160 # represents an attachment.
161 "headers": [ # List of headers on this message part. For the top-level message part,
162 # representing the entire message payload, it will contain the standard
163 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
164 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700165 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700166 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
167 # example, &lt;code&gt;To&lt;/code&gt;.
168 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
169 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700170 },
171 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700172 "parts": [ # The child MIME message parts of this part. This only applies to container
173 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
174 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
175 # field is empty. For more information, see
176 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700177 # Object with schema name: MessagePart
178 ],
179 },
180 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700181 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
182 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
183 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
184 # parameter is supplied.
185 # @mutable gmail.users.messages.insert gmail.users.messages.send
186 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700187 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700188 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
189 # a thread, the following criteria must be met:
190 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
191 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
192 # request.&lt;/li&gt;
193 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
194 # be set in compliance with the
195 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
196 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
197 # @mutable gmail.users.messages.insert gmail.users.messages.send
198 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700199 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700200 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700201 "A String",
202 ],
203 "id": "A String", # The immutable ID of the message.
204 },
205 ],
206 "id": "A String", # The unique ID of the thread.
207 "historyId": "A String", # The ID of the last history record that modified this thread.
208 }</pre>
209</div>
210
211<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700212 <code class="details" id="list">list(userId, labelIds=None, pageToken=None, includeSpamTrash=None, maxResults=None, q=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700213 <pre>Lists the threads in the user's mailbox.
214
215Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700216 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
217can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700218 labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700219 pageToken: string, Page token to retrieve a specific page of results in the list.
Dan O'Mearadd494642020-05-01 07:42:23 -0700220 includeSpamTrash: boolean, Include threads from &lt;code&gt;SPAM&lt;/code&gt; and &lt;code&gt;TRASH&lt;/code&gt;
221in the results.
Craig Citro065b5302014-08-14 00:47:23 -0700222 maxResults: integer, Maximum number of threads to return.
Dan O'Mearadd494642020-05-01 07:42:23 -0700223 q: string, Only return threads matching the specified query. Supports the same
224query format as the Gmail search box. For example,
225&lt;code&gt;"from:someuser@example.com rfc822msgid:&lt;somemsgid@example.com&gt;
226is:unread"&lt;/code&gt;. Parameter cannot be used when accessing the api
227using the gmail.metadata scope.
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 {
237 "nextPageToken": "A String", # Page token to retrieve the next page of results in the list.
238 "resultSizeEstimate": 42, # Estimated total number of results.
Dan O'Mearadd494642020-05-01 07:42:23 -0700239 "threads": [ # List of threads. Note that each thread resource does not contain a list of
240 # &lt;code&gt;messages&lt;/code&gt;. The list of &lt;code&gt;messages&lt;/code&gt; for a given thread
241 # can be fetched using the
242 # &lt;a href="/gmail/api/v1/reference/users/threads/get"&gt;threads.get&lt;/a&gt; method.
Craig Citro065b5302014-08-14 00:47:23 -0700243 { # A collection of messages representing a conversation.
244 "snippet": "A String", # A short part of the message text.
245 "messages": [ # The list of messages in the thread.
246 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700247 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
248 # ordering in the inbox. For normal SMTP-received email, this represents the
249 # time the message was originally accepted by Google, which is more reliable
250 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
251 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700252 "historyId": "A String", # The ID of the last history record that modified this message.
253 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700254 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
255 # container MIME message parts.
256 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
257 # May be empty for MIME container
258 # types that have no message body or when the body data is sent as a
259 # separate attachment. An attachment ID is present if the body data is
260 # contained in a separate attachment.
261 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
262 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
263 # When not present, the entire content of the message part body is
264 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800265 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700266 },
267 "mimeType": "A String", # The MIME type of the message part.
268 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700269 "filename": "A String", # The filename of the attachment. Only present if this message part
270 # represents an attachment.
271 "headers": [ # List of headers on this message part. For the top-level message part,
272 # representing the entire message payload, it will contain the standard
273 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
274 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700275 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700276 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
277 # example, &lt;code&gt;To&lt;/code&gt;.
278 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
279 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700280 },
281 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700282 "parts": [ # The child MIME message parts of this part. This only applies to container
283 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
284 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
285 # field is empty. For more information, see
286 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700287 # Object with schema name: MessagePart
288 ],
289 },
290 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700291 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
292 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
293 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
294 # parameter is supplied.
295 # @mutable gmail.users.messages.insert gmail.users.messages.send
296 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700297 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700298 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
299 # a thread, the following criteria must be met:
300 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
301 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
302 # request.&lt;/li&gt;
303 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
304 # be set in compliance with the
305 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
306 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
307 # @mutable gmail.users.messages.insert gmail.users.messages.send
308 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700309 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700310 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700311 "A String",
312 ],
313 "id": "A String", # The immutable ID of the message.
314 },
315 ],
316 "id": "A String", # The unique ID of the thread.
317 "historyId": "A String", # The ID of the last history record that modified this thread.
318 },
319 ],
320 }</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:
332 A request object that you can call 'execute()' on to request the next
333 page. Returns None if there are no more items in the collection.
334 </pre>
335</div>
336
337<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -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:
Dan O'Mearadd494642020-05-01 07:42:23 -0700343 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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{
350 "removeLabelIds": [ # A list of IDs of labels to remove from this thread.
351 "A String",
352 ],
353 "addLabelIds": [ # A list of IDs of labels to add to this thread.
354 "A String",
355 ],
356 }
357
Dan O'Mearadd494642020-05-01 07:42:23 -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.
367 "snippet": "A String", # A short part of the message text.
368 "messages": [ # The list of messages in the thread.
369 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700370 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
371 # ordering in the inbox. For normal SMTP-received email, this represents the
372 # time the message was originally accepted by Google, which is more reliable
373 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
374 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700375 "historyId": "A String", # The ID of the last history record that modified this message.
376 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700377 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
378 # container MIME message parts.
379 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
380 # May be empty for MIME container
381 # types that have no message body or when the body data is sent as a
382 # separate attachment. An attachment ID is present if the body data is
383 # contained in a separate attachment.
384 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
385 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
386 # When not present, the entire content of the message part body is
387 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800388 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700389 },
390 "mimeType": "A String", # The MIME type of the message part.
391 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700392 "filename": "A String", # The filename of the attachment. Only present if this message part
393 # represents an attachment.
394 "headers": [ # List of headers on this message part. For the top-level message part,
395 # representing the entire message payload, it will contain the standard
396 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
397 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700398 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700399 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
400 # example, &lt;code&gt;To&lt;/code&gt;.
401 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
402 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700403 },
404 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700405 "parts": [ # The child MIME message parts of this part. This only applies to container
406 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
407 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
408 # field is empty. For more information, see
409 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700410 # Object with schema name: MessagePart
411 ],
412 },
413 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700414 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
415 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
416 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
417 # parameter is supplied.
418 # @mutable gmail.users.messages.insert gmail.users.messages.send
419 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700420 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700421 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
422 # a thread, the following criteria must be met:
423 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
424 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
425 # request.&lt;/li&gt;
426 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
427 # be set in compliance with the
428 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
429 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
430 # @mutable gmail.users.messages.insert gmail.users.messages.send
431 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700432 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700434 "A String",
435 ],
436 "id": "A String", # The immutable ID of the message.
437 },
438 ],
439 "id": "A String", # The unique ID of the thread.
440 "historyId": "A String", # The ID of the last history record that modified this thread.
441 }</pre>
442</div>
443
444<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -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:
Dan O'Mearadd494642020-05-01 07:42:23 -0700449 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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)
Dan O'Mearadd494642020-05-01 07:42:23 -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.
461 "snippet": "A String", # A short part of the message text.
462 "messages": [ # The list of messages in the thread.
463 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700464 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
465 # ordering in the inbox. For normal SMTP-received email, this represents the
466 # time the message was originally accepted by Google, which is more reliable
467 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
468 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700469 "historyId": "A String", # The ID of the last history record that modified this message.
470 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700471 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
472 # container MIME message parts.
473 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
474 # May be empty for MIME container
475 # types that have no message body or when the body data is sent as a
476 # separate attachment. An attachment ID is present if the body data is
477 # contained in a separate attachment.
478 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
479 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
480 # When not present, the entire content of the message part body is
481 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800482 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700483 },
484 "mimeType": "A String", # The MIME type of the message part.
485 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700486 "filename": "A String", # The filename of the attachment. Only present if this message part
487 # represents an attachment.
488 "headers": [ # List of headers on this message part. For the top-level message part,
489 # representing the entire message payload, it will contain the standard
490 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
491 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700492 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700493 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
494 # example, &lt;code&gt;To&lt;/code&gt;.
495 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
496 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700497 },
498 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700499 "parts": [ # The child MIME message parts of this part. This only applies to container
500 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
501 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
502 # field is empty. For more information, see
503 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700504 # Object with schema name: MessagePart
505 ],
506 },
507 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700508 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
509 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
510 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
511 # parameter is supplied.
512 # @mutable gmail.users.messages.insert gmail.users.messages.send
513 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700514 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700515 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
516 # a thread, the following criteria must be met:
517 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
518 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
519 # request.&lt;/li&gt;
520 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
521 # be set in compliance with the
522 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
523 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
524 # @mutable gmail.users.messages.insert gmail.users.messages.send
525 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700526 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700527 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700528 "A String",
529 ],
530 "id": "A String", # The immutable ID of the message.
531 },
532 ],
533 "id": "A String", # The unique ID of the thread.
534 "historyId": "A String", # The ID of the last history record that modified this thread.
535 }</pre>
536</div>
537
538<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -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:
Dan O'Mearadd494642020-05-01 07:42:23 -0700543 userId: string, The user's email address. The special value &lt;code&gt;me&lt;/code&gt;
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)
Dan O'Mearadd494642020-05-01 07:42:23 -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.
555 "snippet": "A String", # A short part of the message text.
556 "messages": [ # The list of messages in the thread.
557 { # An email message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700558 "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines
559 # ordering in the inbox. For normal SMTP-received email, this represents the
560 # time the message was originally accepted by Google, which is more reliable
561 # than the &lt;code&gt;Date&lt;/code&gt; header. However, for API-migrated mail, it can
562 # be configured by client to be based on the &lt;code&gt;Date&lt;/code&gt; header.
Craig Citro065b5302014-08-14 00:47:23 -0700563 "historyId": "A String", # The ID of the last history record that modified this message.
564 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
Dan O'Mearadd494642020-05-01 07:42:23 -0700565 "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for
566 # container MIME message parts.
567 "data": "A String", # The body data of a MIME message part as a base64url encoded string.
568 # May be empty for MIME container
569 # types that have no message body or when the body data is sent as a
570 # separate attachment. An attachment ID is present if the body data is
571 # contained in a separate attachment.
572 "attachmentId": "A String", # When present, contains the ID of an external attachment that can be
573 # retrieved in a separate &lt;code&gt;messages.attachments.get&lt;/code&gt; request.
574 # When not present, the entire content of the message part body is
575 # contained in the data field.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800576 "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700577 },
578 "mimeType": "A String", # The MIME type of the message part.
579 "partId": "A String", # The immutable ID of the message part.
Dan O'Mearadd494642020-05-01 07:42:23 -0700580 "filename": "A String", # The filename of the attachment. Only present if this message part
581 # represents an attachment.
582 "headers": [ # List of headers on this message part. For the top-level message part,
583 # representing the entire message payload, it will contain the standard
584 # RFC 2822 email headers such as &lt;code&gt;To&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt;, and
585 # &lt;code&gt;Subject&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700586 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700587 "name": "A String", # The name of the header before the &lt;code&gt;:&lt;/code&gt; separator. For
588 # example, &lt;code&gt;To&lt;/code&gt;.
589 "value": "A String", # The value of the header after the &lt;code&gt;:&lt;/code&gt; separator. For example,
590 # &lt;code&gt;someuser@example.com&lt;/code&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700591 },
592 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700593 "parts": [ # The child MIME message parts of this part. This only applies to container
594 # MIME message parts, for example &lt;code&gt;multipart/*&lt;/code&gt;. For non-
595 # container MIME message part types, such as &lt;code&gt;text/plain&lt;/code&gt;, this
596 # field is empty. For more information, see
597 # &lt;a href="http://www.ietf.org/rfc/rfc1521.txt"&gt;RFC 1521&lt;/a&gt;.
Craig Citro065b5302014-08-14 00:47:23 -0700598 # Object with schema name: MessagePart
599 ],
600 },
601 "snippet": "A String", # A short part of the message text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700602 "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url
603 # encoded string. Returned in &lt;code&gt;messages.get&lt;/code&gt; and
604 # &lt;code&gt;drafts.get&lt;/code&gt; responses when the &lt;code&gt;format=RAW&lt;/code&gt;
605 # parameter is supplied.
606 # @mutable gmail.users.messages.insert gmail.users.messages.send
607 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700608 "sizeEstimate": 42, # Estimated size in bytes of the message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700609 "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to
610 # a thread, the following criteria must be met:
611 # &lt;ol&gt;&lt;li&gt;The requested &lt;code&gt;threadId&lt;/code&gt; must be specified on the
612 # &lt;code&gt;Message&lt;/code&gt; or &lt;code&gt;Draft.Message&lt;/code&gt; you supply with your
613 # request.&lt;/li&gt;
614 # &lt;li&gt;The &lt;code&gt;References&lt;/code&gt; and &lt;code&gt;In-Reply-To&lt;/code&gt; headers must
615 # be set in compliance with the
616 # &lt;a href="https://tools.ietf.org/html/rfc2822"&gt;RFC 2822&lt;/a&gt; standard.&lt;/li&gt;
617 # &lt;li&gt;The &lt;code&gt;Subject&lt;/code&gt; headers must match.
618 # @mutable gmail.users.messages.insert gmail.users.messages.send
619 # @mutable gmail.users.drafts.create gmail.users.drafts.update
Craig Citro065b5302014-08-14 00:47:23 -0700620 "labelIds": [ # List of IDs of labels applied to this message.
Dan O'Mearadd494642020-05-01 07:42:23 -0700621 # @mutable gmail.users.messages.insert gmail.users.messages.modify
Craig Citro065b5302014-08-14 00:47:23 -0700622 "A String",
623 ],
624 "id": "A String", # The immutable ID of the message.
625 },
626 ],
627 "id": "A String", # The unique ID of the thread.
628 "historyId": "A String", # The ID of the last history record that modified this thread.
629 }</pre>
630</div>
631
632</body></html>