GetEvent
Source:
src/AWS/FraudDetector/GetEvent.ts
Read a stored event (its entities and variable values) back from Amazon
Fraud Detector — the effectful lookup call made from a deployed Lambda or
Task. Events are stored by SendEvent or by predictions on an event type
with ingestion enabled.
Reading Stored Events
Section titled “Reading Stored Events”Provide the GetEventHttp implementation layer on the Function effect,
bind the event type in the init phase, then call the returned client at
runtime. The binding grants frauddetector:GetEvent on the event type and
injects its eventTypeName automatically.
// initconst getEvent = yield* FraudDetector.GetEvent(eventType);
return { fetch: Effect.gen(function* () { // runtime const { event } = yield* getEvent({ eventId: "order-123" }); return HttpServerResponse.json({ variables: event?.eventVariables }); }),};// on the Function effect:// .pipe(Effect.provide(FraudDetector.GetEventHttp))