minos.aggregate.snapshots.entries

Classes

SnapshotEntry

Minos Snapshot Entry class.

class SnapshotEntry[source]

Bases: object

Minos Snapshot Entry class.

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

__init__(uuid, name, version, schema=None, data=None, created_at=None, updated_at=None, transaction_uuid=NULL_UUID)[source]
Parameters
  • uuid (UUID) –

  • name (str) –

  • version (int) –

  • schema (Optional[Union[list[dict[str, Any]], dict[str, Any]], bytes, memoryview]) –

  • data (Optional[Union[dict[str, Any], str]]) –

  • created_at (Optional[datetime]) –

  • updated_at (Optional[datetime]) –

  • transaction_uuid (UUID) –

classmethod from_root_entity(instance, **kwargs)[source]

Build a new instance from a RootEntity.

Parameters

instance (RootEntity) – The RootEntity instance.

Returns

A new SnapshotEntry instance.

Return type

SnapshotEntry

classmethod from_event_entry(entry)[source]

Build a new SnapshotEntry from a deletion event.

Parameters

entry (EventEntry) – The event entry containing the delete information.

Returns

A new SnapshotEntry instance.

Return type

SnapshotEntry

as_raw()[source]

Get a raw representation of the instance.

Returns

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

Return type

dict[str, Any]

property encoded_schema: Optional[bytes]

Get the encoded schema if available.

Returns

A bytes instance or None.

property encoded_data: Optional[str]

Get the encoded data if available.

Returns

A str instance or None.

build(**kwargs)[source]

Rebuild the stored RootEntity object instance from the internal state.

Parameters

kwargs – Additional named arguments.

Returns

A RootEntity instance.

Return type

RootEntity

property type_: type[RootEntity]

Load the concrete RootEntity class.

Returns

A Type object.