MessageMinimal class
This is the full description of the MessageMinimal class.
- class google_workspace.gmail.message.MessageMinimal
A message that includes only email message ID and labels. This message is returned for the “minimal” message format.
- Parameters
gmail_client (
GmailClient
) – The gmail_client.message_data (
dict
) – The raw message data.
- gmail_client
The gmail client.
- message_data
The raw message data from the API.
- gmail_id
The message id used for the API.
- thread_id
The messgae thread ID.
- label_ids
A list of labels.
- is_seen
Whether the message is marked as read or not.
- is_chat_message
If this message is a chat message.
- add_labels(label_ids: Union[list, str]) dict
Add labels to this message.
- Parameters
label_ids (
list
|str
) – The lables to add.- Returns
The API response.
- Return type
dict
- delete() dict
Delete this message permanently.
- Returns
The API response.
- Return type
dict
- get_full_message() google_workspace.gmail.message.Message
Download the full message. Downloads the message using the “raw” format.
- Returns
The full message.
- Return type
- get_header(header: str) Optional[str]
Get a header from this message.
- Parameters
header (
str
) – The header name.- Returns
If the header was found this will return the header value, otherwise it will return None.
- Return type
str
| None
-
get_thread(message_format: Optional[Literal[
'minimal','full','metadata']] = None) google_workspace.gmail.thread.Thread Get the message’s full thread.
- Parameters
message_format (
str
, optional) – In which format to retrieve the messages. Can have one of the following values:"minimal"
,"full"
,"metadata"
. If this is not set we default to the format of the current message. Defaults to None.- Returns
The full thread.
- Return type
- mark_read() dict
Mark this message as read.
- Returns
The API response.
- Return type
dict
- mark_unread() dict
Mark this message as unread.
- Returns
The API response.
- Return type
dict
- remove_labels(label_ids: Union[list, str]) dict
Remove labels from this message.
- Parameters
label_ids (
list
|str
) – The lables to remove.- Returns
The API response.
- Return type
dict
- trash() dict
Move this message to the trash.
- Returns
The API response.
- Return type
dict
- untrash() dict
Untrash this message.
- Returns
The API response.
- Return type
dict