blob: 8f3075ba86e9cccc410f9e28adbd8df49f1f3c27 [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 Kim65020912020-05-20 12:08:20 -070078 <code><a href="#delete">delete(userId, id)</a></code></p>
79<p class="firstline">Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.</p>
Craig Citro065b5302014-08-14 00:47:23 -070080<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#get">get(userId, id, format=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">
Bu Sun Kim65020912020-05-20 12:08:20 -070084 <code><a href="#list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=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 Kim65020912020-05-20 12:08:20 -070090 <code><a href="#modify">modify(userId, id, body=None)</a></code></p>
91<p class="firstline">Modifies the labels applied to the thread. This applies to all messages in the thread.</p>
Craig Citro065b5302014-08-14 00:47:23 -070092<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070093 <code><a href="#trash">trash(userId, id)</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 Kim65020912020-05-20 12:08:20 -070096 <code><a href="#untrash">untrash(userId, id)</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 Kim65020912020-05-20 12:08:20 -0700100 <code class="details" id="delete">delete(userId, id)</code>
101 <pre>Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.
Craig Citro065b5302014-08-14 00:47:23 -0700102
103Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700104 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700105 id: string, ID of the Thread to delete. (required)
106</pre>
107</div>
108
109<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700110 <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700111 <pre>Gets the specified thread.
112
113Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700114 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700115 id: string, The ID of the thread to retrieve. (required)
Craig Citroe633be12015-03-02 13:40:36 -0800116 format: string, The format to return the messages in.
117 Allowed values
Bu Sun Kim65020912020-05-20 12:08:20 -0700118 full -
119 metadata -
120 minimal -
Craig Citroe633be12015-03-02 13:40:36 -0800121 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700122
123Returns:
124 An object of the form:
125
126 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700127 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
128 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
129 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700130 { # An email message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700131 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
132 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
133 &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.
134 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
135 &quot;A String&quot;,
136 ],
137 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
138 &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.
139 &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.
140 &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.
141 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700142 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700143 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
144 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700145 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700146 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
147 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
Craig Citro065b5302014-08-14 00:47:23 -0700148 },
149 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700150 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
151 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
152 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700153 # Object with schema name: MessagePart
154 ],
155 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700156 &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.
157 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
158 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
159 &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:
160 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
161 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
162 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700163 },
164 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700165 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Craig Citro065b5302014-08-14 00:47:23 -0700166 }</pre>
167</div>
168
169<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700170 <code class="details" id="list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=None)</code>
171 <pre>Lists the threads in the user&#x27;s mailbox.
Craig Citro065b5302014-08-14 00:47:23 -0700172
173Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700174 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
175 includeSpamTrash: boolean, Include threads from SPAM and TRASH in the results.
Craig Citro065b5302014-08-14 00:47:23 -0700176 labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700177 maxResults: integer, Maximum number of threads to return.
Bu Sun Kim65020912020-05-20 12:08:20 -0700178 pageToken: string, Page token to retrieve a specific page of results in the list.
179 q: string, Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, &quot;from:someuser@example.com rfc822msgid: is:unread&quot;. Parameter cannot be used when accessing the api using the gmail.metadata scope.
Craig Citro065b5302014-08-14 00:47:23 -0700180
181Returns:
182 An object of the form:
183
184 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700185 &quot;nextPageToken&quot;: &quot;A String&quot;, # Page token to retrieve the next page of results in the list.
186 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
187 &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 method.
Craig Citro065b5302014-08-14 00:47:23 -0700188 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700189 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
190 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
191 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700192 { # An email message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700193 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
194 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
195 &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.
196 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
197 &quot;A String&quot;,
198 ],
199 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
200 &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.
201 &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.
202 &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.
203 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700204 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700205 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
206 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700207 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700208 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
209 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
Craig Citro065b5302014-08-14 00:47:23 -0700210 },
211 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700212 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
213 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
214 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700215 # Object with schema name: MessagePart
216 ],
217 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700218 &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.
219 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
220 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
221 &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:
222 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
223 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
224 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700225 },
226 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700227 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Craig Citro065b5302014-08-14 00:47:23 -0700228 },
229 ],
230 }</pre>
231</div>
232
233<div class="method">
234 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
235 <pre>Retrieves the next page of results.
236
237Args:
238 previous_request: The request for the previous page. (required)
239 previous_response: The response from the request for the previous page. (required)
240
241Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700242 A request object that you can call &#x27;execute()&#x27; on to request the next
Craig Citro065b5302014-08-14 00:47:23 -0700243 page. Returns None if there are no more items in the collection.
244 </pre>
245</div>
246
247<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700248 <code class="details" id="modify">modify(userId, id, body=None)</code>
249 <pre>Modifies the labels applied to the thread. This applies to all messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700250
251Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700252 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700253 id: string, The ID of the thread to modify. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700254 body: object, The request body.
Craig Citro065b5302014-08-14 00:47:23 -0700255 The object takes the form of:
256
257{
Bu Sun Kim65020912020-05-20 12:08:20 -0700258 &quot;addLabelIds&quot;: [ # A list of IDs of labels to add to this thread.
259 &quot;A String&quot;,
Craig Citro065b5302014-08-14 00:47:23 -0700260 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700261 &quot;removeLabelIds&quot;: [ # A list of IDs of labels to remove from this thread.
262 &quot;A String&quot;,
Craig Citro065b5302014-08-14 00:47:23 -0700263 ],
264 }
265
266
267Returns:
268 An object of the form:
269
270 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700271 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
272 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
273 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700274 { # An email message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700275 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
276 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
277 &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.
278 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
279 &quot;A String&quot;,
280 ],
281 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
282 &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.
283 &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.
284 &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.
285 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700286 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700287 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
288 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700289 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700290 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
291 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
Craig Citro065b5302014-08-14 00:47:23 -0700292 },
293 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700294 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
295 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
296 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700297 # Object with schema name: MessagePart
298 ],
299 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700300 &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.
301 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
302 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
303 &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:
304 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
305 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
306 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700307 },
308 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700309 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Craig Citro065b5302014-08-14 00:47:23 -0700310 }</pre>
311</div>
312
313<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700314 <code class="details" id="trash">trash(userId, id)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700315 <pre>Moves the specified thread to the trash.
316
317Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700318 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700319 id: string, The ID of the thread to Trash. (required)
320
321Returns:
322 An object of the form:
323
324 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700325 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
326 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
327 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700328 { # An email message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700329 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
330 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
331 &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.
332 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
333 &quot;A String&quot;,
334 ],
335 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
336 &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.
337 &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.
338 &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.
339 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700340 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700341 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
342 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700343 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700344 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
345 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
Craig Citro065b5302014-08-14 00:47:23 -0700346 },
347 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700348 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
349 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
350 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700351 # Object with schema name: MessagePart
352 ],
353 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700354 &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.
355 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
356 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
357 &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:
358 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
359 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
360 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700361 },
362 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700363 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Craig Citro065b5302014-08-14 00:47:23 -0700364 }</pre>
365</div>
366
367<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700368 <code class="details" id="untrash">untrash(userId, id)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700369 <pre>Removes the specified thread from the trash.
370
371Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 userId: string, The user&#x27;s email address. The special value me can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700373 id: string, The ID of the thread to remove from Trash. (required)
374
375Returns:
376 An object of the form:
377
378 { # A collection of messages representing a conversation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700379 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this thread.
380 &quot;id&quot;: &quot;A String&quot;, # The unique ID of the thread.
381 &quot;messages&quot;: [ # The list of messages in the thread.
Craig Citro065b5302014-08-14 00:47:23 -0700382 { # An email message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700383 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
384 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
385 &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.
386 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
387 &quot;A String&quot;,
388 ],
389 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
390 &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.
391 &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.
392 &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.
393 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Craig Citro065b5302014-08-14 00:47:23 -0700394 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700395 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
396 &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.
Craig Citro065b5302014-08-14 00:47:23 -0700397 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700398 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the : separator. For example, To.
399 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the : separator. For example, someuser@example.com.
Craig Citro065b5302014-08-14 00:47:23 -0700400 },
401 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700402 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
403 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
404 &quot;parts&quot;: [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
Craig Citro065b5302014-08-14 00:47:23 -0700405 # Object with schema name: MessagePart
406 ],
407 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700408 &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.
409 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
410 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
411 &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:
412 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
413 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
414 # - The Subject headers must match.
Craig Citro065b5302014-08-14 00:47:23 -0700415 },
416 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700417 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Craig Citro065b5302014-08-14 00:47:23 -0700418 }</pre>
419</div>
420
421</body></html>