• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<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.messages.html">messages</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="gmail_v1.users.messages.attachments.html">attachments()</a></code>
79</p>
80<p class="firstline">Returns the attachments Resource.</p>
81
82<p class="toc_element">
83  <code><a href="#batchDelete">batchDelete(userId, body=None, x__xgafv=None)</a></code></p>
84<p class="firstline">Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.</p>
85<p class="toc_element">
86  <code><a href="#batchModify">batchModify(userId, body=None, x__xgafv=None)</a></code></p>
87<p class="firstline">Modifies the labels on the specified messages.</p>
88<p class="toc_element">
89  <code><a href="#close">close()</a></code></p>
90<p class="firstline">Close httplib2 connections.</p>
91<p class="toc_element">
92  <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
93<p class="firstline">Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer `messages.trash` instead.</p>
94<p class="toc_element">
95  <code><a href="#get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</a></code></p>
96<p class="firstline">Gets the specified message.</p>
97<p class="toc_element">
98  <code><a href="#import_">import_(userId, body=None, deleted=None, internalDateSource=None, media_body=None, media_mime_type=None, neverMarkSpam=None, processForCalendar=None, x__xgafv=None)</a></code></p>
99<p class="firstline">Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message. Note: This function doesn't trigger forwarding rules or filters set up by the user.</p>
100<p class="toc_element">
101  <code><a href="#insert">insert(userId, body=None, deleted=None, internalDateSource=None, media_body=None, media_mime_type=None, x__xgafv=None)</a></code></p>
102<p class="firstline">Directly inserts a message into only this user's mailbox similar to `IMAP APPEND`, bypassing most scanning and classification. Does not send a message.</p>
103<p class="toc_element">
104  <code><a href="#list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=None, x__xgafv=None)</a></code></p>
105<p class="firstline">Lists the messages in the user's mailbox.</p>
106<p class="toc_element">
107  <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
108<p class="firstline">Retrieves the next page of results.</p>
109<p class="toc_element">
110  <code><a href="#modify">modify(userId, id, body=None, x__xgafv=None)</a></code></p>
111<p class="firstline">Modifies the labels on the specified message.</p>
112<p class="toc_element">
113  <code><a href="#send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</a></code></p>
114<p class="firstline">Sends the specified message to the recipients in the `To`, `Cc`, and `Bcc` headers.</p>
115<p class="toc_element">
116  <code><a href="#trash">trash(userId, id, x__xgafv=None)</a></code></p>
117<p class="firstline">Moves the specified message to the trash.</p>
118<p class="toc_element">
119  <code><a href="#untrash">untrash(userId, id, x__xgafv=None)</a></code></p>
120<p class="firstline">Removes the specified message from the trash.</p>
121<h3>Method Details</h3>
122<div class="method">
123    <code class="details" id="batchDelete">batchDelete(userId, body=None, x__xgafv=None)</code>
124  <pre>Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
125
126Args:
127  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
128  body: object, The request body.
129    The object takes the form of:
130
131{
132  &quot;ids&quot;: [ # The IDs of the messages to delete.
133    &quot;A String&quot;,
134  ],
135}
136
137  x__xgafv: string, V1 error format.
138    Allowed values
139      1 - v1 error format
140      2 - v2 error format
141</pre>
142</div>
143
144<div class="method">
145    <code class="details" id="batchModify">batchModify(userId, body=None, x__xgafv=None)</code>
146  <pre>Modifies the labels on the specified messages.
147
148Args:
149  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
150  body: object, The request body.
151    The object takes the form of:
152
153{
154  &quot;addLabelIds&quot;: [ # A list of label IDs to add to messages.
155    &quot;A String&quot;,
156  ],
157  &quot;ids&quot;: [ # The IDs of the messages to modify. There is a limit of 1000 ids per request.
158    &quot;A String&quot;,
159  ],
160  &quot;removeLabelIds&quot;: [ # A list of label IDs to remove from messages.
161    &quot;A String&quot;,
162  ],
163}
164
165  x__xgafv: string, V1 error format.
166    Allowed values
167      1 - v1 error format
168      2 - v2 error format
169</pre>
170</div>
171
172<div class="method">
173    <code class="details" id="close">close()</code>
174  <pre>Close httplib2 connections.</pre>
175</div>
176
177<div class="method">
178    <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
179  <pre>Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer `messages.trash` instead.
180
181Args:
182  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
183  id: string, The ID of the message to delete. (required)
184  x__xgafv: string, V1 error format.
185    Allowed values
186      1 - v1 error format
187      2 - v2 error format
188</pre>
189</div>
190
191<div class="method">
192    <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</code>
193  <pre>Gets the specified message.
194
195Args:
196  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
197  id: string, The ID of the message to retrieve. This ID is usually retrieved using `messages.list`. The ID is also contained in the result when a message is inserted (`messages.insert`) or imported (`messages.import`). (required)
198  format: string, The format to return the message in.
199    Allowed values
200      minimal - Returns only email message ID and labels; does not return the email headers, body, or payload.
201      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.
202      raw - Returns the full email message data with body content in the `raw` field as a base64url encoded string; the `payload` field is not used. Format cannot be used when accessing the api using the gmail.metadata scope.
203      metadata - Returns only email message ID, labels, and email headers.
204  metadataHeaders: string, When given and format is `METADATA`, only include headers specified. (repeated)
205  x__xgafv: string, V1 error format.
206    Allowed values
207      1 - v1 error format
208      2 - v2 error format
209
210Returns:
211  An object of the form:
212
213    { # An email message.
214  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
215  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
216  &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.
217  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
218    &quot;A String&quot;,
219  ],
220  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
221    &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.
222      &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.
223      &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.
224      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
225    },
226    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
227    &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`.
228      {
229        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
230        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
231      },
232    ],
233    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
234    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
235    &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.
236      # Object with schema name: MessagePart
237    ],
238  },
239  &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.
240  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
241  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
242  &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.
243}</pre>
244</div>
245
246<div class="method">
247    <code class="details" id="import_">import_(userId, body=None, deleted=None, internalDateSource=None, media_body=None, media_mime_type=None, neverMarkSpam=None, processForCalendar=None, x__xgafv=None)</code>
248  <pre>Imports a message into only this user&#x27;s mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn&#x27;t perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message. Note: This function doesn&#x27;t trigger forwarding rules or filters set up by the user.
249
250Args:
251  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
252  body: object, The request body.
253    The object takes the form of:
254
255{ # An email message.
256  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
257  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
258  &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.
259  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
260    &quot;A String&quot;,
261  ],
262  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
263    &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.
264      &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.
265      &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.
266      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
267    },
268    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
269    &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`.
270      {
271        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
272        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
273      },
274    ],
275    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
276    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
277    &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.
278      # Object with schema name: MessagePart
279    ],
280  },
281  &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.
282  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
283  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
284  &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.
285}
286
287  deleted: boolean, Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts.
288  internalDateSource: string, Source for Gmail&#x27;s internal date of the message.
289    Allowed values
290      receivedTime - Internal message date set to current time when received by Gmail.
291      dateHeader - Internal message time based on &#x27;Date&#x27; header in email, when valid.
292  media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
293  media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
294  neverMarkSpam: boolean, Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.
295  processForCalendar: boolean, Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.
296  x__xgafv: string, V1 error format.
297    Allowed values
298      1 - v1 error format
299      2 - v2 error format
300
301Returns:
302  An object of the form:
303
304    { # An email message.
305  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
306  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
307  &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.
308  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
309    &quot;A String&quot;,
310  ],
311  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
312    &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.
313      &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.
314      &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.
315      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
316    },
317    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
318    &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`.
319      {
320        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
321        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
322      },
323    ],
324    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
325    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
326    &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.
327      # Object with schema name: MessagePart
328    ],
329  },
330  &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.
331  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
332  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
333  &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.
334}</pre>
335</div>
336
337<div class="method">
338    <code class="details" id="insert">insert(userId, body=None, deleted=None, internalDateSource=None, media_body=None, media_mime_type=None, x__xgafv=None)</code>
339  <pre>Directly inserts a message into only this user&#x27;s mailbox similar to `IMAP APPEND`, bypassing most scanning and classification. Does not send a message.
340
341Args:
342  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
343  body: object, The request body.
344    The object takes the form of:
345
346{ # An email message.
347  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
348  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
349  &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.
350  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
351    &quot;A String&quot;,
352  ],
353  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
354    &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.
355      &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.
356      &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.
357      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
358    },
359    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
360    &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`.
361      {
362        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
363        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
364      },
365    ],
366    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
367    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
368    &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.
369      # Object with schema name: MessagePart
370    ],
371  },
372  &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.
373  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
374  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
375  &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.
376}
377
378  deleted: boolean, Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts.
379  internalDateSource: string, Source for Gmail&#x27;s internal date of the message.
380    Allowed values
381      receivedTime - Internal message date set to current time when received by Gmail.
382      dateHeader - Internal message time based on &#x27;Date&#x27; header in email, when valid.
383  media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
384  media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
385  x__xgafv: string, V1 error format.
386    Allowed values
387      1 - v1 error format
388      2 - v2 error format
389
390Returns:
391  An object of the form:
392
393    { # An email message.
394  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
395  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
396  &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.
397  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
398    &quot;A String&quot;,
399  ],
400  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
401    &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.
402      &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.
403      &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.
404      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
405    },
406    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
407    &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`.
408      {
409        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
410        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
411      },
412    ],
413    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
414    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
415    &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.
416      # Object with schema name: MessagePart
417    ],
418  },
419  &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.
420  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
421  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
422  &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.
423}</pre>
424</div>
425
426<div class="method">
427    <code class="details" id="list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=None, x__xgafv=None)</code>
428  <pre>Lists the messages in the user&#x27;s mailbox.
429
430Args:
431  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
432  includeSpamTrash: boolean, Include messages from `SPAM` and `TRASH` in the results.
433  labelIds: string, Only return messages with labels that match all of the specified label IDs. (repeated)
434  maxResults: integer, Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500.
435  pageToken: string, Page token to retrieve a specific page of results in the list.
436  q: string, Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`. Parameter cannot be used when accessing the api using the gmail.metadata scope.
437  x__xgafv: string, V1 error format.
438    Allowed values
439      1 - v1 error format
440      2 - v2 error format
441
442Returns:
443  An object of the form:
444
445    {
446  &quot;messages&quot;: [ # List of messages. Note that each message resource contains only an `id` and a `threadId`. Additional message details can be fetched using the messages.get method.
447    { # An email message.
448      &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
449      &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
450      &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.
451      &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
452        &quot;A String&quot;,
453      ],
454      &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
455        &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.
456          &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.
457          &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.
458          &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
459        },
460        &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
461        &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`.
462          {
463            &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
464            &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
465          },
466        ],
467        &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
468        &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
469        &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.
470          # Object with schema name: MessagePart
471        ],
472      },
473      &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.
474      &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
475      &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
476      &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.
477    },
478  ],
479  &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results in the list.
480  &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
481}</pre>
482</div>
483
484<div class="method">
485    <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
486  <pre>Retrieves the next page of results.
487
488Args:
489  previous_request: The request for the previous page. (required)
490  previous_response: The response from the request for the previous page. (required)
491
492Returns:
493  A request object that you can call &#x27;execute()&#x27; on to request the next
494  page. Returns None if there are no more items in the collection.
495    </pre>
496</div>
497
498<div class="method">
499    <code class="details" id="modify">modify(userId, id, body=None, x__xgafv=None)</code>
500  <pre>Modifies the labels on the specified message.
501
502Args:
503  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
504  id: string, The ID of the message to modify. (required)
505  body: object, The request body.
506    The object takes the form of:
507
508{
509  &quot;addLabelIds&quot;: [ # A list of IDs of labels to add to this message.
510    &quot;A String&quot;,
511  ],
512  &quot;removeLabelIds&quot;: [ # A list IDs of labels to remove from this message.
513    &quot;A String&quot;,
514  ],
515}
516
517  x__xgafv: string, V1 error format.
518    Allowed values
519      1 - v1 error format
520      2 - v2 error format
521
522Returns:
523  An object of the form:
524
525    { # An email message.
526  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
527  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
528  &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.
529  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
530    &quot;A String&quot;,
531  ],
532  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
533    &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.
534      &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.
535      &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.
536      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
537    },
538    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
539    &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`.
540      {
541        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
542        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
543      },
544    ],
545    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
546    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
547    &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.
548      # Object with schema name: MessagePart
549    ],
550  },
551  &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.
552  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
553  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
554  &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.
555}</pre>
556</div>
557
558<div class="method">
559    <code class="details" id="send">send(userId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)</code>
560  <pre>Sends the specified message to the recipients in the `To`, `Cc`, and `Bcc` headers.
561
562Args:
563  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
564  body: object, The request body.
565    The object takes the form of:
566
567{ # An email message.
568  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
569  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
570  &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.
571  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
572    &quot;A String&quot;,
573  ],
574  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
575    &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.
576      &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.
577      &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.
578      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
579    },
580    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
581    &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`.
582      {
583        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
584        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
585      },
586    ],
587    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
588    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
589    &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.
590      # Object with schema name: MessagePart
591    ],
592  },
593  &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.
594  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
595  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
596  &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.
597}
598
599  media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
600  media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
601  x__xgafv: string, V1 error format.
602    Allowed values
603      1 - v1 error format
604      2 - v2 error format
605
606Returns:
607  An object of the form:
608
609    { # An email message.
610  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
611  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
612  &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.
613  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
614    &quot;A String&quot;,
615  ],
616  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
617    &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.
618      &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.
619      &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.
620      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
621    },
622    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
623    &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`.
624      {
625        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
626        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
627      },
628    ],
629    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
630    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
631    &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.
632      # Object with schema name: MessagePart
633    ],
634  },
635  &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.
636  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
637  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
638  &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.
639}</pre>
640</div>
641
642<div class="method">
643    <code class="details" id="trash">trash(userId, id, x__xgafv=None)</code>
644  <pre>Moves the specified message to the trash.
645
646Args:
647  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
648  id: string, The ID of the message to Trash. (required)
649  x__xgafv: string, V1 error format.
650    Allowed values
651      1 - v1 error format
652      2 - v2 error format
653
654Returns:
655  An object of the form:
656
657    { # An email message.
658  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
659  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
660  &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.
661  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
662    &quot;A String&quot;,
663  ],
664  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
665    &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.
666      &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.
667      &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.
668      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
669    },
670    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
671    &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`.
672      {
673        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
674        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
675      },
676    ],
677    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
678    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
679    &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.
680      # Object with schema name: MessagePart
681    ],
682  },
683  &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.
684  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
685  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
686  &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.
687}</pre>
688</div>
689
690<div class="method">
691    <code class="details" id="untrash">untrash(userId, id, x__xgafv=None)</code>
692  <pre>Removes the specified message from the trash.
693
694Args:
695  userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
696  id: string, The ID of the message to remove from Trash. (required)
697  x__xgafv: string, V1 error format.
698    Allowed values
699      1 - v1 error format
700      2 - v2 error format
701
702Returns:
703  An object of the form:
704
705    { # An email message.
706  &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
707  &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
708  &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.
709  &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
710    &quot;A String&quot;,
711  ],
712  &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
713    &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.
714      &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.
715      &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.
716      &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
717    },
718    &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
719    &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`.
720      {
721        &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
722        &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
723      },
724    ],
725    &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
726    &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
727    &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.
728      # Object with schema name: MessagePart
729    ],
730  },
731  &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.
732  &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
733  &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
734  &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.
735}</pre>
736</div>
737
738</body></html>