ListEventPredictions
Source:
src/AWS/FraudDetector/ListEventPredictions.ts
List the past predictions made by a bound Amazon Fraud Detector detector —
the effectful search call made from a deployed Lambda or Task, e.g. to find
the predictionTimestamp needed by GetEventPredictionMetadata.
Auditing Predictions
Section titled “Auditing Predictions”Provide the ListEventPredictionsHttp implementation layer on the Function
effect, bind the detector in the init phase, then call the returned client
at runtime. The binding grants frauddetector:ListEventPredictions (the
action supports no resource-level scoping) and filters results to the bound
detector automatically.
// initconst listEventPredictions = yield* FraudDetector.ListEventPredictions(detector);
return { fetch: Effect.gen(function* () { // runtime const { eventPredictionSummaries } = yield* listEventPredictions({ eventId: { value: "order-123" }, }); return HttpServerResponse.json({ predictions: eventPredictionSummaries ?? [], }); }),};// on the Function effect:// .pipe(Effect.provide(FraudDetector.ListEventPredictionsHttp))