Toggle Light / Dark / Auto color theme
Toggle table of contents sidebar
model
Base model implementation for Gmail.
This module provides the foundational data models for the Gmail API client,
implementing common patterns for representing and interacting with Gmail.
The models follow three key design patterns:
Raw Data Storage Pattern :
All models store the original API response data in a _data attribute, treating the
API response schema as potentially unstable. Properties provide a stable interface
for accessing the underlying data, making the code more resilient to API changes.
Property-Based Access Pattern :
All attributes are exposed through properties rather than direct instance attributes.
This approach allows for lazy loading, data validation, and type conversion while
maintaining a clean public interface.
Core Data Extraction Pattern :
Each model implements a core_data property that returns a standardized, minimal
representation of the object. This provides a consistent way to access essential
information across different model types.
These models are designed to be instantiated by the API client methods, not directly
by users of the library. They provide a Pythonic interface to the JSON data returned
by the native boto3 AWS Lambda API.
This file is automatically generated from
googleapiclient-stubs/_apis/gmail/v1/schemas.pyi
class pythonic_gmail.model. Base ( _data : dict [ str , Any ] = REQ ) [source]
class pythonic_gmail.model. AutoForwarding ( _data : 'schemas.AutoForwarding' = REQ ) [source]
class pythonic_gmail.model. BatchDeleteMessagesRequest ( _data : 'schemas.BatchDeleteMessagesRequest' = REQ ) [source]
class pythonic_gmail.model. BatchModifyMessagesRequest ( _data : 'schemas.BatchModifyMessagesRequest' = REQ ) [source]
class pythonic_gmail.model. CseIdentity ( _data : 'schemas.CseIdentity' = REQ ) [source]
class pythonic_gmail.model. CseKeyPair ( _data : 'schemas.CseKeyPair' = REQ ) [source]
class pythonic_gmail.model. CsePrivateKeyMetadata ( _data : 'schemas.CsePrivateKeyMetadata' = REQ ) [source]
class pythonic_gmail.model. Delegate ( _data : 'schemas.Delegate' = REQ ) [source]
class pythonic_gmail.model. DisableCseKeyPairRequest ( _data : 'schemas.DisableCseKeyPairRequest' = REQ ) [source]
class pythonic_gmail.model. Draft ( _data : 'schemas.Draft' = REQ ) [source]
class pythonic_gmail.model. EnableCseKeyPairRequest ( _data : 'schemas.EnableCseKeyPairRequest' = REQ ) [source]
class pythonic_gmail.model. Filter ( _data : 'schemas.Filter' = REQ ) [source]
class pythonic_gmail.model. FilterAction ( _data : 'schemas.FilterAction' = REQ ) [source]
class pythonic_gmail.model. FilterCriteria ( _data : 'schemas.FilterCriteria' = REQ ) [source]
class pythonic_gmail.model. ForwardingAddress ( _data : 'schemas.ForwardingAddress' = REQ ) [source]
class pythonic_gmail.model. HardwareKeyMetadata ( _data : 'schemas.HardwareKeyMetadata' = REQ ) [source]
class pythonic_gmail.model. History ( _data : 'schemas.History' = REQ ) [source]
class pythonic_gmail.model. HistoryLabelAdded ( _data : 'schemas.HistoryLabelAdded' = REQ ) [source]
class pythonic_gmail.model. HistoryLabelRemoved ( _data : 'schemas.HistoryLabelRemoved' = REQ ) [source]
class pythonic_gmail.model. HistoryMessageAdded ( _data : 'schemas.HistoryMessageAdded' = REQ ) [source]
class pythonic_gmail.model. HistoryMessageDeleted ( _data : 'schemas.HistoryMessageDeleted' = REQ ) [source]
class pythonic_gmail.model. ImapSettings ( _data : 'schemas.ImapSettings' = REQ ) [source]
class pythonic_gmail.model. KaclsKeyMetadata ( _data : 'schemas.KaclsKeyMetadata' = REQ ) [source]
class pythonic_gmail.model. Label ( _data : 'schemas.Label' = REQ ) [source]
class pythonic_gmail.model. LabelColor ( _data : 'schemas.LabelColor' = REQ ) [source]
class pythonic_gmail.model. LanguageSettings ( _data : 'schemas.LanguageSettings' = REQ ) [source]
class pythonic_gmail.model. ListCseIdentitiesResponse ( _data : 'schemas.ListCseIdentitiesResponse' = REQ ) [source]
class pythonic_gmail.model. ListCseKeyPairsResponse ( _data : 'schemas.ListCseKeyPairsResponse' = REQ ) [source]
class pythonic_gmail.model. ListDelegatesResponse ( _data : 'schemas.ListDelegatesResponse' = REQ ) [source]
class pythonic_gmail.model. ListDraftsResponse ( _data : 'schemas.ListDraftsResponse' = REQ ) [source]
class pythonic_gmail.model. ListFiltersResponse ( _data : 'schemas.ListFiltersResponse' = REQ ) [source]
class pythonic_gmail.model. ListForwardingAddressesResponse ( _data : 'schemas.ListForwardingAddressesResponse' = REQ ) [source]
class pythonic_gmail.model. ListHistoryResponse ( _data : 'schemas.ListHistoryResponse' = REQ ) [source]
class pythonic_gmail.model. ListLabelsResponse ( _data : 'schemas.ListLabelsResponse' = REQ ) [source]
class pythonic_gmail.model. ListMessagesResponse ( _data : 'schemas.ListMessagesResponse' = REQ ) [source]
class pythonic_gmail.model. ListSendAsResponse ( _data : 'schemas.ListSendAsResponse' = REQ ) [source]
class pythonic_gmail.model. ListSmimeInfoResponse ( _data : 'schemas.ListSmimeInfoResponse' = REQ ) [source]
class pythonic_gmail.model. ListThreadsResponse ( _data : 'schemas.ListThreadsResponse' = REQ ) [source]
class pythonic_gmail.model. Message ( _data : 'schemas.Message' = REQ ) [source]
class pythonic_gmail.model. MessagePart ( _data : 'schemas.MessagePart' = REQ ) [source]
property from_email : Email
Extracts and returns an Email object from the From field of the email
property to_email : Email
Extracts and returns an Email object from the To field of the email
property cc_emails : list [ Email ]
Extracts and returns a list of Email objects from the CC field of the email
property subject_text : str
Extracts and returns the subject of the email message.
property sent_on_datetime : datetime
Extracts and returns the sent date and time of the email message as a
property text_body : str
Extracts and returns the text body of the email message.
Note
This implementation may not right, we may need to inspect the
payload.mimeType first and then decide how to extract the text body
from tree of parts.
class pythonic_gmail.model. MessagePartBody ( _data : 'schemas.MessagePartBody' = REQ ) [source]
class pythonic_gmail.model. ModifyMessageRequest ( _data : 'schemas.ModifyMessageRequest' = REQ ) [source]
class pythonic_gmail.model. ModifyThreadRequest ( _data : 'schemas.ModifyThreadRequest' = REQ ) [source]
class pythonic_gmail.model. ObliterateCseKeyPairRequest ( _data : 'schemas.ObliterateCseKeyPairRequest' = REQ ) [source]
class pythonic_gmail.model. PopSettings ( _data : 'schemas.PopSettings' = REQ ) [source]
class pythonic_gmail.model. Profile ( _data : 'schemas.Profile' = REQ ) [source]
class pythonic_gmail.model. SendAs ( _data : 'schemas.SendAs' = REQ ) [source]
class pythonic_gmail.model. SignAndEncryptKeyPairs ( _data : 'schemas.SignAndEncryptKeyPairs' = REQ ) [source]
class pythonic_gmail.model. SmimeInfo ( _data : 'schemas.SmimeInfo' = REQ ) [source]
class pythonic_gmail.model. SmtpMsa ( _data : 'schemas.SmtpMsa' = REQ ) [source]
class pythonic_gmail.model. Thread ( _data : 'schemas.Thread' = REQ ) [source]
class pythonic_gmail.model. VacationSettings ( _data : 'schemas.VacationSettings' = REQ ) [source]
class pythonic_gmail.model. WatchRequest ( _data : 'schemas.WatchRequest' = REQ ) [source]
class pythonic_gmail.model. WatchResponse ( _data : 'schemas.WatchResponse' = REQ ) [source]