| 1 | import type * as sesv2 from "@distilled.cloud/aws/sesv2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `sesv2:GetMessageInsights`. |
| 7 | * |
| 8 | * Retrieves the delivery insights SES tracked for a single sent message — |
| 9 | * the per-recipient event timeline (send, delivery, open, click, bounce, |
| 10 | * complaint) plus the resolved subject, from-address, and tags. Requires VDM |
| 11 | * (Virtual Deliverability Manager) to be enabled and the message to have been |
| 12 | * sent within the retention window; an unknown message id fails with the |
| 13 | * typed `NotFoundException`. Account-level operation. Provide the |
| 14 | * implementation with `Effect.provide(AWS.SES.GetMessageInsightsHttp)`. |
| 15 | * ### Deliverability Insights |
| 16 | * **Example:** Look Up a Message's Delivery Timeline |
| 17 | * ```typescript |
| 18 | * // init — account-level binding, no resource argument |
| 19 | * const getInsights = yield* SES.GetMessageInsights(); |
| 20 | * |
| 21 | * // runtime — MessageId returned by a prior SendEmail |
| 22 | * const { Insights } = yield* getInsights({ MessageId: messageId }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetMessageInsights extends Binding.Service< |
| 28 | GetMessageInsights, |
| 29 | "AWS.SES.GetMessageInsights", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: sesv2.GetMessageInsightsRequest, |
| 33 | ) => Effect.Effect< |
| 34 | sesv2.GetMessageInsightsResponse, |
| 35 | sesv2.GetMessageInsightsError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetMessageInsights = Binding.Service<GetMessageInsights>( |
| 40 | "AWS.SES.GetMessageInsights", |
| 41 | ); |