Skip to content

⚡ Methods used in API calls.#

This module contains classes representing different methods available in the Mail.tm webservice. Each class represents a set of related methods. The classes are used to construct method calls to the API of Mail.tm and make requests to their server.

DomainMethods dataclass #

DomainMethods(
    GET_ALL_DOMAINS="domains",
    GET_DOMAIN_BY_ID="domains/{id}",
)

Represents methods related to domains in Mail.tm webservice.

GET_ALL_DOMAINS class-attribute instance-attribute #

GET_ALL_DOMAINS = 'domains'

Retrieves all domains.

GET_DOMAIN_BY_ID class-attribute instance-attribute #

GET_DOMAIN_BY_ID = 'domains/{id}'

Retrieves a domain by ID.

AccountMethods dataclass #

AccountMethods(
    CREATE_ACCOUNT="accounts",
    GET_ACCOUNT_BY_ID="accounts/{id}",
    DELETE_ACCOUNT_BY_ID="accounts/{id}",
    GET_ME="me",
    GET_ACCOUNT_TOKEN="token",
)

Represents methods related to accounts in Mail.tm webservice.

CREATE_ACCOUNT class-attribute instance-attribute #

CREATE_ACCOUNT = 'accounts'

Creates a new account.

GET_ACCOUNT_BY_ID class-attribute instance-attribute #

GET_ACCOUNT_BY_ID = 'accounts/{id}'

Retrieves an account by ID.

DELETE_ACCOUNT_BY_ID class-attribute instance-attribute #

DELETE_ACCOUNT_BY_ID = 'accounts/{id}'

Deletes an account by ID.

GET_ME class-attribute instance-attribute #

GET_ME = 'me'

Retrieves the current logged in account.

GET_ACCOUNT_TOKEN class-attribute instance-attribute #

GET_ACCOUNT_TOKEN = 'token'

Retrieves the token of the account.

MessageMethods dataclass #

MessageMethods(
    GET_ALL_MESSAGES="messages",
    GET_MESSAGE_BY_ID="messages/{id}",
    DELETE_MESSAGE_BY_ID="messages/{id}",
    PATCH_MESSAGE_BY_ID="messages/{id}",
    GET_SOURCES_BY_ID="sources/{id}",
)

Represents methods related to messages in Mail.tm webservice.

GET_ALL_MESSAGES class-attribute instance-attribute #

GET_ALL_MESSAGES = 'messages'

Retrieves all messages.

GET_MESSAGE_BY_ID class-attribute instance-attribute #

GET_MESSAGE_BY_ID = 'messages/{id}'

Retrieves a message by ID.

DELETE_MESSAGE_BY_ID class-attribute instance-attribute #

DELETE_MESSAGE_BY_ID = 'messages/{id}'

Deletes a message by ID.

PATCH_MESSAGE_BY_ID class-attribute instance-attribute #

PATCH_MESSAGE_BY_ID = 'messages/{id}'

Updates a message by ID.

GET_SOURCES_BY_ID class-attribute instance-attribute #

GET_SOURCES_BY_ID = 'sources/{id}'

Retrieves sources for a message by ID.

ServerAuth dataclass #

ServerAuth(
    account_token: str,
    account_id: str,
    account_address: t.Optional[str] = None,
    account_password: t.Optional[str] = None,
)

A data class to authenticate with the server-client for Server Implementation.

account_token instance-attribute #

account_token: str

The token of the account.

account_id instance-attribute #

account_id: str

The ID of the account.

account_address class-attribute instance-attribute #

account_address: t.Optional[str] = None

The address of the account.

account_password class-attribute instance-attribute #

account_password: t.Optional[str] = None

The password of the account.

AttachServer dataclass #

AttachServer(server: MailServerBase)

This contains an internal server instance to perform methods inherited from the server.