ABCs#
How do we use this ?
We utilize this abstract base class to define a structured way of representing and interacting with data objects. By defining classes that inherit from these ABCs, we can create objects that not only provide a clear understanding of their contents, but also enable convenient and efficient data manipulation and traversal.
General Objects#
- These abstract base classes (ABCs) serve as a foundation for the modal classes, providing a structured way to interact with data objects.
- While they won't be directly used for data manipulation, they will be inherited by the modal classes, which will then utilize their functionality to provide a clear understanding of their contents and enable convenient and efficient data manipulation and traversal.
This module provides the following classes for type-safe and msgspec-based handling of the Mail.tm API data types.
MessageFrom
: Represents a data class containing details of messages.MessageTo
: Represents a data class containing details of recipients.MessageAttachment
: Represents a data class containing details of attachments.ViewDetails
: Represents a data class containing details of search results.ViewSearch
: Represents a data class containing details of search queries.
These classes are designed to be used with the 'msgspec' library to facilitate quick and efficient data serialization and deserialization.
MessageFrom
#
MessageTo
#
MessageAttachment
#
Bases: msgspec.Struct
id
class-attribute
instance-attribute
#
id: str = msgspec.field(name='id')
ID of the message attachment.
RETURNS | DESCRIPTION |
---|---|
id
|
ID of the message attachment.
TYPE:
|
filename
class-attribute
instance-attribute
#
filename: str = msgspec.field(name='filename')
The name of the attachment file.
RETURNS | DESCRIPTION |
---|---|
filename
|
The name of the attachment file.
TYPE:
|
content_type
class-attribute
instance-attribute
#
content_type: str = msgspec.field(name='contentType')
The MIME type of the attachment.
RETURNS | DESCRIPTION |
---|---|
content_type
|
The MIME type of the attachment.
TYPE:
|
disposition
class-attribute
instance-attribute
#
disposition: str = msgspec.field(name='disposition')
The Content-Disposition header of the attachment.
RETURNS | DESCRIPTION |
---|---|
disposition
|
The Content-Disposition header of the attachment.
TYPE:
|
transfer_encoding
class-attribute
instance-attribute
#
transfer_encoding: str = msgspec.field(
name="transferEncoding"
)
The Transfer-Encoding header of the attachment.
RETURNS | DESCRIPTION |
---|---|
transfer_encoding
|
The Transfer-Encoding header of the attachment.
TYPE:
|
related
class-attribute
instance-attribute
#
related: bool = msgspec.field(name='related')
Whether the attachment is related to the main body of the message.
RETURNS | DESCRIPTION |
---|---|
related
|
Whether the attachment is related to the main body of the message.
TYPE:
|
Token
#
ViewDetails
#
Bases: msgspec.Struct
Struct representing the details of a view.
first
class-attribute
instance-attribute
#
first: str = msgspec.field(name='hydra:first')
The URL of the first page in the view.
RETURNS | DESCRIPTION |
---|---|
first
|
The URL of the first page in the view.
TYPE:
|
last
class-attribute
instance-attribute
#
last: str = msgspec.field(name='hydra:last')
The URL of the last page in the view.
RETURNS | DESCRIPTION |
---|---|
last
|
The URL of the last page in the view.
TYPE:
|
ViewMapping
#
Bases: msgspec.Struct
Struct representing a mapping between a variable and a property.
variable
class-attribute
instance-attribute
#
variable: str = msgspec.field(name='variable')
The variable of the mapping.
RETURNS | DESCRIPTION |
---|---|
variable
|
The variable of the mapping.
TYPE:
|
ViewSearch
#
Bases: msgspec.Struct
A view search system.
template
class-attribute
instance-attribute
#
template: str = msgspec.field(name='hydra:template')
The URL template of the view.
RETURNS | DESCRIPTION |
---|---|
template
|
The URL template of the view.
TYPE:
|
variable_representation
class-attribute
instance-attribute
#
variable_representation: str = msgspec.field(
name="hydra:variableRepresentation"
)
The representation of variables in the view.
RETURNS | DESCRIPTION |
---|---|
variable_representation
|
The representation of variables in the view.
TYPE:
|
mappings
class-attribute
instance-attribute
#
mappings: t.List[ViewMapping] = msgspec.field(
name="hydra:mapping"
)
A list of mappings for the view.
RETURNS | DESCRIPTION |
---|---|
mappings
|
A list of mappings for the view.
TYPE:
|
Modal Objects#
- Modal objects contain the classes that the user directly interacts with while using the SDK.
- These modals contain the data objects that the user interacts with while using the SDK.
Domain
#
Bases: msgspec.Struct
The domain of the email account.
id
class-attribute
instance-attribute
#
Not documented
: ID of the interaction.
RETURNS | DESCRIPTION |
---|---|
id
|
ID of the interaction.
TYPE:
|
domain_name
class-attribute
instance-attribute
#
Name of the domain provided by mail.tm
RETURNS | DESCRIPTION |
---|---|
domain
|
Name of the domain provided by mail.tm
TYPE:
|
Examples:
@gmail.com, @goster.com
is_active
class-attribute
instance-attribute
#
If the domain is still active.
RETURNS | DESCRIPTION |
---|---|
is_active
|
If the domain is still active.
TYPE:
|
is_private
class-attribute
instance-attribute
#
If the domain is private. Private domains are not visible to the public.
RETURNS | DESCRIPTION |
---|---|
is_private
|
If the domain is private. Private domains are not visible to the public.
TYPE:
|
created_at
class-attribute
instance-attribute
#
The datetime object of creation date of the domain.
RETURNS | DESCRIPTION |
---|---|
created_at
|
The datetime object of creation date of the domain.
TYPE:
|
Account
#
Bases: msgspec.Struct
id
class-attribute
instance-attribute
#
Not documented
: ID of the account.
RETURNS | DESCRIPTION |
---|---|
id
|
ID of the account.
TYPE:
|
address
class-attribute
instance-attribute
#
Email address of the account.
RETURNS | DESCRIPTION |
---|---|
address
|
Email address of the account.
TYPE:
|
quota
class-attribute
instance-attribute
#
The quota of the account.
RETURNS | DESCRIPTION |
---|---|
quota
|
The quota of the account.
TYPE:
|
used
class-attribute
instance-attribute
#
The amount of quota used by the account.
RETURNS | DESCRIPTION |
---|---|
used
|
The amount of quota used by the account.
TYPE:
|
is_disabled
class-attribute
instance-attribute
#
If the account is disabled.
RETURNS | DESCRIPTION |
---|---|
is_disabled
|
If the account is disabled.
TYPE:
|
is_deleted
class-attribute
instance-attribute
#
If the account is deleted.
RETURNS | DESCRIPTION |
---|---|
is_deleted
|
If the account is deleted.
TYPE:
|
created_at
class-attribute
instance-attribute
#
The datetime object of creation date of the account.
RETURNS | DESCRIPTION |
---|---|
created_at
|
The datetime object of creation date of the account.
TYPE:
|
Message
#
Bases: msgspec.Struct
id
class-attribute
instance-attribute
#
ID of the message.
RETURNS | DESCRIPTION |
---|---|
id
|
ID of the message.
TYPE:
|
account_id
class-attribute
instance-attribute
#
ID of the account to which the message belongs.
RETURNS | DESCRIPTION |
---|---|
account_id
|
ID of the account to which the message belongs.
TYPE:
|
message_id
class-attribute
instance-attribute
#
The ID associated with the message.
RETURNS | DESCRIPTION |
---|---|
message_id
|
Message ID.
TYPE:
|
message_from
class-attribute
instance-attribute
#
message_from: t.Optional[MessageFrom] = msgspec.field(
name="from", default=None
)
Details of the sender of the message.
RETURNS | DESCRIPTION |
---|---|
message_from
|
Details of the sender of the message.
TYPE:
|
message_to
class-attribute
instance-attribute
#
Details of the recipients of the message.
RETURNS | DESCRIPTION |
---|---|
message_to
|
Details of the recipients of the message.
TYPE:
|
subject
class-attribute
instance-attribute
#
Subject of the message.
RETURNS | DESCRIPTION |
---|---|
subject
|
Subject of the message.
TYPE:
|
seen
class-attribute
instance-attribute
#
If the message has been seen by the recipient.
RETURNS | DESCRIPTION |
---|---|
seen
|
If the message has been seen by the recipient.
TYPE:
|
is_deleted
class-attribute
instance-attribute
#
If the message is deleted.
RETURNS | DESCRIPTION |
---|---|
is_deleted
|
If the message is deleted.
TYPE:
|
html
class-attribute
instance-attribute
#
HTML content of the message.
RETURNS | DESCRIPTION |
---|---|
html
|
HTML content of the message.
TYPE:
|
has_attachments
class-attribute
instance-attribute
#
If the message has attachments.
RETURNS | DESCRIPTION |
---|---|
has_attachments
|
If the message has attachments.
TYPE:
|
attachments
class-attribute
instance-attribute
#
attachments: t.Optional[t.List[MessageAttachment]] = (
msgspec.field(name="attachments", default=None)
)
Attachments associated with the message.
RETURNS | DESCRIPTION |
---|---|
attachments
|
Attachments associated with the message.
TYPE:
|
size
class-attribute
instance-attribute
#
Size of the message in bytes.
RETURNS | DESCRIPTION |
---|---|
size
|
Size of the message in bytes.
TYPE:
|
downloadUrl
class-attribute
instance-attribute
#
URL to download the message.
RETURNS | DESCRIPTION |
---|---|
downloadUrl
|
URL to download the message.
TYPE:
|
created_at
class-attribute
instance-attribute
#
Date and time of creation of the message.
RETURNS | DESCRIPTION |
---|---|
created_at
|
Date and time of creation of the message.
TYPE:
|
updated_at
class-attribute
instance-attribute
#
Date and time of last update of the message.
RETURNS | DESCRIPTION |
---|---|
updated_at
|
Date and time of last update of the message.
TYPE:
|
cc
class-attribute
instance-attribute
#
Carbon Copy (CC) recipients of the message.
RETURNS | DESCRIPTION |
---|---|
cc
|
Carbon Copy (CC) recipients of the message.
TYPE:
|
bcc
class-attribute
instance-attribute
#
Blind Carbon Copy (BCC) recipients of the message.
RETURNS | DESCRIPTION |
---|---|
bcc
|
Blind Carbon Copy (BCC) recipients of the message.
TYPE:
|
flagged
class-attribute
instance-attribute
#
If the message is flagged by the recipient.
RETURNS | DESCRIPTION |
---|---|
flagged
|
If the message is flagged by the recipient.
TYPE:
|
verifications
class-attribute
instance-attribute
#
Verifications associated with the message.
RETURNS | DESCRIPTION |
---|---|
verifications
|
Verifications associated with the message.
TYPE:
|
retention_date
class-attribute
instance-attribute
#
retention_date: t.Optional[datetime.datetime] = (
msgspec.field(name="retentionDate", default=None)
)
Date of retention for the message.
RETURNS | DESCRIPTION |
---|---|
retention_date
|
Date of retention for the message.
TYPE:
|
Source
#
id
class-attribute
instance-attribute
#
The id attribute of the Source.
RETURNS | DESCRIPTION |
---|---|
id
|
The id attribute of the Source.
TYPE:
|
MessagePageView
#
Bases: msgspec.Struct
Page view for messages under a page.
messages
class-attribute
instance-attribute
#
List of messages in the view.
RETURNS | DESCRIPTION |
---|---|
messages
|
List of messages in the view.
TYPE:
|
total_items
class-attribute
instance-attribute
#
Total number of items in the view.
RETURNS | DESCRIPTION |
---|---|
total_items
|
Total number of items in the view.
TYPE:
|
view_search
class-attribute
instance-attribute
#
view_search: t.Optional[ViewSearch] = msgspec.field(
name="hydra:search", default=None
)
Search parameters of the view.
RETURNS | DESCRIPTION |
---|---|
view_search
|
Search parameters of the view.
TYPE:
|
view_details
class-attribute
instance-attribute
#
view_details: t.Optional[ViewDetails] = msgspec.field(
name="hydra:view", default=None
)
Details of the view.
RETURNS | DESCRIPTION |
---|---|
view_details
|
Details of the view.
TYPE:
|
DomainPageView
#
Bases: msgspec.Struct
Page view for domains under a page.
domains
class-attribute
instance-attribute
#
List of domains in the view.
RETURNS | DESCRIPTION |
---|---|
domains
|
List of domains in the view.
TYPE:
|
total_items
class-attribute
instance-attribute
#
Total number of domains in the view.
RETURNS | DESCRIPTION |
---|---|
total_items
|
Total number of domains in the view.
TYPE:
|
view_details
class-attribute
instance-attribute
#
view_details: t.Optional[ViewDetails] = msgspec.field(
name="hydra:view", default=None
)
Details of the domain view.
RETURNS | DESCRIPTION |
---|---|
view_details
|
Details of the domain view.
TYPE:
|
view_search
class-attribute
instance-attribute
#
view_search: t.Optional[ViewSearch] = msgspec.field(
name="hydra:search", default=None
)
Search parameters of the domain view.
RETURNS | DESCRIPTION |
---|---|
view_search
|
Search parameters of the domain view.
TYPE:
|