| 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:BatchGetMetricData`. |
| 7 | * |
| 8 | * Fetches up to 10 aggregated deliverability metric time-series in one call — |
| 9 | * sends, deliveries, bounces, complaints, opens, clicks — over a date range, |
| 10 | * optionally sliced by dimension (ISP, configuration set, etc.). Requires VDM |
| 11 | * (Virtual Deliverability Manager) to be enabled; a malformed query surfaces |
| 12 | * the typed `BadRequestException`. Account-level operation. Provide the |
| 13 | * implementation with `Effect.provide(AWS.SES.BatchGetMetricDataHttp)`. |
| 14 | * ### Deliverability Insights |
| 15 | * **Example:** Query Send and Delivery Counts |
| 16 | * ```typescript |
| 17 | * // init — account-level binding, no resource argument |
| 18 | * const getMetrics = yield* SES.BatchGetMetricData(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Results } = yield* getMetrics({ |
| 22 | * Queries: [ |
| 23 | * { |
| 24 | * Id: "sends", |
| 25 | * Namespace: "VDM", |
| 26 | * Metric: "SEND", |
| 27 | * StartDate: new Date(Date.now() - 7 * 24 * 3600 * 1000), |
| 28 | * EndDate: new Date(), |
| 29 | * }, |
| 30 | * ], |
| 31 | * }); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface BatchGetMetricData extends Binding.Service< |
| 37 | BatchGetMetricData, |
| 38 | "AWS.SES.BatchGetMetricData", |
| 39 | () => Effect.Effect< |
| 40 | ( |
| 41 | request: sesv2.BatchGetMetricDataRequest, |
| 42 | ) => Effect.Effect< |
| 43 | sesv2.BatchGetMetricDataResponse, |
| 44 | sesv2.BatchGetMetricDataError |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | export const BatchGetMetricData = Binding.Service<BatchGetMetricData>( |
| 49 | "AWS.SES.BatchGetMetricData", |
| 50 | ); |