minos.aggregate.snapshots.entries module

class minos.aggregate.snapshots.entries.SnapshotEntry(aggregate_uuid, aggregate_name, version, schema=None, data=None, created_at=None, updated_at=None, transaction_uuid=UUID('00000000-0000-0000-0000-000000000000'))[source]

Bases: object

Minos Snapshot Entry class.

Is the python object representation of a row in the snapshot storage system.

__init__(aggregate_uuid, aggregate_name, version, schema=None, data=None, created_at=None, updated_at=None, transaction_uuid=UUID('00000000-0000-0000-0000-000000000000'))[source]
property aggregate_cls: Type[minos.aggregate.models.aggregates.Aggregate]

Load the concrete Aggregate class.

Return type

typing.Type[minos.aggregate.models.aggregates.Aggregate]

Returns

A Type object.

aggregate_name
aggregate_uuid
as_raw()[source]

Get a raw representation of the instance.

Return type

dict[str, typing.Any]

Returns

A dictionary in which the keys are attribute names and values the attribute contents.

build_aggregate(**kwargs)[source]

Rebuild the stored Aggregate object instance from the internal state.

Parameters

kwargs – Additional named arguments.

Return type

minos.aggregate.models.aggregates.Aggregate

Returns

A Aggregate instance.

created_at
data
property encoded_data: Optional[str]

Get the encoded data if available.

Return type

typing.Optional[str]

Returns

A str instance or None.

property encoded_schema: Optional[bytes]

Get the encoded schema if available.

Return type

typing.Optional[bytes]

Returns

A bytes instance or None.

classmethod from_aggregate(aggregate, **kwargs)[source]

Build a new instance from an Aggregate.

Parameters

aggregate (minos.aggregate.models.aggregates.Aggregate) – The aggregate instance.

Return type

minos.aggregate.snapshots.entries.SnapshotEntry

Returns

A new MinosSnapshotEntry instance.

classmethod from_event_entry(entry)[source]

Build a new SnapshotEntry from a deletion event.

Parameters

entry (minos.aggregate.events.entries.EventEntry) – The event entry containing the delete information.

Return type

minos.aggregate.snapshots.entries.SnapshotEntry

Returns

A new SnapshotEntry instance.

schema
transaction_uuid
updated_at
version