roboto.experimental.sessions.record#

Module Contents#

class roboto.experimental.sessions.record.SessionFileRecord(/, **data)#

Bases: pydantic.BaseModel

Wire-format row for one file’s contribution to a Session.

Time window contract (range_min_timestamp_ns and range_max_timestamp_ns):

  1. Set together or both None; a window with only one bound is rejected on write.

  2. When both are None, the file contributes its whole recorded time window.

  3. When both are set, range_min_timestamp_ns <= range_max_timestamp_ns. Consumers iterating session data must keep only the file’s data inside the closed interval [range_min_timestamp_ns, range_max_timestamp_ns].

  4. Values are nanoseconds since the Unix epoch, measured the same way as the parent Session’s own bounds.

Data range contract (data_range):

  1. None means the contribution covers the whole file.

  2. (start, end): start is the first covered position; end is one past the last, with 0 <= start < end. Values are in the file’s own units — stored-row positions (counted from 0) for tabular files, nanoseconds of media time for video.

  3. Used when one file is shared by several sessions; the range names the slice of the file that belongs to this session.

Parameters:

data (Any)

created: datetime.datetime | None = None#

When this file was added to the session.

created_by: str#

User ID or service account that added this file to the session.

data_range: tuple[int, int] | None = None#

The slice of the file covered by this contribution, as (start, end) in the file’s own units, or None when the contribution covers the whole file. start is the first covered position; end is one past the last.

fs_node_id: str#

Identifier of the contributing file.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

modified: datetime.datetime | None = None#

When this file’s contribution was last modified.

modified_by: str#

User ID or service account that last modified this file’s contribution.

range_max_timestamp_ns: int | None = None#

Upper bound (inclusive) of the file’s contribution, in Unix-epoch nanoseconds. None means the contribution extends to the end of the file’s recorded time window; paired with range_min_timestamp_ns.

range_min_timestamp_ns: int | None = None#

Lower bound (inclusive) of the file’s contribution, in Unix-epoch nanoseconds. None means the contribution starts at the beginning of the file’s recorded time window; paired with range_max_timestamp_ns.

session_id: str#

Identifier of the session this file contributes to.

class roboto.experimental.sessions.record.SessionFileView(/, **data)#

Bases: pydantic.BaseModel

One row of the GET /v1/sessions/id/<session_id>/files response: a file’s contribution to a Session joined with display fields of the file itself.

The contribution fields (file_id plus the optional time window, range_min_timestamp_ns / range_max_timestamp_ns in Unix-epoch nanoseconds, and the optional data_range slice, both under the contracts documented on SessionFileRecord) come from the session’s composition; every other field is a read-only projection the service resolves from the file row at listing time. The projected fields describe the file — e.g. created is when the file was created, not when it joined the session — and are never part of a write.

Parameters:

data (Any)

created: datetime.datetime | None = None#

When the contributing file was created.

data_range: tuple[int, int] | None = None#

The slice of the file covered by this contribution, as (start, end) in the file’s own units, or None when the contribution covers the whole file. start is the first covered position; end is one past the last.

dataset_id: str | None = None#

ID of the dataset that contains the contributing file.

file_id: str#

Stable, unique identifier of the contributing file.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

modified: datetime.datetime | None = None#

When the contributing file was last modified.

name: str | None = None#

Filename of the contributing file (the final segment of relative_path).

origination: str | None = None#

Provenance of the contributing file, e.g. an invocation id or upload source.

range_max_timestamp_ns: int | None = None#

Upper bound (inclusive) of the file’s contribution, in Unix-epoch nanoseconds. None means the contribution extends to the end of the file’s recorded time window; paired with range_min_timestamp_ns.

range_min_timestamp_ns: int | None = None#

Lower bound (inclusive) of the file’s contribution, in Unix-epoch nanoseconds. None means the contribution starts at the beginning of the file’s recorded time window; paired with range_max_timestamp_ns.

relative_path: str | None = None#

Path of the contributing file within its dataset.

size: int | None = None#

Size of the contributing file in bytes.

tags: list[str] = None#

Tags on the contributing file.

class roboto.experimental.sessions.record.SessionRecord(/, **data)#

Bases: pydantic.BaseModel

Wire-format row for a session: an operational time window of a Device such as a drone flight, a vehicle drive, or a robot run.

A Session unifies the recordings and auxiliary data produced during its window; it may span many files or cover only a slice of one.

min_timestamp_ns and max_timestamp_ns are service-maintained aggregate bounds over the Session’s contributions, recomputed by the service in the same transaction as any composition write (add/remove files), so the row never disagrees with its contents.

Parameters:

data (Any)

created: datetime.datetime | None = None#

When the session was created.

created_by: str#

User ID or service account that created the session.

custom_fields: dict[str, Any] = None#

Values for the custom fields defined on Sessions in this org.

Every Ready custom field defined for (org_id, Session) appears as a key; values that have not been set surface as None rather than being absent. Empty when no custom fields are defined for the org.

description: str | None = None#

Optional description of the Session.

max_timestamp_ns: int | None = None#

Upper bound of the session’s aggregate timestamps, in Unix-epoch nanoseconds. None until the session has at least one file contribution.

metadata: dict[str, Any] = None#

User-supplied metadata.

Sessions cannot be filtered or sorted by metadata keys; for queryable structured attributes, define a custom field on the Session entity type.

min_timestamp_ns: int | None = None#

Lower bound of the session’s aggregate timestamps, in Unix-epoch nanoseconds. None until the session has at least one file contribution.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

modified: datetime.datetime | None = None#

When the Session was last modified.

modified_by: str#

User ID or service account that last modified the Session.

name: str | None = None#

A short, human-readable name for the Session. If provided, must be 120 characters or less.

org_id: str#

Organization that owns the Session.

session_id: str#

Stable, unique identifier for the Session.

tags: list[str] = None#

User-supplied tags.

Sessions can be filtered by tag membership (e.g., tags CONTAINS '<tag>') but are not sortable by tag.