Module: migrations
- x3dh.migrations.parse_identity_key_pair_model(serialized)[source]
Parse a serialized
IdentityKeyPairinstance, as returned byjson, into the most recent pydantic model available for the class. Perform migrations in case the pydantic models were updated.- Parameters:
serialized (JSONObject) – The serialized instance.
- Return type:
- Returns:
The model, which can be used to restore the instance using
from_model().
Note
Pre-stable data can only be migrated as a whole using
parse_base_state_model().
- x3dh.migrations.parse_signed_pre_key_pair_model(serialized)[source]
Parse a serialized
SignedPreKeyPairinstance, as returned byjson, into the most recent pydantic model available for the class. Perform migrations in case the pydantic models were updated.- Parameters:
serialized (JSONObject) – The serialized instance.
- Return type:
- Returns:
The model, which can be used to restore the instance using
from_model().
Note
Pre-stable data can only be migrated as a whole using
parse_base_state_model().
- x3dh.migrations.parse_base_state_model(serialized)[source]
Parse a serialized
BaseStateinstance, as returned byjson, into the most recent pydantic model available for the class. Perform migrations in case the pydantic models were updated. Supports migration of pre-stable data.- Parameters:
serialized (JSONObject) – The serialized instance.
- Return type:
- Returns:
The model, which can be used to restore the instance using
from_model(), and a flag that indicates whether the bundle needs to be published, which was part of the pre-stable serialization format.