roboto.domain.triggers.samples
Sample events: what a trigger’s condition and target templates can see, shown with realistic values.
Before writing a condition or a message template, an author needs to know what {{dataset.name}} or file.relative_path will resolve to. The event catalog says which namespace roots an event exposes, but not what sits under them. A sample fills that in: it is built with the same EventNamespace and record models that serve a real firing, so the shape it shows is the shape a trigger sees. One coherent scenario runs through every root — one robot, one drive, one file, one action run on it — so the values read as a story rather than as placeholders.
Values are illustrative, not templates for real ids. Every id here is fabricated.
Module Contents
PlatformEventSample
Bases: pydantic.BaseModel
One event type, dereferenced: the envelope, every root it exposes, and the template paths that resolve against them.
Parameters
data AnyAttributes
PlatformEventSample.event
The event envelope as it would arrive: id, type, time, org, and payload.
PlatformEventSample.event_type
The event type this sample illustrates.
PlatformEventSample.namespace
Every namespace root a condition or template may reference for this event type, keyed by root name, with the full record under each. Always includes envelope and trigger; the rest are the catalog’s exposed roots for the type.
PlatformEventSamplesResponse
Bases: pydantic.BaseModel
Wire shape of GET /v1/triggers/events/samples: one sample per platform event type.
Parameters
data AnyAttributes
PlatformEventSamplesResponse.samples
SAMPLE_TIME
The instant every sample event and record is dated from, so samples are stable across calls.
SampleNamespaceSource
A NamespaceSource that hydrates every root from the sample scenario.
Serves each root the way a real firing does — including action as the invocation’s provenance and upload as the bare transaction id — so a sample carries exactly the roots a trigger would see.
SampleNamespaceSource.record_for_root()
Parameters
root strReturn type
platform_event_sample()
Build the sample for one event type.
The event, changed and tag roots are built by the same EventNamespace that serves them when a trigger fires; the entity roots are exactly the ones catalog exposes for the type.
Parameters
Return type
platform_event_samples()
A sample for every event type in catalog, in catalog order.
Parameters
Return type
sample_platform_event()
A valid, fully populated event of event_type from the sample scenario.
Parameters
sample_trigger()
The trigger the sample is evaluated for; what {{trigger.*}} sees.
Return type
template_paths()
Every dotted path a template may reference under prefix, in document order.
Walks nested mappings only. A list is a leaf, because path resolution descends through mappings and stops at anything else: dataset.tags is addressable, dataset.tags.0 is not.
Parameters
record collections.prefix strReturn type