miniproto.session.models.SessionRecord
miniproto.session.models.SessionRecord
Section titled “miniproto.session.models.SessionRecord”SessionRecord(version: int = SESSION_RECORD_VERSION, dc_id: int | None = None, auth_key: AuthKey | None = None, dc_options: tuple[DCOption, ...] = (), user: UserIdentity | None = None, update_state: UpdateState = UpdateState(), peers: tuple[PeerCacheEntry, ...] = (), metadata: Mapping[str, Any] = dict()) -> NoneComplete versioned session state with frozen, shallow collection snapshots.
Attributes:
- version (
int) – Storage schema version; only the current version is accepted. - dc_id (
int | None) – Optional active data-centre identifier. - auth_key (
AuthKey | None) – Optional active authorization key. - dc_options (
tuple[DCOption, …]) – Immutable configured endpoint sequence. - user (
UserIdentity | None) – Optional authenticated account identity. - update_state (
UpdateState) – Update cursors, defaulting to an empty state. - peers (
tuple[PeerCacheEntry, …]) – Immutable cached peer sequence. - metadata (
Mapping[str, Any]) – Shallow-copied extension mapping, hidden fromrepr; nested values remain mutable.
Default update state is empty, while every other optional domain remains absent or empty until the client obtains it.
Raises:
ValueError– If the version is unsupported or configured DC is invalid.