Skip to content

ThingItem

Class: warmhub.ThingItem

ThingItem(wref: str, name: str, kind: str, version: int, created_at: int, shape_name: str | None = None, active: bool | None = None, data: PayloadT | None = None, about_wref: str | None = None, affirmed_wrefs: tuple[str, ...] | None = None, metadata: JsonMapping | None = None, extra: JsonMapping = _empty(), raw: JsonMapping = _empty())

A row from a list read (thing.head, query, search).

Thinner than ThingDetail: list rows carry no shape, validated_shape or committer_wref. Hydrate with thing.get when those are needed.

Generic in its payload. ThingItem with no parameter is ThingItem[JsonMapping]data is the raw JSON object. Pass into to a read and you get ThingItem[YourShape] instead; see shape_decoder. The parameter changes the static type of data and nothing else: no key is renamed at either setting.

as_dict()

The exact server payload as a plain, mutable, serializable dict.

Wire keys, wire nesting, no client naming applied — the same content as raw, in the form you can hand to dumps, mutate, or pass to code that demands a real dict. Built fresh on each call, so editing the result cannot reach the model.

wref

Documentation is not yet available.

name

Documentation is not yet available.

kind

Open on the wire. NOT narrowed to a Literal — see the module docstring.

version

Documentation is not yet available.

created_at

Documentation is not yet available.

shape_name = None

Documentation is not yet available.

active = None

Documentation is not yet available.

data = None

The user’s own shape fields. Keys are never transformed, in either direction. See _decode for the enforcement point.

about_wref = None

Documentation is not yet available.

affirmed_wrefs = None

Pinned target wrefs the assertion’s current version affirms. Assertions only; targets the reader cannot see are suppressed.

metadata = None

Not yet modelled field-by-field; carried through as a plain mapping.

extra = field(default_factory=_empty)

Documentation is not yet available.

raw = field(default_factory=_empty)

Documentation is not yet available.