Skip to content

UpdateEventLabel

Source: src/AWS/FraudDetector/UpdateEventLabel.ts

Label a stored event in Amazon Fraud Detector — the effectful feedback call made from a deployed Lambda or Task when ground truth arrives (e.g. a chargeback confirms fraud). Labeled events improve future model training.

Provide the UpdateEventLabelHttp 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:UpdateEventLabel on the event type and injects its eventTypeName automatically.

// init
const updateEventLabel = yield* FraudDetector.UpdateEventLabel(eventType);
return {
fetch: Effect.gen(function* () {
// runtime — a chargeback arrived for this order
yield* updateEventLabel({
eventId: "order-123",
assignedLabel: "fraud",
labelTimestamp: new Date().toISOString(),
});
return HttpServerResponse.json({ ok: true });
}),
};
// on the Function effect:
// .pipe(Effect.provide(FraudDetector.UpdateEventLabelHttp))