mailpit.client.models module¶
Definitions of model classes, that wrap Mailpit’s API data-structures. Defined with
dataclasses
and dataclasses_json
, in order to use them as json over
the API and be used as objects in the Python domain.
- class mailpit.client.models.Attachment(part_id: str, file_name: str, content_type: str, content_id: str, size: int)¶
Bases:
DataClassJsonMixin
Represents an attachment of a
Message
- class mailpit.client.models.Contact(name: str, address: str)¶
Bases:
object
Represents a mail contact splitting ‘Test User <test@example.com> into its name and address parts
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A ¶
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A ¶
- class mailpit.client.models.Headers(content_type: list[str], date: list[datetime.date], delivered_to: list[str], from_: list[str], message_id: list[str], additional: CatchAllVar | None)¶
Bases:
object
- dataclass_json_config = {'undefined': Undefined.INCLUDE}¶
- date: list[datetime.date]¶
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A ¶
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A ¶
- class mailpit.client.models.Message(id: str, message_id: str, read: bool, from_: Contact | None, to: list[mailpit.client.models.Contact], cc: list[mailpit.client.models.Contact] | None, bcc: list[mailpit.client.models.Contact] | None, subject: str, date: date, text: str | None, html: str | None, size: int, inline: list[mailpit.client.models.Attachment], attachments: list[mailpit.client.models.Attachment])¶
Bases:
DataClassJsonMixin
Represents a message returned by the message-endpoint
- attachments: list[mailpit.client.models.Attachment]¶
Attachments
- bcc: list[mailpit.client.models.Contact] | None¶
Message’s BCC-Header, the list of :Contact:, that the message is blindly coal-copied to
- cc: list[mailpit.client.models.Contact] | None¶
Message’s CC-Header, the list of :Contact: that the message is coal-copied to
- inline: list[mailpit.client.models.Attachment]¶
Inline Attachments
- to: list[mailpit.client.models.Contact]¶
Message’s To-Header, the list of :Contact: the message is addressed to
- class mailpit.client.models.MessageSummary(id: str, message_id: str, read: bool, from_: Contact | None, to: list[mailpit.client.models.Contact], cc: list[mailpit.client.models.Contact] | None, bcc: list[mailpit.client.models.Contact], subject: str, created: date, size: int, attachments: int)¶
Bases:
DataClassJsonMixin
class representing a single message that has been returned by the messages endpoint
- class mailpit.client.models.Messages(total: int, unread: int, count: int, start: int, messages: list[mailpit.client.models.MessageSummary])¶
Bases:
DataClassJsonMixin
class representing the returns of the messages endpoint
- messages: list[mailpit.client.models.MessageSummary]¶
- mailpit.client.models.datelist_decoder(decodes: Iterable[str]) list[datetime.datetime] ¶
- mailpit.client.models.datetime_decoder(isoformat: str) datetime ¶
replaces golang isoformat with Python parsable isoformat and decodes it to datetime.datetime