thunderbird_accounts.mail.types.jmap

Module Attributes

Id

A JMap ID field Ref: https://jmap.io/spec/rfc8620/#section-1.2

Classes

Account(*, name, isPersonal, isReadOnly, ...)

BaseSchema(**extra_data)

A base schema that allows us to ingest camelCase names to snake_case variables.

Capabilities(*, urnIetfParamsJmapCore, ...)

Typed capabilities

Identity(*[, id, replyTo, bcc])

Invocation(*, name, arguments, methodCallId, ...)

The shape for a jmap request.

JMapCorePropertyCapability(*[, ...])

JMapRequest(*, using, methodCalls[, createdIds])

JMapResponse(*, methodResponses[, createdIds])

JMapSievePropertyCapability(*[, implementation])

JMapType(*[, id])

Base type for all jmap responses

JMapWebsocketPropertyCapability(*[, url, ...])

ResponseIndex(*values)

SessionResource(*, capabilities, accounts, ...)

class thunderbird_accounts.mail.types.jmap.BaseSchema(**extra_data: Any)[source]

Bases: BaseModel

A base schema that allows us to ingest camelCase names to snake_case variables. This will serialize it back to camelCase for requests as well.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

get(key: object, default: None = None, /)[source]

TODO: Remove me once we’ve integrated v0.16 api calls into the app

class thunderbird_accounts.mail.types.jmap.ResponseIndex(*values)[source]

Bases: Enum

class thunderbird_accounts.mail.types.jmap.Invocation(*, name: str, arguments: dict, methodCallId: str, **extra_data: Any)[source]

Bases: BaseSchema

The shape for a jmap request.

The name is the request you’d like to make (e.g. x:Domains/get to do a get request for Stalwart domains.) arguments is the request data, and method_call_id is an id that can be used to reference this request in batched queries.

Ref: https://jmap.io/spec/rfc8620/#section-3.2

classmethod transform_tuple(data)[source]

Since we serialize this model as a list, we need to a way to reverse this serialization.

serialize_model() → list[source]

JMAP spec wants this data as a tuple (well list in our case.)

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.JMapRequest(*, using: list[str], methodCalls: list[Invocation], createdIds: list[str] | None = None, **extra_data: Any)[source]

Bases: BaseSchema

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.JMapResponse(*, methodResponses: list[Invocation], createdIds: list[str] | None = None, sessionState: str, **extra_data: Any)[source]

Bases: BaseSchema

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.JMapCorePropertyCapability(*, maxSizeUpload: int | None = None, maxConcurrentUpload: int | None = None, maxSizeRequest: int | None = None, maxConcurrentRequests: int | None = None, maxCallsInRequest: int | None = None, maxObjectsInGet: int | None = None, maxObjectsInSet: int | None = None, collationAlgorithms: list[str] | None = None, **extra_data: Any)[source]

Bases: BaseSchema

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.JMapSievePropertyCapability(*, implementation: str | None = None, **extra_data: Any)[source]

Bases: BaseSchema

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.JMapWebsocketPropertyCapability(*, url: str | None = None, supportsPush: bool | None = None, **extra_data: Any)[source]

Bases: BaseSchema

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.Account(*, name: str, isPersonal: bool, isReadOnly: bool, accountCapabilities: dict, **extra_data: Any)[source]

Bases: BaseSchema

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.Capabilities(*, urnIetfParamsJmapCore: JMapCorePropertyCapability, urnIetfParamsJmapSieve: JMapSievePropertyCapability, urnIetfParamsJmapWebsocket: JMapWebsocketPropertyCapability, **extra_data: Any)[source]

Bases: BaseSchema

Typed capabilities

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.SessionResource(*, capabilities: Capabilities, accounts: dict[str, Account], primaryAccounts: dict[str, str], username: str, apiUrl: str, downloadUrl: str, uploadUrl: str, eventSourceUrl: str, state: str, **extra_data: Any)[source]

Bases: BaseSchema

capabilities: Capabilities

dict | dict[Literal[’urn:ietf:params:jmap:core’], JMapCorePropertyCapability]

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

thunderbird_accounts.mail.types.jmap.Id

A JMap ID field Ref: https://jmap.io/spec/rfc8620/#section-1.2

alias of Annotated[str, FieldInfo(annotation=NoneType, required=True)]

class thunderbird_accounts.mail.types.jmap.JMapType(*, id: Annotated[str, FieldInfo(annotation=NoneType, required=True)] | None = None, **extra_data: Any)[source]

Bases: BaseSchema

Base type for all jmap responses

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class thunderbird_accounts.mail.types.jmap.Identity(*, id: Annotated[str, FieldInfo(annotation=NoneType, required=True)] | None = None, name: str, email: str, replyTo: list | None = None, bcc: list | None = None, textSignature: str, htmlSignature: str, mayDelete: bool, **extra_data: Any)[source]

Bases: JMapType

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'from_attributes': True, 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].