Event#
- class nominal.core.Event(rid, asset_rids, name, description, start, duration, properties, labels, type, is_archived, disposition)#
Bases:
HasRid,RefreshableGrpcMixin[Event]An annotation at a point or interval in time, optionally associated with assets.
- start: IntegralNanosecondsUTC#
- duration: IntegralNanosecondsDuration#
- properties: NominalProperties#
- disposition: EventDisposition | None#
None until the event is opened for disposition.
Checklist-fired events are opened automatically. Any event can be opened.
- archive()#
Archives the event, preventing it from showing up in workbooks.
Note
This does not update the instance in place; call
refresh()to see the change reflected.
- unarchive()#
Unarchives the event, allowing it to show up in workbooks.
Note
This does not update the instance in place; call
refresh()to see the change reflected.
- update(*, name=None, description=None, assets=None, start=None, duration=None, properties=None, labels=None, type)#
Replace event metadata, updating the current instance and returning it.
Metadata is replaced rather than appended. To add to labels or properties, merge them before calling. E.g.:
new_labels = ["new-label-a", "new-label-b"] for old_label in event.labels: new_labels.append(old_label) event = event.update(labels=new_labels)
- Parameters:
name (str | None)
New name for the event.
description (str | None)
New description for the event.
assets (Iterable[Asset | str] | None)
Assets or asset rids the event applies to. An empty sequence clears them.
-
New starting timestamp for the event.
duration (timedelta | int | None)
New duration for the event.
properties (Mapping[str, str | float] | None)
String or numeric properties. Integers are stored as floats. None leaves properties unchanged; an empty mapping clears them.
-
Labels replacing the existing ones. An empty sequence clears them.
type (EventType | None)
New verbosity level for the event.
- Returns:
This event, updated in place.
- Return type:
Note
Every argument left as None is omitted from the request and the corresponding field is left unchanged. That is distinct from passing an empty collection, which clears the field.
- Raises:
TypeError – If a property value is a boolean or is not a string, integer, or float.
ValueError – If the backend does not echo back exactly one updated event.
NominalError – If the update request fails.
- Return type: