Label
This is the full description of the Label class.
Label class
- class google_workspace.gmail.label.Label
A gmail label.
- Parameters
gmail_client (
GmailClient
) – The gmail_client.thread_data (
dict
) – The raw label data.
-
get_messages(message_format: Literal[
'minimal','full','raw','metadata'] = 'raw') Generator[Type[google_workspace.gmail.message.BaseMessage], None, None] Get all messgaes with this label.
- Parameters
message_format (
str
, optional) – In which format to retrieve the messages. Can have one of the following values:"minimal"
,"full"
,"raw"
,"metadata"
. Defaults to “raw”.- Returns
A generator of the messages.
- Return type
Generator of
Message
|MessageMetadata
|MessageMinimal
-
modify(name: Optional[str] = None, message_list_visibility: Optional[Literal[
'show','hide']] = None, label_list_visibility: Optional[Literal['labelShow','labelShowIfUnread','labelHide']] = None, background_color: Optional[str] = None, text_color: Optional[str] = None) Modfy this label.
- Parameters
name (
str
, optional) – The name name for this label.message_list_visibility (
str
, optional) – The visibility of messages with this label in the message list in the Gmail web interface. Can have one of the following values:"show"
,"hide"
For more information visit the Gmail API documentation.label_list_visibility (
str
, optional) – The visibility of the label in the label list in the Gmail web interface. Can have one of the following values:"labelShow"
,"labelShowIfUnread"
,"labelHide"
For more information visit the Gmail API documentation.background_color (
str
, optional) – The background color represented as hex string. Defaults to None.text_color (
str
, optional) – The text color of the label, represented as hex string. Defaults to None.
- Returns
The created label.
- Return type