mautrix.client.api.types.util package

Submodules

mautrix.client.api.types.util.obj module

class mautrix.client.api.types.util.obj.Lst(iterable=())[source]

Bases: list, mautrix.client.api.types.util.serializable.GenericSerializable

classmethod deserialize(data: List[NewType.<locals>.new_type]) → mautrix.client.api.types.util.obj.Lst[source]

Convert the given data parsed from JSON into an object of this type.

Return type:Lst
serialize() → List[NewType.<locals>.new_type][source]

Convert this object into JSON.

Return type:List[JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]]
class mautrix.client.api.types.util.obj.Obj(**kwargs)[source]

Bases: mautrix.client.api.types.util.serializable.GenericSerializable

classmethod deserialize(data: Dict[str, NewType.<locals>.new_type]) → mautrix.client.api.types.util.obj.Obj[source]

Convert the given data parsed from JSON into an object of this type.

Return type:Obj
get(key, default=None)[source]
popitem()[source]
serialize() → Dict[str, NewType.<locals>.new_type][source]

Convert this object into JSON.

Return type:Dict[str, JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]]

mautrix.client.api.types.util.serializable module

class mautrix.client.api.types.util.serializable.GenericSerializable[source]

Bases: abc.ABC, typing.Generic, mautrix.client.api.types.util.serializable.Serializable

classmethod deserialize(raw: NewType.<locals>.new_type) → T[source]

Convert the given data parsed from JSON into an object of this type.

Return type:~T
json() → str[source]
Return type:str
classmethod parse_json(data: str) → T[source]
Return type:~T
class mautrix.client.api.types.util.serializable.Serializable[source]

Bases: object

Serializable is the base class for types with custom JSON serializers.

classmethod deserialize(raw: NewType.<locals>.new_type) → Any[source]

Convert the given data parsed from JSON into an object of this type.

Return type:Any
serialize() → NewType.<locals>.new_type[source]

Convert this object into JSON.

Return type:JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]
exception mautrix.client.api.types.util.serializable.SerializerError[source]

Bases: Exception

SerializerErrors are raised if something goes wrong during serialization or deserialization.

mautrix.client.api.types.util.serializable_attrs module

class mautrix.client.api.types.util.serializable_attrs.SerializableAttrs[source]

Bases: mautrix.client.api.types.util.serializable.GenericSerializable

An abstract Serializable that assumes the subclass

classmethod deserialize(data: NewType.<locals>.new_type) → T[source]

Convert the given data parsed from JSON into an object of this type.

Return type:~T
get(item, default=None)[source]
serialize() → NewType.<locals>.new_type[source]

Convert this object into JSON.

Return type:JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]
mautrix.client.api.types.util.serializable_attrs.deserializer(elem_type: Type[T]) → Callable[NewType.<locals>.new_type, NewType.<locals>.new_type][source]
Return type:Callable[[Deserializer[Callable[[JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]], ~T]]], Deserializer[Callable[[JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]], ~T]]]
mautrix.client.api.types.util.serializable_attrs.serializer(elem_type: Type[T]) → Callable[NewType.<locals>.new_type, NewType.<locals>.new_type][source]
Return type:Callable[[Serializer[Callable[[~T], JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]]]], Serializer[Callable[[~T], JSON[Union[str, int, float, None, Dict[str, _Forwardref], List[_Forwardref]]]]]]

Module contents