thunderbird_accounts.mail.clients.jmap_client

Classes

JMAPClient(base_url, username, token[, ...])

The tiniest JMAP client you can imagine.

class thunderbird_accounts.mail.clients.jmap_client.JMAPClient(base_url: str, username: str, token: str, auth_type: AUTH_TYPES = AUTH_TYPES.BEARER, verify_ssl: bool | str = True, timeout: float | tuple[float, float] = 30)[source]

Bases: object

The tiniest JMAP client you can imagine. Source: https://github.com/fastmail/JMAP-Samples/blob/main/python3/tiny_jmap_library.py

class AUTH_TYPES(*values)[source]

Bases: Enum

__init__(base_url: str, username: str, token: str, auth_type: AUTH_TYPES = AUTH_TYPES.BEARER, verify_ssl: bool | str = True, timeout: float | tuple[float, float] = 30)[source]

Initialize using a base_url, username and bearer token

get_session() → SessionResource[source]

Return the JMAP Session Resource as a Python dict

get_account_id() → str[source]

Return the accountId for the account matching self.username

get_identity_id() → str[source]

Return the identityId for an address matching self.username

request(request_data: JMapRequest, method: Literal['get', 'post'] = 'post') → JMapResponse[source]

Make a JMAP POST request to the API, returning the response as a Python data structure.