Debian Codegraph @

docs/dyn/gmail_v1.users.threads.html

raw
1 <html><body>
2 <style>
3
4 body, 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
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, 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">
78 <code><a href="#close">close()</a></code></p>
79 <p class="firstline">Close httplib2 connections.</p>
80 <p class="toc_element">
81 <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
82 <p class="firstline">Immediately and permanently deletes the specified thread. Any messages that belong to the thread are also deleted. This operation cannot be undone. Prefer `threads.trash` instead. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).</p>
83 <p class="toc_element">
84 <code><a href="#get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</a></code></p>
85 <p class="firstline">Gets the specified thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).</p>
86 <p class="toc_element">
87 <code><a href="#list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=None, x__xgafv=None)</a></code></p>
88 <p class="firstline">Lists the threads in the user's mailbox. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).</p>
89 <p class="toc_element">
90 <code><a href="#list_next">list_next()</a></code></p>
91 <p class="firstline">Retrieves the next page of results.</p>
92 <p class="toc_element">
93 <code><a href="#modify">modify(userId, id, body=None, x__xgafv=None)</a></code></p>
94 <p class="firstline">Modifies the labels applied to the thread. This applies to all messages in the thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).</p>
95 <p class="toc_element">
96 <code><a href="#trash">trash(userId, id, x__xgafv=None)</a></code></p>
97 <p class="firstline">Moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).</p>
98 <p class="toc_element">
99 <code><a href="#untrash">untrash(userId, id, x__xgafv=None)</a></code></p>
100 <p class="firstline">Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).</p>
101 <h3>Method Details</h3>
102 <div class="method">
103 <code class="details" id="close">close()</code>
104 <pre>Close httplib2 connections.</pre>
105 </div>
106
107 <div class="method">
108 <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
109 <pre>Immediately and permanently deletes the specified thread. Any messages that belong to the thread are also deleted. This operation cannot be undone. Prefer `threads.trash` instead. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).
110
111 Args:
112 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
113 id: string, ID of the Thread to delete. (required)
114 x__xgafv: string, V1 error format.
115 Allowed values
116 1 - v1 error format
117 2 - v2 error format
118 </pre>
119 </div>
120
121 <div class="method">
122 <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</code>
123 <pre>Gets the specified thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).
124
125 Args:
126 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
127 id: string, The ID of the thread to retrieve. (required)
128 format: string, The format to return the messages in.
129 Allowed values
130 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.
131 metadata - Returns only email message IDs, labels, and email headers.
132 minimal - Returns only email message IDs and labels; does not return the email headers, body, or payload.
133 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
134 x__xgafv: string, V1 error format.
135 Allowed values
136 1 - v1 error format
137 2 - v2 error format
138
139 Returns:
140 An object of the form:
141
142 { # A collection of messages representing a conversation.
143 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
144 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
145 &quot;messages&quot;: [ # The list of messages in the thread.
146 { # An email message.
147 &quot;classificationLabelValues&quot;: [ # Classification Label values on the message. Available Classification Label schemas can be queried using the Google Drive Labels API. Each classification label ID must be unique. If duplicate IDs are provided, only one will be retained, and the selection is arbitrary. Only used for Google Workspace accounts. There&#x27;s a limit of 20 Classification Label values per request. If the Classification Label values exceeds the maximum allowed number, the request fails.
148 { # Classification Labels applied to the email message. Classification Labels are different from Gmail inbox labels. Only used for Google Workspace accounts. [Learn more about classification labels](https://support.google.com/a/answer/9292382).
149 &quot;fields&quot;: [ # Field values for the given classification label ID.
150 { # Field values for a classification label.
151 &quot;fieldId&quot;: &quot;A String&quot;, # Required. The field ID for the Classification Label Value. Maps to the ID field of the Google Drive `Label.Field` object.
152 &quot;selection&quot;: &quot;A String&quot;, # Selection choice ID for the selection option. Should only be set if the field type is `SELECTION` in the Google Drive `Label.Field` object. Maps to the id field of the Google Drive `Label.Field.SelectionOptions` resource.
153 },
154 ],
155 &quot;labelId&quot;: &quot;A String&quot;, # Required. The canonical or raw alphanumeric classification label ID. Maps to the ID field of the Google Drive Label resource.
156 },
157 ],
158 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
159 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
160 &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.
161 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
162 &quot;A String&quot;,
163 ],
164 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
165 &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.
166 &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.
167 &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.
168 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
169 },
170 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
171 &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`.
172 {
173 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
174 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `[email protected]`.
175 },
176 ],
177 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
178 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
179 &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.
180 # Object with schema name: MessagePart
181 ],
182 },
183 &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. @required gmail.users.drafts.create gmail.users.drafts.update
184 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
185 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
186 &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.
187 },
188 ],
189 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
190 }</pre>
191 </div>
192
193 <div class="method">
194 <code class="details" id="list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=None, x__xgafv=None)</code>
195 <pre>Lists the threads in the user&#x27;s mailbox. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).
196
197 Args:
198 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
199 includeSpamTrash: boolean, Include threads from `SPAM` and `TRASH` in the results.
200 labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated)
201 maxResults: integer, Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500.
202 pageToken: string, Page token to retrieve a specific page of results in the list.
203 q: string, Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:[email protected] rfc822msgid: is:unread&quot;`. Parameter cannot be used when accessing the api using the gmail.metadata scope.
204 x__xgafv: string, V1 error format.
205 Allowed values
206 1 - v1 error format
207 2 - v2 error format
208
209 Returns:
210 An object of the form:
211
212 {
213 &quot;nextPageToken&quot;: &quot;A String&quot;, # Page token to retrieve the next page of results in the list.
214 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
215 &quot;threads&quot;: [ # List of threads. Note that each thread resource does not contain a list of `messages`. The list of `messages` for a given thread can be fetched using the [`threads.get`](https://developers.google.com/workspace/gmail/api/v1/reference/users/threads/get) method.
216 { # A collection of messages representing a conversation.
217 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
218 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
219 &quot;messages&quot;: [ # The list of messages in the thread.
220 { # An email message.
221 &quot;classificationLabelValues&quot;: [ # Classification Label values on the message. Available Classification Label schemas can be queried using the Google Drive Labels API. Each classification label ID must be unique. If duplicate IDs are provided, only one will be retained, and the selection is arbitrary. Only used for Google Workspace accounts. There&#x27;s a limit of 20 Classification Label values per request. If the Classification Label values exceeds the maximum allowed number, the request fails.
222 { # Classification Labels applied to the email message. Classification Labels are different from Gmail inbox labels. Only used for Google Workspace accounts. [Learn more about classification labels](https://support.google.com/a/answer/9292382).
223 &quot;fields&quot;: [ # Field values for the given classification label ID.
224 { # Field values for a classification label.
225 &quot;fieldId&quot;: &quot;A String&quot;, # Required. The field ID for the Classification Label Value. Maps to the ID field of the Google Drive `Label.Field` object.
226 &quot;selection&quot;: &quot;A String&quot;, # Selection choice ID for the selection option. Should only be set if the field type is `SELECTION` in the Google Drive `Label.Field` object. Maps to the id field of the Google Drive `Label.Field.SelectionOptions` resource.
227 },
228 ],
229 &quot;labelId&quot;: &quot;A String&quot;, # Required. The canonical or raw alphanumeric classification label ID. Maps to the ID field of the Google Drive Label resource.
230 },
231 ],
232 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
233 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
234 &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.
235 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
236 &quot;A String&quot;,
237 ],
238 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
239 &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.
240 &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.
241 &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.
242 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
243 },
244 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
245 &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`.
246 {
247 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
248 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `[email protected]`.
249 },
250 ],
251 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
252 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
253 &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.
254 # Object with schema name: MessagePart
255 ],
256 },
257 &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. @required gmail.users.drafts.create gmail.users.drafts.update
258 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
259 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
260 &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.
261 },
262 ],
263 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
264 },
265 ],
266 }</pre>
267 </div>
268
269 <div class="method">
270 <code class="details" id="list_next">list_next()</code>
271 <pre>Retrieves the next page of results.
272
273 Args:
274 previous_request: The request for the previous page. (required)
275 previous_response: The response from the request for the previous page. (required)
276
277 Returns:
278 A request object that you can call &#x27;execute()&#x27; on to request the next
279 page. Returns None if there are no more items in the collection.
280 </pre>
281 </div>
282
283 <div class="method">
284 <code class="details" id="modify">modify(userId, id, body=None, x__xgafv=None)</code>
285 <pre>Modifies the labels applied to the thread. This applies to all messages in the thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).
286
287 Args:
288 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
289 id: string, The ID of the thread to modify. (required)
290 body: object, The request body.
291 The object takes the form of:
292
293 {
294 &quot;addLabelIds&quot;: [ # A list of IDs of labels to add to this thread. You can add up to 100 labels with each update.
295 &quot;A String&quot;,
296 ],
297 &quot;removeLabelIds&quot;: [ # A list of IDs of labels to remove from this thread. You can remove up to 100 labels with each update.
298 &quot;A String&quot;,
299 ],
300 }
301
302 x__xgafv: string, V1 error format.
303 Allowed values
304 1 - v1 error format
305 2 - v2 error format
306
307 Returns:
308 An object of the form:
309
310 { # A collection of messages representing a conversation.
311 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
312 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
313 &quot;messages&quot;: [ # The list of messages in the thread.
314 { # An email message.
315 &quot;classificationLabelValues&quot;: [ # Classification Label values on the message. Available Classification Label schemas can be queried using the Google Drive Labels API. Each classification label ID must be unique. If duplicate IDs are provided, only one will be retained, and the selection is arbitrary. Only used for Google Workspace accounts. There&#x27;s a limit of 20 Classification Label values per request. If the Classification Label values exceeds the maximum allowed number, the request fails.
316 { # Classification Labels applied to the email message. Classification Labels are different from Gmail inbox labels. Only used for Google Workspace accounts. [Learn more about classification labels](https://support.google.com/a/answer/9292382).
317 &quot;fields&quot;: [ # Field values for the given classification label ID.
318 { # Field values for a classification label.
319 &quot;fieldId&quot;: &quot;A String&quot;, # Required. The field ID for the Classification Label Value. Maps to the ID field of the Google Drive `Label.Field` object.
320 &quot;selection&quot;: &quot;A String&quot;, # Selection choice ID for the selection option. Should only be set if the field type is `SELECTION` in the Google Drive `Label.Field` object. Maps to the id field of the Google Drive `Label.Field.SelectionOptions` resource.
321 },
322 ],
323 &quot;labelId&quot;: &quot;A String&quot;, # Required. The canonical or raw alphanumeric classification label ID. Maps to the ID field of the Google Drive Label resource.
324 },
325 ],
326 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
327 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
328 &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.
329 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
330 &quot;A String&quot;,
331 ],
332 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
333 &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.
334 &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.
335 &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.
336 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
337 },
338 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
339 &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`.
340 {
341 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
342 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `[email protected]`.
343 },
344 ],
345 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
346 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
347 &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.
348 # Object with schema name: MessagePart
349 ],
350 },
351 &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. @required gmail.users.drafts.create gmail.users.drafts.update
352 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
353 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
354 &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.
355 },
356 ],
357 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
358 }</pre>
359 </div>
360
361 <div class="method">
362 <code class="details" id="trash">trash(userId, id, x__xgafv=None)</code>
363 <pre>Moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).
364
365 Args:
366 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
367 id: string, The ID of the thread to Trash. (required)
368 x__xgafv: string, V1 error format.
369 Allowed values
370 1 - v1 error format
371 2 - v2 error format
372
373 Returns:
374 An object of the form:
375
376 { # A collection of messages representing a conversation.
377 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
378 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
379 &quot;messages&quot;: [ # The list of messages in the thread.
380 { # An email message.
381 &quot;classificationLabelValues&quot;: [ # Classification Label values on the message. Available Classification Label schemas can be queried using the Google Drive Labels API. Each classification label ID must be unique. If duplicate IDs are provided, only one will be retained, and the selection is arbitrary. Only used for Google Workspace accounts. There&#x27;s a limit of 20 Classification Label values per request. If the Classification Label values exceeds the maximum allowed number, the request fails.
382 { # Classification Labels applied to the email message. Classification Labels are different from Gmail inbox labels. Only used for Google Workspace accounts. [Learn more about classification labels](https://support.google.com/a/answer/9292382).
383 &quot;fields&quot;: [ # Field values for the given classification label ID.
384 { # Field values for a classification label.
385 &quot;fieldId&quot;: &quot;A String&quot;, # Required. The field ID for the Classification Label Value. Maps to the ID field of the Google Drive `Label.Field` object.
386 &quot;selection&quot;: &quot;A String&quot;, # Selection choice ID for the selection option. Should only be set if the field type is `SELECTION` in the Google Drive `Label.Field` object. Maps to the id field of the Google Drive `Label.Field.SelectionOptions` resource.
387 },
388 ],
389 &quot;labelId&quot;: &quot;A String&quot;, # Required. The canonical or raw alphanumeric classification label ID. Maps to the ID field of the Google Drive Label resource.
390 },
391 ],
392 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
393 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
394 &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.
395 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
396 &quot;A String&quot;,
397 ],
398 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
399 &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.
400 &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.
401 &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.
402 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
403 },
404 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
405 &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`.
406 {
407 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
408 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `[email protected]`.
409 },
410 ],
411 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
412 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
413 &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.
414 # Object with schema name: MessagePart
415 ],
416 },
417 &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. @required gmail.users.drafts.create gmail.users.drafts.update
418 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
419 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
420 &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.
421 },
422 ],
423 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
424 }</pre>
425 </div>
426
427 <div class="method">
428 <code class="details" id="untrash">untrash(userId, id, x__xgafv=None)</code>
429 <pre>Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).
430
431 Args:
432 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
433 id: string, The ID of the thread to remove from Trash. (required)
434 x__xgafv: string, V1 error format.
435 Allowed values
436 1 - v1 error format
437 2 - v2 error format
438
439 Returns:
440 An object of the form:
441
442 { # A collection of messages representing a conversation.
443 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
444 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
445 &quot;messages&quot;: [ # The list of messages in the thread.
446 { # An email message.
447 &quot;classificationLabelValues&quot;: [ # Classification Label values on the message. Available Classification Label schemas can be queried using the Google Drive Labels API. Each classification label ID must be unique. If duplicate IDs are provided, only one will be retained, and the selection is arbitrary. Only used for Google Workspace accounts. There&#x27;s a limit of 20 Classification Label values per request. If the Classification Label values exceeds the maximum allowed number, the request fails.
448 { # Classification Labels applied to the email message. Classification Labels are different from Gmail inbox labels. Only used for Google Workspace accounts. [Learn more about classification labels](https://support.google.com/a/answer/9292382).
449 &quot;fields&quot;: [ # Field values for the given classification label ID.
450 { # Field values for a classification label.
451 &quot;fieldId&quot;: &quot;A String&quot;, # Required. The field ID for the Classification Label Value. Maps to the ID field of the Google Drive `Label.Field` object.
452 &quot;selection&quot;: &quot;A String&quot;, # Selection choice ID for the selection option. Should only be set if the field type is `SELECTION` in the Google Drive `Label.Field` object. Maps to the id field of the Google Drive `Label.Field.SelectionOptions` resource.
453 },
454 ],
455 &quot;labelId&quot;: &quot;A String&quot;, # Required. The canonical or raw alphanumeric classification label ID. Maps to the ID field of the Google Drive Label resource.
456 },
457 ],
458 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
459 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
460 &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.
461 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
462 &quot;A String&quot;,
463 ],
464 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
465 &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.
466 &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.
467 &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.
468 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
469 },
470 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
471 &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`.
472 {
473 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
474 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `[email protected]`.
475 },
476 ],
477 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
478 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
479 &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.
480 # Object with schema name: MessagePart
481 ],
482 },
483 &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. @required gmail.users.drafts.create gmail.users.drafts.update
484 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
485 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
486 &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.
487 },
488 ],
489 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
490 }</pre>
491 </div>
492
493 </body></html>